From: "Jan Beulich" Subject: [PATCH 3/3] x86/mm: use is_..._vcpu() instead of open coding it Date: Tue, 23 Jun 2015 16:20:30 +0100 Message-ID: <5589955E02000078000886E3@mail.emea.novell.com> References: <558993E902000078000886B3@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__PartE3D7322E.2__=" Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Z7Q01-00038b-Pp for xen-devel@lists.xenproject.org; Tue, 23 Jun 2015 15:20:33 +0000 In-Reply-To: <558993E902000078000886B3@mail.emea.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: George Dunlap , Andrew Cooper , Keir Fraser , 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. --=__PartE3D7322E.2__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Signed-off-by: Jan Beulich --- a/xen/arch/x86/mm/p2m.c +++ b/xen/arch/x86/mm/p2m.c @@ -1851,9 +1851,7 @@ unsigned long paging_gva_to_gfn(struct v struct p2m_domain *hostp2m =3D p2m_get_hostp2m(v->domain); const struct paging_mode *hostmode =3D paging_get_hostmode(v); =20 - if ( is_hvm_domain(v->domain) - && paging_mode_hap(v->domain)=20 - && nestedhvm_is_n2(v) ) + if ( is_hvm_vcpu(v) && paging_mode_hap(v->domain) && nestedhvm_is_n2(v= ) ) { unsigned long gfn; struct p2m_domain *p2m; --- a/xen/arch/x86/mm/shadow/common.c +++ b/xen/arch/x86/mm/shadow/common.c @@ -971,7 +971,7 @@ int sh_unsync(struct vcpu *v, mfn_t gmfn if ( pg->shadow_flags & ((SHF_page_type_mask & ~SHF_L1_ANY) | SHF_out_of_sync) || sh_page_has_multiple_shadows(pg) - || is_pv_domain(v->domain) + || is_pv_vcpu(v) || !v->domain->arch.paging.shadow.oos_active ) return 0; =20 --- a/xen/arch/x86/mm/shadow/none.c +++ b/xen/arch/x86/mm/shadow/none.c @@ -73,6 +73,6 @@ static const struct paging_mode sh_pagin =20 void shadow_vcpu_init(struct vcpu *v) { - ASSERT(is_pv_domain(v->domain)); + ASSERT(is_pv_vcpu(v)); v->arch.paging.mode =3D &sh_paging_none; } --=__PartE3D7322E.2__= Content-Type: text/plain; name="x86-use-is_xyz_vcpu.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-use-is_xyz_vcpu.patch" x86/mm: use is_..._vcpu() instead of open coding it=0A=0ASigned-off-by: = Jan Beulich =0A=0A--- a/xen/arch/x86/mm/p2m.c=0A+++ = b/xen/arch/x86/mm/p2m.c=0A@@ -1851,9 +1851,7 @@ unsigned long paging_gva_to= _gfn(struct v=0A struct p2m_domain *hostp2m =3D p2m_get_hostp2m(v->doma= in);=0A const struct paging_mode *hostmode =3D paging_get_hostmode(v);= =0A =0A- if ( is_hvm_domain(v->domain)=0A- && paging_mode_hap(v->= domain) =0A- && nestedhvm_is_n2(v) )=0A+ if ( is_hvm_vcpu(v) && = paging_mode_hap(v->domain) && nestedhvm_is_n2(v) )=0A {=0A = unsigned long gfn;=0A struct p2m_domain *p2m;=0A--- a/xen/arch/x86/= mm/shadow/common.c=0A+++ b/xen/arch/x86/mm/shadow/common.c=0A@@ -971,7 = +971,7 @@ int sh_unsync(struct vcpu *v, mfn_t gmfn=0A if ( pg->shadow_f= lags &=0A ((SHF_page_type_mask & ~SHF_L1_ANY) | SHF_out_of_sync)= =0A || sh_page_has_multiple_shadows(pg)=0A- || is_pv_domai= n(v->domain)=0A+ || is_pv_vcpu(v)=0A || !v->domain->arch.p= aging.shadow.oos_active )=0A return 0;=0A =0A--- a/xen/arch/x86/mm/= shadow/none.c=0A+++ b/xen/arch/x86/mm/shadow/none.c=0A@@ -73,6 +73,6 @@ = static const struct paging_mode sh_pagin=0A =0A void shadow_vcpu_init(struc= t vcpu *v)=0A {=0A- ASSERT(is_pv_domain(v->domain));=0A+ ASSERT(is_pv= _vcpu(v));=0A v->arch.paging.mode =3D &sh_paging_none;=0A }=0A --=__PartE3D7322E.2__= 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 --=__PartE3D7322E.2__=--