x86/mm: Fix marking of unused sub-pmd ranges
authorAdrian-Ken Rueegsegger <ken@codelabs.ch>
Mon, 9 May 2022 09:06:37 +0000 (11:06 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 May 2022 08:26:54 +0000 (10:26 +0200)
commit04d5b08e66971ba6ee73b6b3d06234b58438bc25
tree9cdf39a9d1a1283039c37af15555dd252a58a73c
parent5399686de11ec2c21ad2b04698e2225b4f7cbca2
x86/mm: Fix marking of unused sub-pmd ranges

commit 280abe14b6e0a38de9cc86fe6a019523aadd8f70 upstream.

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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/mm/init_64.c