debuggers.hg

changeset 21985:9e58c46ee63b

Intel EPT: Fix out of range right shift on 32-bit host

Currently, there has a logic to check whether the EPT GFN is exceeding
guest physical address width. It uses right shift(>>) to implement the
check. But the right shift count is greater than the width of the
type(unsigned long = 32) under the PAE. And this will cause guest boot
fail under PAE with EPT supported.

Signed-off-by: Li Xin <xin.li@intel.com>
Signed-off-by: Zhang Yang <yang.z.zhang@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Aug 09 16:40:18 2010 +0100 (2010-08-09)
parents 07ea977397e0
children e7afe98afd43
files xen/arch/x86/mm/hap/p2m-ept.c
line diff
     1.1 --- a/xen/arch/x86/mm/hap/p2m-ept.c	Mon Aug 09 16:39:09 2010 +0100
     1.2 +++ b/xen/arch/x86/mm/hap/p2m-ept.c	Mon Aug 09 16:40:18 2010 +0100
     1.3 @@ -267,7 +267,7 @@ ept_set_entry(struct domain *d, unsigned
     1.4       * 3. passing a valid order.
     1.5       */
     1.6      if ( ((gfn | mfn_x(mfn)) & ((1UL << order) - 1)) ||
     1.7 -         (gfn >> ((ept_get_wl(d) + 1) * EPT_TABLE_ORDER)) ||
     1.8 +         ((u64)gfn >> ((ept_get_wl(d) + 1) * EPT_TABLE_ORDER)) ||
     1.9           (order % EPT_TABLE_ORDER) )
    1.10          return 0;
    1.11