* [PATCH] x86: Call __va() to get trampoline_base.
@ 2009-12-04 16:26 Rakib Mullick
2009-12-05 1:25 ` H. Peter Anvin
0 siblings, 1 reply; 2+ messages in thread
From: Rakib Mullick @ 2009-12-04 16:26 UTC (permalink / raw)
To: Ingo Molnar; +Cc: Thomas Gleixner, H. Peter Anvin, LKML, x86
x86, tboot: Call __va() to get trampoline_base.
Do not pass trampoline_base as parameter of virt_to_phys.
Because trampoline_base is in .cpuinit.data section, but its
called from non-cpuinit function. So use __va(TRAMPOLINE_BASE)
instead of trampoline_base, which helps to fix section mismatch.
We were warned by the following warning:
LD arch/x86/kernel/built-in.o
WARNING: arch/x86/kernel/built-in.o(.text+0x13c5f): Section mismatch
in reference from the function tboot_setup_sleep() to the variable
.cpuinit.data:trampoline_base
The function tboot_setup_sleep() references
the variable __cpuinitdata trampoline_base.
This is often because tboot_setup_sleep lacks a __cpuinitdata
annotation or the annotation of trampoline_base is wrong.
Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com>
---
--- linus/arch/x86/kernel/tboot.c 2009-12-04 17:22:57.000000000 +0600
+++ rakib/arch/x86/kernel/tboot.c 2009-12-04 17:19:09.000000000 +0600
@@ -191,7 +191,7 @@ static int tboot_setup_sleep(void)
#ifdef CONFIG_X86_TRAMPOLINE
/* AP trampoline code */
- add_mac_region(virt_to_phys(trampoline_base), TRAMPOLINE_SIZE);
+ add_mac_region(virt_to_phys(__va(TRAMPOLINE_BASE)), TRAMPOLINE_SIZE);
#endif
/* kernel code + data + bss */
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] x86: Call __va() to get trampoline_base.
2009-12-04 16:26 [PATCH] x86: Call __va() to get trampoline_base Rakib Mullick
@ 2009-12-05 1:25 ` H. Peter Anvin
0 siblings, 0 replies; 2+ messages in thread
From: H. Peter Anvin @ 2009-12-05 1:25 UTC (permalink / raw)
To: Rakib Mullick, Cihula, Joseph, Shane Wang
Cc: Ingo Molnar, Thomas Gleixner, LKML, x86
On 12/04/2009 08:26 AM, Rakib Mullick wrote:
> x86, tboot: Call __va() to get trampoline_base.
>
> Do not pass trampoline_base as parameter of virt_to_phys.
> Because trampoline_base is in .cpuinit.data section, but its
> called from non-cpuinit function. So use __va(TRAMPOLINE_BASE)
> instead of trampoline_base, which helps to fix section mismatch.
>
> We were warned by the following warning:
>
> LD arch/x86/kernel/built-in.o
> WARNING: arch/x86/kernel/built-in.o(.text+0x13c5f): Section mismatch
> in reference from the function tboot_setup_sleep() to the variable
> .cpuinit.data:trampoline_base
> The function tboot_setup_sleep() references
> the variable __cpuinitdata trampoline_base.
> This is often because tboot_setup_sleep lacks a __cpuinitdata
> annotation or the annotation of trampoline_base is wrong.
>
> Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com>
This is a bug, but this isn't the right fix.
trampoline.c has:
#if defined(CONFIG_X86_64) && defined(CONFIG_ACPI_SLEEP)
#define __trampinit
#define __trampinitdata
#else
#define __trampinit __cpuinit
#define __trampinitdata __cpuinitdata
#endif
... because on i386 we don't use the trampoline for ACPI return.
This means one of these is true:
- Either we need the AP trampoline for tboot on i386, and the above
definition in trampoline.c needs to be fixed; or
- The CONFIG_X86_TRAMPOLINE in tboot.c is too generous, and in fact it
needs to be set to defined(CONFIG_X86_64) && defined(CONFIG_ACPI_SLEEP)
just like the above code.
Sending to Joseph and Shane to figure out...
-hpa
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-12-05 1:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-04 16:26 [PATCH] x86: Call __va() to get trampoline_base Rakib Mullick
2009-12-05 1:25 ` H. Peter Anvin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox