xcp-1.6-updates/xen-4.1.hg

changeset 23286:b1e2ca715ae7

x86-64: Fix memory hotplug epfn upper limit test for updating the compat M2P table

The epfn is being compared to (RDWR_COMPAT_MPT_VIRT_END -
RDWR_COMPAT_MPT_VIRT_START) without a 2 bit shift, resulting in the
epfn being compared to the size of the RDWR_COMPAT_MPT table in bytes
instead of the maximum page frame number that the RDWR_COMPAT_MPT
table can map.

Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 25242:b7ce6a88bebb
xen-unstable date: Wed Apr 25 12:35:56 2012 +0200
author Malcolm Crossley <malcolm.crossley@citrix.com>
date Tue May 01 14:13:58 2012 +0100 (2012-05-01)
parents 99517f769cc8
children a21938b58fc4
files xen/arch/x86/x86_64/mm.c
line diff
     1.1 --- a/xen/arch/x86/x86_64/mm.c	Tue Apr 24 18:38:19 2012 +0100
     1.2 +++ b/xen/arch/x86/x86_64/mm.c	Tue May 01 14:13:58 2012 +0100
     1.3 @@ -450,7 +450,7 @@ static int setup_compat_m2p_table(struct
     1.4      if   ((smap > ((RDWR_COMPAT_MPT_VIRT_END - RDWR_COMPAT_MPT_VIRT_START) >> 2)) )
     1.5          return 0;
     1.6  
     1.7 -    if (epfn > (RDWR_COMPAT_MPT_VIRT_END - RDWR_COMPAT_MPT_VIRT_START))
     1.8 +    if ( epfn > ((RDWR_COMPAT_MPT_VIRT_END - RDWR_COMPAT_MPT_VIRT_START) >> 2) )
     1.9          epfn = (RDWR_COMPAT_MPT_VIRT_END - RDWR_COMPAT_MPT_VIRT_START) >> 2;
    1.10  
    1.11      emap = ( (epfn + ((1UL << (L2_PAGETABLE_SHIFT - 2)) - 1 )) &