From: "Jan Beulich" Subject: [PATCH 1/4] x86/EPT: consider page order when checking for APIC MFN Date: Wed, 23 Apr 2014 09:39:50 +0100 Message-ID: <53579876020000780000B2E2@nat28.tlf.novell.com> References: <53579447020000780000B2A9@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part56645F46.1__=" Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Wcsig-0003oq-L6 for xen-devel@lists.xenproject.org; Wed, 23 Apr 2014 08:39:54 +0000 In-Reply-To: <53579447020000780000B2A9@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel Cc: Keir Fraser , Kevin Tian , Eddie Dong , Jun Nakajima , Tim Deegan List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part56645F46.1__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline This was overlooked in 3d90d6e6 ("x86/EPT: split super pages upon mismatching memory types"). Signed-off-by: Jan Beulich --- a/xen/arch/x86/hvm/mtrr.c +++ b/xen/arch/x86/hvm/mtrr.c @@ -816,15 +816,18 @@ int epte_get_entry_emt(struct domain *d, !has_arch_pdevs(d)) ) { ASSERT(!direct_mmio || - mfn_x(mfn) =3D=3D d->arch.hvm_domain.vmx.apic_access_mfn); + !((mfn_x(mfn) ^ d->arch.hvm_domain.vmx.apic_access_mfn) >> + order)); *ipat =3D 1; return MTRR_TYPE_WRBACK; } =20 if ( direct_mmio ) { - if ( mfn_x(mfn) !=3D d->arch.hvm_domain.vmx.apic_access_mfn ) + if ( (mfn_x(mfn) ^ d->arch.hvm_domain.vmx.apic_access_mfn) >> = order ) return MTRR_TYPE_UNCACHABLE; + if ( order ) + return -1; *ipat =3D 1; return MTRR_TYPE_WRBACK; } --=__Part56645F46.1__= Content-Type: text/plain; name="EPT-APIC-access-MFN-order.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="EPT-APIC-access-MFN-order.patch" x86/EPT: consider page order when checking for APIC MFN=0A=0AThis was = overlooked in 3d90d6e6 ("x86/EPT: split super pages upon=0Amismatching = memory types").=0A=0ASigned-off-by: Jan Beulich =0A=0A--= - a/xen/arch/x86/hvm/mtrr.c=0A+++ b/xen/arch/x86/hvm/mtrr.c=0A@@ -816,15 = +816,18 @@ int epte_get_entry_emt(struct domain *d,=0A !has_arch_= pdevs(d)) )=0A {=0A ASSERT(!direct_mmio ||=0A- = mfn_x(mfn) =3D=3D d->arch.hvm_domain.vmx.apic_access_mfn);=0A+ = !((mfn_x(mfn) ^ d->arch.hvm_domain.vmx.apic_access_mfn) >>=0A+ = order));=0A *ipat =3D 1;=0A return MTRR_TYPE_WRBACK;= =0A }=0A =0A if ( direct_mmio )=0A {=0A- if ( mfn_x(mfn)= !=3D d->arch.hvm_domain.vmx.apic_access_mfn )=0A+ if ( (mfn_x(mfn) = ^ d->arch.hvm_domain.vmx.apic_access_mfn) >> order )=0A return = MTRR_TYPE_UNCACHABLE;=0A+ if ( order )=0A+ return -1;=0A = *ipat =3D 1;=0A return MTRR_TYPE_WRBACK;=0A }=0A --=__Part56645F46.1__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --=__Part56645F46.1__=--