tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

patch: PMAP_CANFAIL corrections



Hi!

Attached patch corrects use of PMAP_CANFAIL to not be or'd
with protection. Pass protection to the protection parameter
of pmap_enter instead.

Any comments?

Christoph

diff -r f0002006fa5e sys/arch/xen/xen/privcmd.c
--- a/sys/arch/xen/xen/privcmd.c        Thu May 13 17:30:37 2010 +0200
+++ b/sys/arch/xen/xen/privcmd.c        Thu May 13 19:51:45 2010 +0200
@@ -507,8 +507,7 @@ privpgop_fault(struct uvm_faultinfo *ufi
                }
                error = pmap_enter_ma(ufi->orig_map->pmap, vaddr,
                    pobj->maddr[maddr_i], 0, ufi->entry->protection,
-                   PMAP_CANFAIL | ufi->entry->protection,
-                   pobj->domid);
+                   PMAP_CANFAIL, pobj->domid);
                if (error == ENOMEM) {
                        uvmfault_unlockall(ufi, ufi->entry->aref.ar_amap,
                            uobj, NULL);
diff -r f0002006fa5e sys/uvm/uvm_bio.c
--- a/sys/uvm/uvm_bio.c Thu May 13 17:30:37 2010 +0200
+++ b/sys/uvm/uvm_bio.c Thu May 13 19:51:45 2010 +0200
@@ -385,7 +385,7 @@ again:
                    pg->offset + PAGE_SIZE > umap->writeoff + umap->writelen);
                mask = rdonly ? ~VM_PROT_WRITE : VM_PROT_ALL;
                error = pmap_enter(ufi->orig_map->pmap, va, VM_PAGE_TO_PHYS(pg),
-                   prot & mask, PMAP_CANFAIL | (access_type & mask));
+                   (prot | access_type) & mask, PMAP_CANFAIL);
                mutex_enter(&uvm_pageqlock);
                uvm_pageactivate(pg);
                mutex_exit(&uvm_pageqlock);
diff -r f0002006fa5e sys/uvm/uvm_device.c
--- a/sys/uvm/uvm_device.c      Thu May 13 17:30:37 2010 +0200
+++ b/sys/uvm/uvm_device.c      Thu May 13 19:51:45 2010 +0200
@@ -427,7 +427,7 @@ udv_fault(struct uvm_faultinfo *ufi, vad
                    "  MAPPING: device: pm=0x%x, va=0x%x, pa=0x%lx, at=%d",
                    ufi->orig_map->pmap, curr_va, paddr, mapprot);
                if (pmap_enter(ufi->orig_map->pmap, curr_va, paddr,
-                   mapprot, PMAP_CANFAIL | mapprot) != 0) {
+                   mapprot, PMAP_CANFAIL) != 0) {
                        /*
                         * pmap_enter() didn't have the resource to
                         * enter this mapping.  Unlock everything,
diff -r f0002006fa5e sys/uvm/uvm_fault.c
--- a/sys/uvm/uvm_fault.c       Thu May 13 17:30:37 2010 +0200
+++ b/sys/uvm/uvm_fault.c       Thu May 13 19:51:45 2010 +0200
@@ -1465,7 +1465,7 @@ uvm_fault_upper_enter(
        UVMHIST_LOG(maphist, "  MAPPING: anon: pm=0x%x, va=0x%x, pg=0x%x, 
promote=%d",
            ufi->orig_map->pmap, ufi->orig_rvaddr, pg, flt->promote);
        if (pmap_enter(ufi->orig_map->pmap, ufi->orig_rvaddr, 
VM_PAGE_TO_PHYS(pg),
-           flt->enter_prot, flt->access_type | PMAP_CANFAIL | 
(flt->wire_mapping ? PMAP_WIRED : 0))
+           flt->enter_prot | flt->access_type, PMAP_CANFAIL | 
(flt->wire_mapping ? PMAP_WIRED : 0))
            != 0) {
 
                /*


Home | Main Index | Thread Index | Old Index