summaryrefslogtreecommitdiffstats
path: root/arch/x86/xen/mmu.c
diff options
context:
space:
mode:
authorJuergen Gross <jgross@suse.com>2016-06-23 07:12:27 +0200
committerDavid Vrabel <david.vrabel@citrix.com>2016-06-23 12:36:15 +0200
commit1cf38741308c64d08553602b3374fb39224eeb5a (patch)
tree4ebba7662d00f892e66bdd4cc9eb0fdd65f57c52 /arch/x86/xen/mmu.c
parentxen/balloon: Fix declared-but-not-defined warning (diff)
downloadlinux-1cf38741308c64d08553602b3374fb39224eeb5a.tar.xz
linux-1cf38741308c64d08553602b3374fb39224eeb5a.zip
x86/xen: fix upper bound of pmd loop in xen_cleanhighmap()
xen_cleanhighmap() is operating on level2_kernel_pgt only. The upper bound of the loop setting non-kernel-image entries to zero should not exceed the size of level2_kernel_pgt. Reported-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Juergen Gross <jgross@suse.com> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Diffstat (limited to 'arch/x86/xen/mmu.c')
-rw-r--r--arch/x86/xen/mmu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index 478a2de543a5..2693b7ed5a6f 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -1113,7 +1113,7 @@ static void __init xen_cleanhighmap(unsigned long vaddr,
/* NOTE: The loop is more greedy than the cleanup_highmap variant.
* We include the PMD passed in on _both_ boundaries. */
- for (; vaddr <= vaddr_end && (pmd < (level2_kernel_pgt + PAGE_SIZE));
+ for (; vaddr <= vaddr_end && (pmd < (level2_kernel_pgt + PTRS_PER_PMD));
pmd++, vaddr += PMD_SIZE) {
if (pmd_none(*pmd))
continue;