# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID e83fc5afec3c3c32d5d8d8ca21698e67d92f5f4d
# Parent ff31cdc8741f91cbc77788e0c015195e55ff1614
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@xxxxxxxxxxxxx>
diff -r ff31cdc8741f -r e83fc5afec3c
linux-2.6-xen-sparse/arch/xen/i386/mm/hypervisor.c
--- a/linux-2.6-xen-sparse/arch/xen/i386/mm/hypervisor.c Thu Aug 18
14:33:21 2005
+++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/hypervisor.c Thu Aug 18
15:01:03 2005
@@ -348,7 +348,7 @@
for (i = 0; i < (1<<order); i++) {
BUG_ON(HYPERVISOR_update_va_mapping(
vstart + (i*PAGE_SIZE),
- __pte_ma(((mfn+i)<<PAGE_SHIFT)|__PAGE_KERNEL), 0));
+ pfn_pte_ma(mfn+i, PAGE_KERNEL), 0));
xen_machphys_update(mfn+i, (__pa(vstart)>>PAGE_SHIFT)+i);
phys_to_machine_mapping[(__pa(vstart)>>PAGE_SHIFT)+i] = mfn+i;
}
@@ -395,7 +395,7 @@
MEMOP_increase_reservation, &mfn, 1, 0) != 1);
BUG_ON(HYPERVISOR_update_va_mapping(
vstart + (i*PAGE_SIZE),
- __pte_ma((mfn<<PAGE_SHIFT)|__PAGE_KERNEL), 0));
+ pfn_pte_ma(mfn, PAGE_KERNEL), 0));
xen_machphys_update(mfn, (__pa(vstart)>>PAGE_SHIFT)+i);
phys_to_machine_mapping[(__pa(vstart)>>PAGE_SHIFT)+i] = mfn;
}
diff -r ff31cdc8741f -r e83fc5afec3c
linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c
--- a/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c Thu Aug 18
14:33:21 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c Thu Aug 18
15:01:03 2005
@@ -213,9 +213,7 @@
{
BUG_ON(HYPERVISOR_update_va_mapping(
(unsigned long)__va(pfn << PAGE_SHIFT),
- __pte_ma((mfn_list[i] << PAGE_SHIFT) |
- pgprot_val(PAGE_KERNEL)),
- 0));
+ pfn_pte_ma(mfn_list[i], PAGE_KERNEL), 0));
}
/* Finally, relinquish the memory back to the system allocator. */
diff -r ff31cdc8741f -r e83fc5afec3c
linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c
--- a/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c Thu Aug 18
14:33:21 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c Thu Aug 18
15:01:03 2005
@@ -406,21 +406,15 @@
#endif
-#ifdef CONFIG_XEN_BLKDEV_TAP_BE
if ( HYPERVISOR_update_va_mapping_otherdomain(
MMAP_VADDR(pending_idx, 0),
- (pte_t) { (req->frame_and_sects[0] & PAGE_MASK) | __PAGE_KERNEL },
+ pfn_pte_ma(req->frame_and_sects[0] >> PAGE_SHIFT, PAGE_KERNEL),
+#ifdef CONFIG_XEN_BLKDEV_TAP_BE
0, (blkif->is_blktap ? ID_TO_DOM(req->id) : blkif->domid) ) )
-
+#else
+ 0, blkif->domid) )
+#endif
goto out;
-#else
- if ( HYPERVISOR_update_va_mapping_otherdomain(
- MMAP_VADDR(pending_idx, 0),
- (pte_t) { (req->frame_and_sects[0] & PAGE_MASK) | __PAGE_KERNEL },
- 0, blkif->domid) )
-
- goto out;
-#endif
#endif /* endif CONFIG_XEN_BLKDEV_GRANT */
rsp = vbd_probe(blkif, (vdisk_t *)MMAP_VADDR(pending_idx, 0),
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|