direct-io.hg

changeset 5544:6446c0567c5c

bitkeeper revision 1.1726.2.4 (42ba7764ufxk9A-swAcfL3FabbYQ2w)

Fix alloc_{l2,l3}_table to correctly compute longword-sized virtual
address from int-sized pagetable index. Based on discussion from
Scott Parish and Jan Beulich.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Thu Jun 23 08:48:36 2005 +0000 (2005-06-23)
parents 9ffcc5189703
children 76f16636bbb5
files xen/arch/x86/mm.c
line diff
     1.1 --- a/xen/arch/x86/mm.c	Thu Jun 23 08:40:39 2005 +0000
     1.2 +++ b/xen/arch/x86/mm.c	Thu Jun 23 08:48:36 2005 +0000
     1.3 @@ -753,7 +753,7 @@ static inline int l1_backptr(
     1.4  #else
     1.5  # define create_pae_xen_mappings(pl3e) (1)
     1.6  # define l1_backptr(bp,l2o,l2t) \
     1.7 -    ({ *(bp) = (l2o) << L2_PAGETABLE_SHIFT; 1; })
     1.8 +    ({ *(bp) = (unsigned long)(l2o) << L2_PAGETABLE_SHIFT; 1; })
     1.9  #endif
    1.10  
    1.11  static int alloc_l2_table(struct pfn_info *page, unsigned int type)
    1.12 @@ -821,7 +821,7 @@ static int alloc_l3_table(struct pfn_inf
    1.13      pl3e = map_domain_page(pfn);
    1.14      for ( i = 0; i < L3_PAGETABLE_ENTRIES; i++ )
    1.15      {
    1.16 -        vaddr = i << L3_PAGETABLE_SHIFT;
    1.17 +        vaddr = (unsigned long)i << L3_PAGETABLE_SHIFT;
    1.18          if ( is_guest_l3_slot(i) &&
    1.19               unlikely(!get_page_from_l3e(pl3e[i], pfn, d, vaddr)) )
    1.20              goto fail;