ia64/xen-unstable

changeset 6249:e83fc5afec3c

Fix Xen patches to Linux so that they use pfn_pte() and
pfn_pte_ma() constructors, rather than splicing together
ptes manually. Not only is this cleaner, it also ensures
that the NX/XD bit is safely masked off on systems that do
not support it.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Thu Aug 18 15:01:03 2005 +0000 (2005-08-18)
parents ff31cdc8741f
children 684d81933442
files linux-2.6-xen-sparse/arch/xen/i386/mm/hypervisor.c linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/mm/hypervisor.c	Thu Aug 18 14:33:21 2005 +0000
     1.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/hypervisor.c	Thu Aug 18 15:01:03 2005 +0000
     1.3 @@ -348,7 +348,7 @@ void xen_create_contiguous_region(unsign
     1.4  	for (i = 0; i < (1<<order); i++) {
     1.5  		BUG_ON(HYPERVISOR_update_va_mapping(
     1.6  			vstart + (i*PAGE_SIZE),
     1.7 -			__pte_ma(((mfn+i)<<PAGE_SHIFT)|__PAGE_KERNEL), 0));
     1.8 +			pfn_pte_ma(mfn+i, PAGE_KERNEL), 0));
     1.9  		xen_machphys_update(mfn+i, (__pa(vstart)>>PAGE_SHIFT)+i);
    1.10  		phys_to_machine_mapping[(__pa(vstart)>>PAGE_SHIFT)+i] = mfn+i;
    1.11  	}
    1.12 @@ -395,7 +395,7 @@ void xen_destroy_contiguous_region(unsig
    1.13  			MEMOP_increase_reservation, &mfn, 1, 0) != 1);
    1.14  		BUG_ON(HYPERVISOR_update_va_mapping(
    1.15  			vstart + (i*PAGE_SIZE),
    1.16 -			__pte_ma((mfn<<PAGE_SHIFT)|__PAGE_KERNEL), 0));
    1.17 +			pfn_pte_ma(mfn, PAGE_KERNEL), 0));
    1.18  		xen_machphys_update(mfn, (__pa(vstart)>>PAGE_SHIFT)+i);
    1.19  		phys_to_machine_mapping[(__pa(vstart)>>PAGE_SHIFT)+i] = mfn;
    1.20  	}
     2.1 --- a/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c	Thu Aug 18 14:33:21 2005 +0000
     2.2 +++ b/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c	Thu Aug 18 15:01:03 2005 +0000
     2.3 @@ -213,9 +213,7 @@ static void balloon_process(void *unused
     2.4              {
     2.5                  BUG_ON(HYPERVISOR_update_va_mapping(
     2.6                      (unsigned long)__va(pfn << PAGE_SHIFT),
     2.7 -                    __pte_ma((mfn_list[i] << PAGE_SHIFT) |
     2.8 -                             pgprot_val(PAGE_KERNEL)),
     2.9 -                    0));
    2.10 +                    pfn_pte_ma(mfn_list[i], PAGE_KERNEL), 0));
    2.11              }
    2.12  
    2.13              /* Finally, relinquish the memory back to the system allocator. */
     3.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c	Thu Aug 18 14:33:21 2005 +0000
     3.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c	Thu Aug 18 15:01:03 2005 +0000
     3.3 @@ -406,21 +406,15 @@ static void dispatch_probe(blkif_t *blki
     3.4  #endif
     3.5  
     3.6  
     3.7 -#ifdef CONFIG_XEN_BLKDEV_TAP_BE
     3.8      if ( HYPERVISOR_update_va_mapping_otherdomain(
     3.9          MMAP_VADDR(pending_idx, 0),
    3.10 -        (pte_t) { (req->frame_and_sects[0] & PAGE_MASK) | __PAGE_KERNEL },
    3.11 +        pfn_pte_ma(req->frame_and_sects[0] >> PAGE_SHIFT, PAGE_KERNEL),
    3.12 +#ifdef CONFIG_XEN_BLKDEV_TAP_BE
    3.13          0, (blkif->is_blktap ? ID_TO_DOM(req->id) : blkif->domid) ) )
    3.14 -        
    3.15 -        goto out;
    3.16  #else
    3.17 -    if ( HYPERVISOR_update_va_mapping_otherdomain(
    3.18 -        MMAP_VADDR(pending_idx, 0),
    3.19 -        (pte_t) { (req->frame_and_sects[0] & PAGE_MASK) | __PAGE_KERNEL },
    3.20 -        0, blkif->domid) ) 
    3.21 -        
    3.22 +        0, blkif->domid) )
    3.23 +#endif
    3.24          goto out;
    3.25 -#endif
    3.26  #endif /* endif CONFIG_XEN_BLKDEV_GRANT */
    3.27     
    3.28      rsp = vbd_probe(blkif, (vdisk_t *)MMAP_VADDR(pending_idx, 0),