From: "Hou Wenlong" <houwenlong.hwl@antgroup.com>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org,
"Lai Jiangshan" <jiangshan.ljs@antgroup.com>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Ingo Molnar" <mingo@redhat.com>,
"Borislav Petkov" <bp@alien8.de>,
"Dave Hansen" <dave.hansen@linux.intel.com>,
"maintainer:X86 ARCHITECTURE 32-BIT AND 64-BIT" <x86@kernel.org>,
"H. Peter Anvin" <hpa@zytor.com>,
"Josh Poimboeuf" <jpoimboe@kernel.org>,
"Anshuman Khandual" <anshuman.khandual@arm.com>,
"Mike Rapoport" <rppt@kernel.org>,
"Pasha Tatashin" <pasha.tatashin@soleen.com>
Subject: Re: [PATCH RFC 1/7] x86/head/64: Mark startup_gdt and startup_gdt_descr as __initdata
Date: Tue, 17 Oct 2023 15:23:11 +0800 [thread overview]
Message-ID: <20231017072311.GA46993@k08j02272.eu95sqa> (raw)
In-Reply-To: <ZS0lEmEpQOz4iQ4Q@gmail.com>
On Mon, Oct 16, 2023 at 07:57:06PM +0800, Ingo Molnar wrote:
>
> * Hou Wenlong <houwenlong.hwl@antgroup.com> wrote:
>
> > As startup_gdt and startup_gdt_descr are only used in booting, make them
> > as __initdata to allow them to be freed after boot.
> >
> > Signed-off-by: Hou Wenlong <houwenlong.hwl@antgroup.com>
> > ---
> > arch/x86/kernel/head64.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
> > index 49f7629b17f7..dd357807ffb5 100644
> > --- a/arch/x86/kernel/head64.c
> > +++ b/arch/x86/kernel/head64.c
> > @@ -69,7 +69,7 @@ EXPORT_SYMBOL(vmemmap_base);
> > /*
> > * GDT used on the boot CPU before switching to virtual addresses.
> > */
> > -static struct desc_struct startup_gdt[GDT_ENTRIES] = {
> > +static struct desc_struct startup_gdt[GDT_ENTRIES] __initdata = {
> > [GDT_ENTRY_KERNEL32_CS] = GDT_ENTRY_INIT(0xc09b, 0, 0xfffff),
> > [GDT_ENTRY_KERNEL_CS] = GDT_ENTRY_INIT(0xa09b, 0, 0xfffff),
> > [GDT_ENTRY_KERNEL_DS] = GDT_ENTRY_INIT(0xc093, 0, 0xfffff),
> > @@ -79,7 +79,7 @@ static struct desc_struct startup_gdt[GDT_ENTRIES] = {
> > * Address needs to be set at runtime because it references the startup_gdt
> > * while the kernel still uses a direct mapping.
> > */
> > -static struct desc_ptr startup_gdt_descr = {
> > +static struct desc_ptr startup_gdt_descr __initdata = {
> > .size = sizeof(startup_gdt),
> > .address = 0,
>
> Yeah, so I think this and patch #1 are independently useful of the PIE
> feature, and I merged them into tip:x86/boot for a v6.7 merge.
>
> Mind re-sending any other patches for x86 that can be merged? For example
> patch #6 looks good too, but was mixed up a bit with a previous
> PIE-enablement patch. Moving the __head definition to a header should also
> probably done as a separate patch, followed by the widening of its use.
>
Hi Ingo,
I have sent patch #6 separately for x86. Do you have any ideas about
building the head code as PIE? Should I resend the patchset for the PIE
feature?
Thanks!
> Thanks,
>
> Ingo
next prev parent reply other threads:[~2023-10-17 7:23 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-12 3:30 [PATCH RFC 0/7] x86/head/64: Build the head code as PIE Hou Wenlong
2023-07-12 3:30 ` [PATCH RFC 1/7] x86/head/64: Mark startup_gdt and startup_gdt_descr as __initdata Hou Wenlong
2023-10-16 11:57 ` Ingo Molnar
2023-10-17 7:23 ` Hou Wenlong [this message]
2023-10-17 13:02 ` Ingo Molnar
2023-10-17 16:34 ` H. Peter Anvin
2023-10-18 11:45 ` Ingo Molnar
2023-11-10 0:03 ` Josh Poimboeuf
2023-10-18 8:36 ` Hou Wenlong
2023-07-12 3:30 ` [PATCH RFC 2/7] x86/head/64: Add missing __head annotation to startup_64_load_idt() Hou Wenlong
2023-07-12 3:30 ` [PATCH RFC 3/7] x86/head/64: Move all head code from head64.c into another file Hou Wenlong
2023-07-12 3:30 ` [PATCH RFC 4/7] x86/boot/compressed: Adapt sed command if head code is built as PIE Hou Wenlong
2023-07-12 3:30 ` [PATCH RFC 5/7] x86/head/64: Build the head code " Hou Wenlong
2023-07-12 3:30 ` [PATCH RFC 6/7] x86/sme: Mark code as __head in mem_encrypt_identity.c Hou Wenlong
2023-07-12 3:30 ` [PATCH RFC 7/7] x86/sme: Build the code in mem_encrypt_identity.c as PIE Hou Wenlong
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=20231017072311.GA46993@k08j02272.eu95sqa \
--to=houwenlong.hwl@antgroup.com \
--cc=anshuman.khandual@arm.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=jiangshan.ljs@antgroup.com \
--cc=jpoimboe@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=mingo@redhat.com \
--cc=pasha.tatashin@soleen.com \
--cc=rppt@kernel.org \
--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
all inboxes | Powered by JetHome®