[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] Fix PAE and x86/64 when NX/XD is unavailable.
# HG changeset patch # User kaf24@xxxxxxxxxxxxxxxxxxxx # Node ID 0b5ee83ea35c98a511c794b11fa8c70ab8cc2274 # Parent 3889ca17ff5867d5efa19eaf25463d59dd6c8c7d Fix PAE and x86/64 when NX/XD is unavailable. Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx> diff -r 3889ca17ff58 -r 0b5ee83ea35c linux-2.6-xen-sparse/arch/xen/i386/mm/ioremap.c --- a/linux-2.6-xen-sparse/arch/xen/i386/mm/ioremap.c Tue Aug 23 12:30:35 2005 +++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/ioremap.c Tue Aug 23 13:13:39 2005 @@ -346,7 +346,7 @@ * Fill in the machine address: PTE ptr is done later by * __direct_remap_area_pages(). */ - v->val = (machine_addr & PAGE_MASK) | pgprot_val(prot); + v->val = pte_val_ma(pfn_pte_ma(machine_addr >> PAGE_SHIFT, prot)); machine_addr += PAGE_SIZE; address += PAGE_SIZE; diff -r 3889ca17ff58 -r 0b5ee83ea35c linux-2.6-xen-sparse/arch/xen/x86_64/mm/ioremap.c --- a/linux-2.6-xen-sparse/arch/xen/x86_64/mm/ioremap.c Tue Aug 23 12:30:35 2005 +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/mm/ioremap.c Tue Aug 23 13:13:39 2005 @@ -50,7 +50,6 @@ #else -#if defined(__i386__) /* * Does @address reside within a non-highmem page that is local to this virtual * machine (i.e., not an I/O page, nor a memory page belonging to another VM). @@ -64,14 +63,7 @@ unsigned long pfn = mfn_to_pfn(mfn); return ((pfn < max_low_pfn) && (phys_to_machine_mapping[pfn] == mfn)); } -#elif defined(__x86_64__) -/* - * - */ -static inline int is_local_lowmem(unsigned long address) -{ - return 0; -} + #endif /* @@ -142,9 +134,7 @@ if (direct_remap_area_pages(&init_mm, (unsigned long) addr, phys_addr, size, __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED -#if defined(__x86_64__) | _PAGE_USER -#endif | flags), domid)) { vunmap((void __force *) addr); return NULL; @@ -441,7 +431,7 @@ * Fill in the machine address: PTE ptr is done later by * __direct_remap_area_pages(). */ - v->val = (machine_addr & PAGE_MASK) | pgprot_val(prot); + v->val = pte_val_ma(pfn_pte_ma(machine_addr >> PAGE_SHIFT, prot)); machine_addr += PAGE_SIZE; address += PAGE_SIZE; diff -r 3889ca17ff58 -r 0b5ee83ea35c linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c --- a/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c Tue Aug 23 12:30:35 2005 +++ b/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c Tue Aug 23 13:13:39 2005 @@ -167,7 +167,7 @@ if (ret) goto batch_err; - u.val = (mfn << PAGE_SHIFT) | pgprot_val(vma->vm_page_prot); + u.val = pte_val_ma(pfn_pte_ma(mfn, vma->vm_page_prot)); u.ptr = ptep; if ( unlikely(HYPERVISOR_mmu_update(&u, 1, NULL, m.dom) < 0) ) diff -r 3889ca17ff58 -r 0b5ee83ea35c xen/arch/x86/mm.c --- a/xen/arch/x86/mm.c Tue Aug 23 12:30:35 2005 +++ b/xen/arch/x86/mm.c Tue Aug 23 13:13:39 2005 @@ -444,7 +444,7 @@ if ( unlikely(l1e_get_flags(l1e) & L1_DISALLOW_MASK) ) { - MEM_LOG("Bad L1 flags %x\n", l1e_get_flags(l1e) & L1_DISALLOW_MASK); + MEM_LOG("Bad L1 flags %x", l1e_get_flags(l1e) & L1_DISALLOW_MASK); return 0; } @@ -490,7 +490,7 @@ if ( unlikely((l2e_get_flags(l2e) & L2_DISALLOW_MASK)) ) { - MEM_LOG("Bad L2 flags %x\n", l2e_get_flags(l2e) & L2_DISALLOW_MASK); + MEM_LOG("Bad L2 flags %x", l2e_get_flags(l2e) & L2_DISALLOW_MASK); return 0; } @@ -523,7 +523,7 @@ if ( unlikely((l3e_get_flags(l3e) & L3_DISALLOW_MASK)) ) { - MEM_LOG("Bad L3 flags %x\n", l3e_get_flags(l3e) & L3_DISALLOW_MASK); + MEM_LOG("Bad L3 flags %x", l3e_get_flags(l3e) & L3_DISALLOW_MASK); return 0; } @@ -557,7 +557,7 @@ if ( unlikely((l4e_get_flags(l4e) & L4_DISALLOW_MASK)) ) { - MEM_LOG("Bad L4 flags %x\n", l4e_get_flags(l4e) & L4_DISALLOW_MASK); + MEM_LOG("Bad L4 flags %x", l4e_get_flags(l4e) & L4_DISALLOW_MASK); return 0; } @@ -1025,7 +1025,7 @@ unlikely(o != l1e_get_intpte(ol1e)) ) { MEM_LOG("Failed to update %" PRIpte " -> %" PRIpte - ": saw %" PRIpte "\n", + ": saw %" PRIpte, l1e_get_intpte(ol1e), l1e_get_intpte(nl1e), o); @@ -1051,7 +1051,7 @@ { if ( unlikely(l1e_get_flags(nl1e) & L1_DISALLOW_MASK) ) { - MEM_LOG("Bad L1 flags %x\n", + MEM_LOG("Bad L1 flags %x", l1e_get_flags(nl1e) & L1_DISALLOW_MASK); return 0; } @@ -1113,7 +1113,7 @@ { if ( unlikely(l2e_get_flags(nl2e) & L2_DISALLOW_MASK) ) { - MEM_LOG("Bad L2 flags %x\n", + MEM_LOG("Bad L2 flags %x", l2e_get_flags(nl2e) & L2_DISALLOW_MASK); return 0; } @@ -1175,7 +1175,7 @@ { if ( unlikely(l3e_get_flags(nl3e) & L3_DISALLOW_MASK) ) { - MEM_LOG("Bad L3 flags %x\n", + MEM_LOG("Bad L3 flags %x", l3e_get_flags(nl3e) & L3_DISALLOW_MASK); return 0; } @@ -1237,7 +1237,7 @@ { if ( unlikely(l4e_get_flags(nl4e) & L4_DISALLOW_MASK) ) { - MEM_LOG("Bad L4 flags %x\n", + MEM_LOG("Bad L4 flags %x", l4e_get_flags(nl4e) & L4_DISALLOW_MASK); return 0; } @@ -1598,7 +1598,7 @@ percpu_info[cpu].foreign = dom_io; break; default: - MEM_LOG("Dom %u cannot set foreign dom\n", d->domain_id); + MEM_LOG("Dom %u cannot set foreign dom", d->domain_id); okay = 0; break; } @@ -1831,7 +1831,7 @@ case MMUEXT_FLUSH_CACHE: if ( unlikely(!IS_CAPABLE_PHYSDEV(d)) ) { - MEM_LOG("Non-physdev domain tried to FLUSH_CACHE.\n"); + MEM_LOG("Non-physdev domain tried to FLUSH_CACHE."); okay = 0; } else @@ -1845,7 +1845,7 @@ if ( shadow_mode_external(d) ) { MEM_LOG("ignoring SET_LDT hypercall from external " - "domain %u\n", d->domain_id); + "domain %u", d->domain_id); okay = 0; break; } @@ -1916,7 +1916,7 @@ unlikely(IS_XEN_HEAP_FRAME(page)) ) { MEM_LOG("Transferee has no reservation headroom (%d,%d), or " - "page is in Xen heap (%lx), or dom is dying (%ld).\n", + "page is in Xen heap (%lx), or dom is dying (%ld).", e->tot_pages, e->max_pages, op.mfn, e->domain_flags); okay = 0; goto reassign_fail; @@ -1937,7 +1937,7 @@ unlikely(_nd != _d) ) { MEM_LOG("Bad page values %lx: ed=%p(%u), sd=%p," - " caf=%08x, taf=%" PRtype_info "\n", + " caf=%08x, taf=%" PRtype_info, page_to_pfn(page), d, d->domain_id, unpickle_domptr(_nd), x, page->u.inuse.type_info); okay = 0; @@ -2301,7 +2301,7 @@ if ( ((type_info & PGT_type_mask) != PGT_l1_page_table) || !get_page_type(page, type_info & (PGT_type_mask|PGT_va_mask)) ) { - DPRINTK("Grant map attempted to update a non-L1 page\n"); + MEM_LOG("Grant map attempted to update a non-L1 page"); rc = GNTST_general_error; goto failed; } @@ -2363,7 +2363,7 @@ if ( ((type_info & PGT_type_mask) != PGT_l1_page_table) || !get_page_type(page, type_info & (PGT_type_mask|PGT_va_mask)) ) { - DPRINTK("Grant map attempted to update a non-L1 page\n"); + MEM_LOG("Grant map attempted to update a non-L1 page"); rc = GNTST_general_error; goto failed; } @@ -2378,7 +2378,7 @@ /* Check that the virtual address supplied is actually mapped to frame. */ if ( unlikely((l1e_get_intpte(ol1e) >> PAGE_SHIFT) != frame) ) { - DPRINTK("PTE entry %lx for address %lx doesn't match frame %lx\n", + MEM_LOG("PTE entry %lx for address %lx doesn't match frame %lx", (unsigned long)l1e_get_intpte(ol1e), addr, frame); put_page_type(page); rc = GNTST_general_error; @@ -2388,7 +2388,7 @@ /* Delete pagetable entry. */ if ( unlikely(__put_user(0, (intpte_t *)va))) { - DPRINTK("Cannot delete PTE entry at %p.\n", va); + MEM_LOG("Cannot delete PTE entry at %p", va); put_page_type(page); rc = GNTST_general_error; goto failed; @@ -2452,7 +2452,7 @@ if ( unlikely(__get_user(ol1e.l1, &pl1e->l1) != 0) ) { - DPRINTK("Could not find PTE entry for address %lx\n", addr); + MEM_LOG("Could not find PTE entry for address %lx", addr); return GNTST_general_error; } @@ -2462,7 +2462,7 @@ */ if ( unlikely(l1e_get_pfn(ol1e) != frame) ) { - DPRINTK("PTE entry %lx for address %lx doesn't match frame %lx\n", + MEM_LOG("PTE entry %lx for address %lx doesn't match frame %lx", l1e_get_pfn(ol1e), addr, frame); return GNTST_general_error; } @@ -2470,7 +2470,7 @@ /* Delete pagetable entry. */ if ( unlikely(__put_user(0, &pl1e->l1)) ) { - DPRINTK("Cannot delete PTE entry at %p.\n", (unsigned long *)pl1e); + MEM_LOG("Cannot delete PTE entry at %p", (unsigned long *)pl1e); return GNTST_general_error; } @@ -2930,7 +2930,7 @@ if ( unlikely(!get_page_from_l1e(nl1e, d)) ) { - MEM_LOG("ptwr: Could not re-validate l1 page\n"); + MEM_LOG("ptwr: Could not re-validate l1 page"); /* * Make the remaining p.t's consistent before crashing, so the * reference counts are correct. @@ -3056,7 +3056,7 @@ /* Aligned access only, thank you. */ if ( !access_ok(addr, bytes) || ((addr & (bytes-1)) != 0) ) { - MEM_LOG("ptwr_emulate: Unaligned or bad size ptwr access (%d, %lx)\n", + MEM_LOG("ptwr_emulate: Unaligned or bad size ptwr access (%d, %lx)", bytes, addr); return X86EMUL_UNHANDLEABLE; } @@ -3089,7 +3089,7 @@ if (__copy_from_user(&pte, &linear_pg_table[l1_linear_offset(addr)], sizeof(pte))) { - MEM_LOG("ptwr_emulate: Cannot read thru linear_pg_table\n"); + MEM_LOG("ptwr_emulate: Cannot read thru linear_pg_table"); return X86EMUL_UNHANDLEABLE; } @@ -3102,7 +3102,7 @@ (page_get_owner(page) != d) ) { MEM_LOG("ptwr_emulate: Page is mistyped or bad pte " - "(%lx, %" PRtype_info ")\n", + "(%lx, %" PRtype_info ")", l1e_get_pfn(pte), page->u.inuse.type_info); return X86EMUL_UNHANDLEABLE; } _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |