From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: Re: [PATCH] x86/HVM: refine SMEP/SMAP tests in HVM_CR4_GUEST_RESERVED_BITS() Date: Thu, 5 Jun 2014 14:07:53 +0100 Message-ID: <53906BA9.4040106@citrix.com> References: <538F3F2A.7050202@citrix.com> <538F5EA00200007800017E64@mail.emea.novell.com> <538F449B.10807@citrix.com> <5390778B02000078000182FA@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5390778B02000078000182FA@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: Jan Beulich , Andrew Cooper , Xen-devel List Cc: Feng Wu , Keir Fraser List-Id: xen-devel@lists.xenproject.org On 05/06/14 12:58, Jan Beulich wrote: > Andrew validly points out that the use of the macro on the restore path > can't rely on the CPUID bits for the guest already being in place (as > their setting by the tool stack in turn requires the other restore > operations already having taken place). And even worse, using > hvm_cpuid() is invalid here because that function assumes to be used in > the context of the vCPU in question. > > Reverting to the behavior prior to the change from checking > cpu_has_sm?p to hvm_vcpu_has_sm?p() would break the other (non-restore) > use of the macro. So let's revert to the prior behavior only for the > restore path, by adding a respective second parameter to the macro. > > Obviously the two cpu_has_* uses in the macro should really also be > converted to hvm_cpuid() based checks at least for the non-restore > path. FWIW, Tested-by: David Vrabel But on 4.4.x not unstable. David