[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <43cb47df38e9be18402d9243aae4ac29b3728be9.camel@intel.com>
Date: Wed, 25 Oct 2023 03:50:53 +0000
From: "Huang, Kai" <kai.huang@...el.com>
To: "kirill.shutemov@...ux.intel.com" <kirill.shutemov@...ux.intel.com>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"mingo@...hat.com" <mingo@...hat.com>,
"dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>,
"x86@...nel.org" <x86@...nel.org>, "bp@...en8.de" <bp@...en8.de>
CC: "kexec@...ts.infradead.org" <kexec@...ts.infradead.org>,
"Edgecombe, Rick P" <rick.p.edgecombe@...el.com>,
"Reshetova, Elena" <elena.reshetova@...el.com>,
"rafael@...nel.org" <rafael@...nel.org>,
"Nakajima, Jun" <jun.nakajima@...el.com>,
"peterz@...radead.org" <peterz@...radead.org>,
"sathyanarayanan.kuppuswamy@...ux.intel.com"
<sathyanarayanan.kuppuswamy@...ux.intel.com>,
"Hunter, Adrian" <adrian.hunter@...el.com>,
"thomas.lendacky@....com" <thomas.lendacky@....com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"ashish.kalra@....com" <ashish.kalra@....com>,
"Christopherson,, Sean" <seanjc@...gle.com>,
"bhe@...hat.com" <bhe@...hat.com>,
"linux-coco@...ts.linux.dev" <linux-coco@...ts.linux.dev>
Subject: Re: [PATCHv2 13/13] x86/acpi: Add support for CPU offlining for ACPI
MADT wakeup method
> > + .text
> > + .align PAGE_SIZE
> > +SYM_FUNC_START(asm_acpi_mp_play_dead)
> > + /* Load address of reset vector into RCX to jump when kernel is ready */
> > + movq acpi_mp_reset_vector_paddr(%rip), %rcx
> > +
> > + /* Turn off global entries. Following CR3 write will flush them. */
> > + movq %cr4, %rdx
> > + andq $~(X86_CR4_PGE), %rdx
> > + movq %rdx, %cr4
> > +
> > + /* Switch to identity mapping */
> > + movq acpi_mp_pgd(%rip), %rax
> > + movq %rax, %cr3
>
> Do we need to switch back to kernel direct-map page table after CPU is wake up
> again? We do support normal CPU offline/online, but not limited to kexec,
> right?
Please ignore this. I found if I am reading right even for TDX guest the new
online cpu will start with trampoline_start64 assembly, so it will load kernel
page table anyway. Sorry for the noise.
[...]
> > + for (int i = 0; i < nr_pfn_mapped; i++) {
> > + unsigned long mstart, mend;
> > + mstart = pfn_mapped[i].start << PAGE_SHIFT;
> > + mend = pfn_mapped[i].end << PAGE_SHIFT;
> > + if (kernel_ident_mapping_init(&info, pgd, mstart, mend))
> > + return -ENOMEM;
> > + }
>
> This is for kexec() IIUC. Add a comment?
>
> If we consider normal CPU offline/online case, then I don't think we need the
> identity mapping for all memory?
>
Also this one. :-)
>
Powered by blists - more mailing lists