From: "H. Peter Anvin" <hpa@zytor.com>
To: Rakib Mullick <rakib.mullick@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
LKML <linux-kernel@vger.kernel.org>,
x86@kernel.org, "Cihula, Joseph" <joseph.cihula@intel.com>,
Shane Wang <shane.wang@intel.com>
Subject: Re: [PATCH] x86: Put trampoline_data into readonly section.
Date: Fri, 04 Dec 2009 17:19:55 -0800 [thread overview]
Message-ID: <4B19B53B.60605@zytor.com> (raw)
In-Reply-To: <b9df5fa10912040824r4c496b54x6165523935293001@mail.gmail.com>
On 12/04/2009 08:24 AM, Rakib Mullick wrote:
> WARNING: arch/x86/kernel/built-in.o(.text+0x13c77): Section mismatch
> in reference from the function tboot_setup_sleep() to the variable
> .cpuinit.rodata:trampoline_end
> The function tboot_setup_sleep() references
> the variable __cpuinitconst trampoline_end.
> This is often because tboot_setup_sleep lacks a __cpuinitconst
> annotation or the annotation of trampoline_end is wrong.
>
> WARNING: arch/x86/kernel/built-in.o(.text+0x13c84): Section mismatch
> in reference from the function tboot_setup_sleep() to the variable
> .cpuinit.rodata:trampoline_data
> The function tboot_setup_sleep() references
> the variable __cpuinitconst trampoline_data.
> This is often because tboot_setup_sleep lacks a __cpuinitconst
> annotation or the annotation of trampoline_data is wrong.
>
> --- linus/arch/x86/kernel/trampoline_32.S 2009-12-04 17:17:51.000000000 +0600
> +++ rakib/arch/x86/kernel/trampoline_32.S 2009-12-04 17:24:44.000000000 +0600
> @@ -32,8 +32,13 @@
> #include <asm/segment.h>
> #include <asm/page_types.h>
>
> +#ifdef CONFIG_ACPI_SLEEP
> +.section .rodata, "a", @progbits
> +#else
> /* We can free up trampoline after bootup if cpu hotplug is not supported. */
> __CPUINITRODATA
> +#endif
> +
This is a false positive.
The reference in question is actually:
add_mac_region(virt_to_phys(trampoline_base), TRAMPOLINE_SIZE);
... which in turn is defined as ...
#define TRAMPOLINE_SIZE roundup(trampoline_end - trampoline_data, PAGE_SIZE)
This causes "references" of two symbols which aren't actually referenced
at all.
Perhaps the better thing would be to define trampoline_size as an
absolute symbol in arch/x86/kernel/trampoline_*.S, especially since it
probably generates bad code to subtract two global symbols like that.
-hpa
next prev parent reply other threads:[~2009-12-05 1:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-04 16:24 [PATCH] x86: Put trampoline_data into readonly section Rakib Mullick
2009-12-05 1:19 ` H. Peter Anvin [this message]
2009-12-05 4:47 ` Rakib Mullick
2009-12-05 6:16 ` H. Peter Anvin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4B19B53B.60605@zytor.com \
--to=hpa@zytor.com \
--cc=joseph.cihula@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rakib.mullick@gmail.com \
--cc=shane.wang@intel.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox