From: "Huang, Kai" <kai.huang@intel.com>
To: "kirill.shutemov@linux.intel.com" <kirill.shutemov@linux.intel.com>
Cc: "ardb@kernel.org" <ardb@kernel.org>,
"luto@kernel.org" <luto@kernel.org>,
"tzimmermann@suse.de" <tzimmermann@suse.de>,
"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
"thomas.lendacky@amd.com" <thomas.lendacky@amd.com>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"mingo@redhat.com" <mingo@redhat.com>,
"seanjc@google.com" <seanjc@google.com>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"bhe@redhat.com" <bhe@redhat.com>,
"hpa@zytor.com" <hpa@zytor.com>,
"peterz@infradead.org" <peterz@infradead.org>,
"bp@alien8.de" <bp@alien8.de>,
"rafael@kernel.org" <rafael@kernel.org>,
"Huang, Ying" <ying.huang@intel.com>,
"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
"x86@kernel.org" <x86@kernel.org>
Subject: Re: [PATCHv3 3/4] x86/64/kexec: Map original relocate_kernel() in init_transition_pgtable()
Date: Tue, 20 Aug 2024 11:52:29 +0000 [thread overview]
Message-ID: <4f9cd14415f1c01c937f6b3bdd56ba0243d47f94.camel@intel.com> (raw)
In-Reply-To: <hxw67ecixuf5mkj3ucwhsobvd6dyjhwjo32fu4jiwoxgrgk7rd@dklvwlnrewil>
On Tue, 2024-08-20 at 14:14 +0300, kirill.shutemov@linux.intel.com wrote:
> On Tue, Aug 20, 2024 at 11:06:34AM +0000, Huang, Kai wrote:
> > At later time:
> >
> > call swap_pages
> > movq $virtual_mapped, %rax <---- (1)
> > pushq %rax
> > ANNOTATE_UNRET_SAFE
> > ret <---- (2)
> >
> > (1) will load the VA which has __START_KERNEL_map to %rax, and after (2) the
> > kernel will run at VA of the original relocate_kernel() which maps to the PA
> > of the original relcoate_kernel(). But I think the memory page of the
> > original relocate_kernel() won't get corrupted after returning from the second
> > kernel, so should be safe to use?
>
> Yes.
>
Reviewed-by: Kai Huang <kai.huang@intel.com>
next prev parent reply other threads:[~2024-08-20 11:52 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-19 7:08 [PATCHv3 0/4] x86: Reduce code duplication on page table initialization Kirill A. Shutemov
2024-08-19 7:08 ` [PATCHv3 1/4] x86/mm/ident_map: Fix virtual address wrap to zero Kirill A. Shutemov
2024-08-19 7:08 ` [PATCHv3 2/4] x86/acpi: Replace manual page table initialization with kernel_ident_mapping_init() Kirill A. Shutemov
2024-08-19 19:26 ` Rafael J. Wysocki
2024-08-19 7:08 ` [PATCHv3 3/4] x86/64/kexec: Map original relocate_kernel() in init_transition_pgtable() Kirill A. Shutemov
2024-08-19 11:16 ` Huang, Kai
2024-08-19 11:57 ` kirill.shutemov
2024-08-19 12:39 ` Huang, Kai
2024-08-20 10:13 ` kirill.shutemov
2024-08-20 11:06 ` Huang, Kai
2024-08-20 11:14 ` kirill.shutemov
2024-08-20 11:52 ` Huang, Kai [this message]
2024-08-19 7:08 ` [PATCHv3 4/4] x86/64/kexec: Rewrite init_transition_pgtable() with kernel_ident_mapping_init() Kirill A. Shutemov
2024-08-20 11:53 ` Huang, Kai
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=4f9cd14415f1c01c937f6b3bdd56ba0243d47f94.camel@intel.com \
--to=kai.huang@intel.com \
--cc=akpm@linux-foundation.org \
--cc=ardb@kernel.org \
--cc=bhe@redhat.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rafael@kernel.org \
--cc=seanjc@google.com \
--cc=tglx@linutronix.de \
--cc=thomas.lendacky@amd.com \
--cc=tzimmermann@suse.de \
--cc=x86@kernel.org \
--cc=ying.huang@intel.com \
/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®