* [PATCH] x86: vsmp: avoid link error with gcc -Og
@ 2018-11-02 15:49 Arnd Bergmann
2018-11-05 11:27 ` Thomas Gleixner
0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2018-11-02 15:49 UTC (permalink / raw)
To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86
Cc: Arnd Bergmann, H. Peter Anvin, Juergen Gross, linux-kernel
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@arndb.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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] x86: vsmp: avoid link error with gcc -Og
2018-11-02 15:49 [PATCH] x86: vsmp: avoid link error with gcc -Og Arnd Bergmann
@ 2018-11-05 11:27 ` Thomas Gleixner
2018-11-05 14:53 ` Arnd Bergmann
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Gleixner @ 2018-11-05 11:27 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Ingo Molnar, Borislav Petkov, x86, H. Peter Anvin, Juergen Gross,
linux-kernel
Arnd,
On Fri, 2 Nov 2018, Arnd Bergmann wrote:
> When the compiler skips optimizations for ease of debugging,
> teh vsmp_cap_cpus() function is not eliminated from the build
> with CONFIG_PCI=n:
thanks for that, but the code has other issues, which are addressed with
this:
https://lkml.kernel.org/r/1541404864-31603-1-git-send-email-eial@scalemp.com
That should also solve the problem you've observed.
Thanks,
tglx
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] x86: vsmp: avoid link error with gcc -Og
2018-11-05 11:27 ` Thomas Gleixner
@ 2018-11-05 14:53 ` Arnd Bergmann
0 siblings, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2018-11-05 14:53 UTC (permalink / raw)
To: Thomas Gleixner
Cc: Ingo Molnar, Borislav Petkov, x86, H. Peter Anvin, Juergen Gross,
linux-kernel
On 11/5/18, Thomas Gleixner <tglx@linutronix.de> wrote:
> Arnd,
>
> On Fri, 2 Nov 2018, Arnd Bergmann wrote:
>
>> When the compiler skips optimizations for ease of debugging,
>> teh vsmp_cap_cpus() function is not eliminated from the build
>> with CONFIG_PCI=n:
>
> thanks for that, but the code has other issues, which are addressed with
> this:
>
>
> https://lkml.kernel.org/r/1541404864-31603-1-git-send-email-eial@scalemp.com
>
> That should also solve the problem you've observed.
Ok, I've dropped my patch from my test tree, will let you know if
I see any other issues with the new patch applied.
Arnd
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-11-05 14:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-02 15:49 [PATCH] x86: vsmp: avoid link error with gcc -Og Arnd Bergmann
2018-11-05 11:27 ` Thomas Gleixner
2018-11-05 14:53 ` Arnd Bergmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).