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]
Date:   Fri,  2 Nov 2018 16:49:22 +0100
From:   Arnd Bergmann <arnd@...db.de>
To:     Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        x86@...nel.org
Cc:     Arnd Bergmann <arnd@...db.de>, "H. Peter Anvin" <hpa@...or.com>,
        Juergen Gross <jgross@...e.com>, linux-kernel@...r.kernel.org
Subject: [PATCH] x86: vsmp: avoid link error with gcc -Og

When the compiler skips optimizations for ease of debugging,
teh vsmp_cap_cpus() function is not eliminated from the build
with CONFIG_PCI=n:

arch/x86/kernel/vsmp_64.o: In function `vsmp_cap_cpus':
vsmp_64.c:(.init.text+0x23): undefined reference to `read_pci_config'

Change the caller in a way that will always optimize this
as required.

Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
 arch/x86/kernel/vsmp_64.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/arch/x86/kernel/vsmp_64.c b/arch/x86/kernel/vsmp_64.c
index 1eae5af491c2..6a2ae6964ce5 100644
--- a/arch/x86/kernel/vsmp_64.c
+++ b/arch/x86/kernel/vsmp_64.c
@@ -146,8 +146,10 @@ static void __init detect_vsmp_box(void)
 		is_vsmp = 1;
 }
 
-static int is_vsmp_box(void)
+static int __init is_vsmp_box(void)
 {
+	detect_vsmp_box();
+
 	if (is_vsmp != -1)
 		return is_vsmp;
 	else {
@@ -157,10 +159,7 @@ static int is_vsmp_box(void)
 }
 
 #else
-static void __init detect_vsmp_box(void)
-{
-}
-static int is_vsmp_box(void)
+static __always_inline int is_vsmp_box(void)
 {
 	return 0;
 }
@@ -213,7 +212,6 @@ static void vsmp_apic_post_init(void)
 
 void __init vsmp_init(void)
 {
-	detect_vsmp_box();
 	if (!is_vsmp_box())
 		return;
 
-- 
2.18.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ