From: "Jan Beulich" Subject: [PATCH] linux/x86: make xen_change_pte_range() compatible with CONFIG_HIGHPTE Date: Fri, 01 Feb 2008 08:43:29 +0000 Message-ID: <47A2E9C1.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Cannot use virt_to_machine() on a kmap()-ed address. As usual, written and tested on 2.6.24 and made apply to the 2.6.18 tree without further testing. Signed-off-by: Jan Beulich Index: head-2008-01-28/arch/i386/mm/hypervisor.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- head-2008-01-28.orig/arch/i386/mm/hypervisor.c 2007-10-19 = 17:18:37.000000000 +0200 +++ head-2008-01-28/arch/i386/mm/hypervisor.c 2008-01-31 17:38:56.0000000= 00 +0100 @@ -569,7 +569,9 @@ int xen_change_pte_range(struct mm_struc pte =3D pte_offset_map_lock(mm, pmd, addr, &ptl); do { if (pte_present(*pte)) { - u[i].ptr =3D virt_to_machine(pte) | MMU_PT_UPDATE_P= RESERVE_AD; + u[i].ptr =3D (__pmd_val(*pmd) & PHYSICAL_PAGE_MASK)= + | ((unsigned long)pte & ~PAGE_MASK) + | MMU_PT_UPDATE_PRESERVE_AD; u[i].val =3D __pte_val(pte_modify(*pte, newprot)); if (++i =3D=3D MAX_BATCHED_FULL_PTES) { if ((rc =3D HYPERVISOR_mmu_update(