From 902d55a556174105b4c164c1e82e3a41ca1daf2c Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Fri, 1 Feb 2008 11:34:02 +0000 Subject: [PATCH] linux/x86: make xen_change_pte_range() compatible with CONFIG_HIGHPTE Cannot use virt_to_machine() on a kmap()-ed address. Signed-off-by: Jan Beulich --- arch/i386/mm/hypervisor.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/i386/mm/hypervisor.c b/arch/i386/mm/hypervisor.c index a19e1155..4d2e164b 100644 --- a/arch/i386/mm/hypervisor.c +++ b/arch/i386/mm/hypervisor.c @@ -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( -- 2.39.5