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>
This commit is contained in:
kaf24@firebug.cl.cam.ac.uk committed 2005-08-18 15:01:03 +00:00
1 parent 68bcc33d2e
commit ba19712966
3 files changed
+8 -16

No files matched your search

@@ -348,7 +348,7 @@ void xen_create_contiguous_region(unsigned long vstart, unsigned int order)
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 @@ void xen_destroy_contiguous_region(unsigned long vstart, unsigned int order)
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;
}
@@ -213,9 +213,7 @@ static void balloon_process(void *unused)
{
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. */
@@ -406,21 +406,15 @@ static void dispatch_probe(blkif_t *blkif, blkif_request_t *req)
#endif
if ( HYPERVISOR_update_va_mapping_otherdomain(
MMAP_VADDR(pending_idx, 0),
pfn_pte_ma(req->frame_and_sects[0] >> PAGE_SHIFT, PAGE_KERNEL),
#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 },
0, (blkif->is_blktap ? ID_TO_DOM(req->id) : blkif->domid) ) )
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;
0, blkif->domid) )
#endif
goto out;
#endif /* endif CONFIG_XEN_BLKDEV_GRANT */
rsp = vbd_probe(blkif, (vdisk_t *)MMAP_VADDR(pending_idx, 0),
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.