From: "Jan Beulich" Subject: [PATCH 2/3] x86/shadow: adjust mask shadow_audit_tables() passes to hash_foreach() Date: Thu, 29 Jan 2015 13:17:18 +0000 Message-ID: <54CA40EE020000780005ADFE@mail.emea.novell.com> References: <54CA3F19020000780005ADDC@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part0A3F99CE.0__=" Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YGoyH-00006I-I6 for xen-devel@lists.xenproject.org; Thu, 29 Jan 2015 13:17:21 +0000 In-Reply-To: <54CA3F19020000780005ADDC@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: 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. --=__Part0A3F99CE.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline It so far having been ~1 made most of the code preceding the call pointless, but I assume this wasn't meant to be that way. Also replace the remaining hard coded ~1 with an expression documenting the intention a little better. Signed-off-by: Jan Beulich --- Couldn't the ~1 instead be SHF_page_type_mask? --- a/xen/arch/x86/mm/shadow/common.c +++ b/xen/arch/x86/mm/shadow/common.c @@ -3761,7 +3761,7 @@ void shadow_audit_tables(struct vcpu *v) #endif =20 if ( SHADOW_AUDIT & SHADOW_AUDIT_ENTRIES_FULL ) - mask =3D ~1; /* Audit every table in the system */ + mask =3D ~(1 << SH_type_none); /* Audit every table in the system = */ else=20 { /* Audit only the current mode's tables */ @@ -3776,7 +3776,7 @@ void shadow_audit_tables(struct vcpu *v) } } =20 - hash_foreach(v, ~1, callbacks, _mfn(INVALID_MFN)); + hash_foreach(v, mask, callbacks, _mfn(INVALID_MFN)); } =20 #endif /* Shadow audit */ --=__Part0A3F99CE.0__= Content-Type: text/plain; name="x86-shadow-audit-mask.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-shadow-audit-mask.patch" x86/shadow: adjust mask shadow_audit_tables() passes to hash_foreach()=0A= =0AIt so far having been ~1 made most of the code preceding the call=0Apoin= tless, but I assume this wasn't meant to be that way. Also replace=0Athe = remaining hard coded ~1 with an expression documenting the=0Aintention a = little better.=0A=0ASigned-off-by: Jan Beulich =0A---=0A= Couldn't the ~1 instead be SHF_page_type_mask?=0A=0A--- a/xen/arch/x86/mm/s= hadow/common.c=0A+++ b/xen/arch/x86/mm/shadow/common.c=0A@@ -3761,7 = +3761,7 @@ void shadow_audit_tables(struct vcpu *v)=0A #endif=0A =0A = if ( SHADOW_AUDIT & SHADOW_AUDIT_ENTRIES_FULL )=0A- mask =3D ~1; /* = Audit every table in the system */=0A+ mask =3D ~(1 << SH_type_none)= ; /* Audit every table in the system */=0A else =0A {=0A = /* Audit only the current mode's tables */=0A@@ -3776,7 +3776,7 @@ void = shadow_audit_tables(struct vcpu *v)=0A }=0A }=0A =0A- = hash_foreach(v, ~1, callbacks, _mfn(INVALID_MFN));=0A+ hash_foreach(v, = mask, callbacks, _mfn(INVALID_MFN));=0A }=0A =0A #endif /* Shadow audit = */=0A --=__Part0A3F99CE.0__= 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 --=__Part0A3F99CE.0__=--