]> xenbits.xensource.com Git - legacy/linux-2.6.18-xen.git/commitdiff
linux/x86: make xen_change_pte_range() compatible with CONFIG_HIGHPTE
authorKeir Fraser <keir.fraser@citrix.com>
Fri, 1 Feb 2008 11:34:02 +0000 (11:34 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Fri, 1 Feb 2008 11:34:02 +0000 (11:34 +0000)
Cannot use virt_to_machine() on a kmap()-ed address.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
arch/i386/mm/hypervisor.c

index a19e1155d4b1b3575edb4f79d6b29646dda7d4d2..4d2e164b97899ca182c3d483f019056872af566b 100644 (file)
@@ -566,7 +566,9 @@ int xen_change_pte_range(struct mm_struct *mm, pmd_t *pmd,
        pte = pte_offset_map_lock(mm, pmd, addr, &ptl);
        do {
                if (pte_present(*pte)) {
-                       u[i].ptr = virt_to_machine(pte) | MMU_PT_UPDATE_PRESERVE_AD;
+                       u[i].ptr = (__pmd_val(*pmd) & PHYSICAL_PAGE_MASK)
+                                  | ((unsigned long)pte & ~PAGE_MASK)
+                                  | MMU_PT_UPDATE_PRESERVE_AD;
                        u[i].val = __pte_val(pte_modify(*pte, newprot));
                        if (++i == MAX_BATCHED_FULL_PTES) {
                                if ((rc = HYPERVISOR_mmu_update(