lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231008082827.279154-1-yaolu@kylinos.cn>
Date:   Sun,  8 Oct 2023 16:28:27 +0800
From:   yaolu <yaolu@...inos.cn>
To:     tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
        dave.hansen@...ux.intel.com
Cc:     x86@...nel.org, hpa@...or.com, linux-kernel@...r.kernel.org,
        yaolu <yaolu@...inos.cn>
Subject: [PATCH] x86/msi: Fix compile error "incomplete typedef 'msi_alloc_info_t'"

When compiling the x86 kernel, if X86_64 || SMP || X86_32_NON_STANDARD ||
X86_UP_APIC || PCI_MSI is not enabled in '.config' and GENERIC_MSI_IRQ is
selected, the following compilation error will occur:

> include/linux/gpio/driver.h:38:19: error:
>   field 'msiinfo' has incomplete type
> kernel/irq/msi.c:752:5: error: invalid use of incomplete typedef
>   'msi_alloc_info_t' {aka 'struct irq_alloc_info'}
> kernel/irq/msi.c:740:1: error: control reaches end of non-void function

This is because 'X86_LOCAL_APIC' is not defined, but file such as
'kernel/irq/msi.c' only depends on 'GENERIC_MSI_IRQ', and uses
'struct msi_alloc_info_t'. When enable 'GENERIC_MSI_IRQ' will select
'IRQ_DOMAIN_HIERARCHY', so exposing this struct using
'IRQ_DOMAIN_HIERARCHY' rather than 'X86_LOCAL_APIC'.

Signed-off-by: yaolu <yaolu@...inos.cn>
---
 arch/x86/include/asm/hw_irq.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/include/asm/hw_irq.h b/arch/x86/include/asm/hw_irq.h
index 551829884734..b02c3cd3c0f6 100644
--- a/arch/x86/include/asm/hw_irq.h
+++ b/arch/x86/include/asm/hw_irq.h
@@ -28,7 +28,7 @@
 #include <asm/irq.h>
 #include <asm/sections.h>
 
-#ifdef	CONFIG_X86_LOCAL_APIC
+#ifdef	CONFIG_IRQ_DOMAIN_HIERARCHY
 struct irq_data;
 struct pci_dev;
 struct msi_desc;
@@ -105,10 +105,10 @@ static inline void irq_complete_move(struct irq_cfg *c) { }
 #endif
 
 extern void apic_ack_edge(struct irq_data *data);
-#else	/*  CONFIG_X86_LOCAL_APIC */
+#else	/*  CONFIG_IRQ_DOMAIN_HIERARCHY */
 static inline void lock_vector_lock(void) {}
 static inline void unlock_vector_lock(void) {}
-#endif	/* CONFIG_X86_LOCAL_APIC */
+#endif	/* CONFIG_IRQ_DOMAIN_HIERARCHY */
 
 /* Statistics */
 extern atomic_t irq_err_count;
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ