From: "tip-bot2 for Adrian-Ken Rueegsegger" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: "Adrian-Ken Rueegsegger" <ken@codelabs.ch>,
Thomas Gleixner <tglx@linutronix.de>,
Oscar Salvador <osalvador@suse.de>,
David Hildenbrand <david@redhat.com>,
stable@vger.kernel.org, x86@kernel.org,
linux-kernel@vger.kernel.org
Subject: [tip: x86/urgent] x86/mm: Fix marking of unused sub-pmd ranges
Date: Fri, 13 May 2022 10:44:57 -0000 [thread overview]
Message-ID: <165243869785.4207.350965258098905435.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20220509090637.24152-2-ken@codelabs.ch>
The following commit has been merged into the x86/urgent branch of tip:
Commit-ID: 280abe14b6e0a38de9cc86fe6a019523aadd8f70
Gitweb: https://git.kernel.org/tip/280abe14b6e0a38de9cc86fe6a019523aadd8f70
Author: Adrian-Ken Rueegsegger <ken@codelabs.ch>
AuthorDate: Mon, 09 May 2022 11:06:37 +02:00
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Fri, 13 May 2022 12:41:21 +02:00
x86/mm: Fix marking of unused sub-pmd ranges
The unused part precedes the new range spanned by the start, end parameters
of vmemmap_use_new_sub_pmd(). This means it actually goes from
ALIGN_DOWN(start, PMD_SIZE) up to start.
Use the correct address when applying the mark using memset.
Fixes: 8d400913c231 ("x86/vmemmap: handle unpopulated sub-pmd ranges")
Signed-off-by: Adrian-Ken Rueegsegger <ken@codelabs.ch>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Oscar Salvador <osalvador@suse.de>
Reviewed-by: David Hildenbrand <david@redhat.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20220509090637.24152-2-ken@codelabs.ch
---
arch/x86/mm/init_64.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 96d34eb..e294233 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -902,6 +902,8 @@ static void __meminit vmemmap_use_sub_pmd(unsigned long start, unsigned long end
static void __meminit vmemmap_use_new_sub_pmd(unsigned long start, unsigned long end)
{
+ const unsigned long page = ALIGN_DOWN(start, PMD_SIZE);
+
vmemmap_flush_unused_pmd();
/*
@@ -914,8 +916,7 @@ static void __meminit vmemmap_use_new_sub_pmd(unsigned long start, unsigned long
* Mark with PAGE_UNUSED the unused parts of the new memmap range
*/
if (!IS_ALIGNED(start, PMD_SIZE))
- memset((void *)start, PAGE_UNUSED,
- start - ALIGN_DOWN(start, PMD_SIZE));
+ memset((void *)page, PAGE_UNUSED, start - page);
/*
* We want to avoid memset(PAGE_UNUSED) when populating the vmemmap of
prev parent reply other threads:[~2022-05-13 10:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-09 9:06 Unhandled page fault in vmemmap_populate on x86_64 Adrian-Ken Rueegsegger
2022-05-09 9:06 ` [PATCH] x86/mm: Fix marking of unused sub-pmd ranges Adrian-Ken Rueegsegger
2022-05-12 9:04 ` David Hildenbrand
2022-05-12 16:54 ` Thomas Gleixner
2022-05-13 7:36 ` Oscar Salvador
2022-05-13 10:44 ` tip-bot2 for Adrian-Ken Rueegsegger [this message]
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=165243869785.4207.350965258098905435.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=david@redhat.com \
--cc=ken@codelabs.ch \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=osalvador@suse.de \
--cc=stable@vger.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®