From: Wei Yang <richard.weiyang@gmail.com>
To: Wei Yang <richard.weiyang@gmail.com>
Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de,
dave.hansen@linux.intel.com, x86@kernel.org,
linux-kernel@vger.kernel.org, Vivek Goyal <vgoyal@in.ibm.com>,
"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
Ingo Molnar <mingo@kernel.org>, Steve Wahl <steve.wahl@hpe.com>,
Borislav Petkov <bp@suse.de>
Subject: Re: [PATCH] x86/head/64: level2_kernel_pgt's kernel area is built with _PAGE_PRESENT set
Date: Wed, 22 May 2024 07:34:49 +0000 [thread overview]
Message-ID: <20240522073449.sd4qfvysvjbkc6t3@master> (raw)
In-Reply-To: <20240323232621.10400-1-richard.weiyang@gmail.com>
On Sat, Mar 23, 2024 at 11:26:21PM +0000, Wei Yang wrote:
>The code is first introduced in 'commit 1ab60e0f72f7 ("[PATCH] x86-64:
>Relocatable Kernel Support")'. Then 'commit c88d71508e36b
>("x86/boot/64: Rewrite startup_64() in C")', convert it to c. And
>'commit 2aa85f246c181 ("x86/boot/64: Make level2_kernel_pgt pages
>invalid outside kernel area")' limit the range from _text to _end.
>
>Originally, it does the check because the loop iterate the whole
>level2_kernel_pgt, while currently it just fixup the kernel area. This
>area is built with _PAGE_PRESENT set.
Ping
>
>Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
>CC: Vivek Goyal <vgoyal@in.ibm.com>
>CC: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
>CC: Ingo Molnar <mingo@kernel.org>
>CC: Steve Wahl <steve.wahl@hpe.com>
>CC: Borislav Petkov <bp@suse.de>
>---
> arch/x86/kernel/head64.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
>diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
>index 212e8e06aeba..75c69f8620d8 100644
>--- a/arch/x86/kernel/head64.c
>+++ b/arch/x86/kernel/head64.c
>@@ -253,8 +253,7 @@ unsigned long __head __startup_64(unsigned long physaddr,
>
> /* fixup pages that are part of the kernel image */
> for (; i <= pmd_index((unsigned long)_end); i++)
>- if (pmd[i] & _PAGE_PRESENT)
>- pmd[i] += load_delta;
>+ pmd[i] += load_delta;
>
> /* invalidate pages after the kernel image */
> for (; i < PTRS_PER_PMD; i++)
>--
>2.34.1
--
Wei Yang
Help you, Help me
next prev parent reply other threads:[~2024-05-22 7:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-23 23:26 [PATCH] x86/head/64: level2_kernel_pgt's kernel area is built with _PAGE_PRESENT set Wei Yang
2024-05-22 7:34 ` Wei Yang [this message]
2024-05-22 9:58 ` Thomas Gleixner
2024-05-22 14:06 ` Wei Yang
2024-05-22 20:33 ` Thomas Gleixner
2024-05-23 7:43 ` Wei Yang
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=20240522073449.sd4qfvysvjbkc6t3@master \
--to=richard.weiyang@gmail.com \
--cc=bp@alien8.de \
--cc=bp@suse.de \
--cc=dave.hansen@linux.intel.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=mingo@redhat.com \
--cc=steve.wahl@hpe.com \
--cc=tglx@linutronix.de \
--cc=vgoyal@in.ibm.com \
--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