From: Thomas Gleixner <tglx@linutronix.de>
To: David Hildenbrand <david@redhat.com>,
Adrian-Ken Rueegsegger <ken@codelabs.ch>,
dave.hansen@linux.intel.com, osalvador@suse.de
Cc: luto@kernel.org, peterz@infradead.org, mingo@redhat.com,
bp@alien8.de, hpa@zytor.com, x86@kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/mm: Fix marking of unused sub-pmd ranges
Date: Thu, 12 May 2022 18:54:50 +0200 [thread overview]
Message-ID: <87bkw2vgh1.ffs@tglx> (raw)
In-Reply-To: <8f2af450-1080-2dcd-9c85-6190e7e14f27@redhat.com>
On Thu, May 12 2022 at 11:04, David Hildenbrand wrote:
> On 09.05.22 11:06, Adrian-Ken Rueegsegger wrote:
>> 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
>
> As the x86 code was based on my s390x code, I assume that this was
> accidentally introduced in the x86 variant.
>
> We'd be marking the wrong range PAGE_UNUSED.
>
> Your fix looks correct to me:
>
> Reviewed-by: David Hildenbrand <david@redhat.com>
>
> Do we want to cc stable?
Yes, we'll add it when picking it up.
I really have to ask why this duplicated code exists in the first
place. There is zero architecture specific code neither in the s390 nor
in the x86 version.
The x86 version is just copy & pasta & fatfinger, if I'm not missing
something here.
Thanks,
tglx
next prev parent reply other threads:[~2022-05-12 16:55 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 [this message]
2022-05-13 7:36 ` Oscar Salvador
2022-05-13 10:44 ` [tip: x86/urgent] " tip-bot2 for Adrian-Ken Rueegsegger
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=87bkw2vgh1.ffs@tglx \
--to=tglx@linutronix.de \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=david@redhat.com \
--cc=hpa@zytor.com \
--cc=ken@codelabs.ch \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=osalvador@suse.de \
--cc=peterz@infradead.org \
--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