From: Tim Deegan Subject: Re: [PATCH v2 1/4] x86/EPT: force re-evaluation of memory type as necessary Date: Thu, 3 Apr 2014 12:18:47 +0200 Message-ID: <20140403101847.GF38209@deinos.phlegethon.org> References: <533583C5020000780000367B@nat28.tlf.novell.com> <53358464020000780000368B@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WVejU-00044A-5e for xen-devel@lists.xenproject.org; Thu, 03 Apr 2014 10:18:52 +0000 Content-Disposition: inline In-Reply-To: <53358464020000780000368B@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: Jan Beulich Cc: xen-devel , Kevin Tian , Keir Fraser , Eddie Dong , Jun Nakajima List-Id: xen-devel@lists.xenproject.org Hi, This version looks correct to me, but this tristate: At 13:17 +0000 on 28 Mar (1396009028), Jan Beulich wrote: > + p2m_lock(p2m); > + > + okay = -curr->arch.hvm_vmx.ept_spurious_misconfig; [...] > + if ( okay > 0 ) > + { > + struct vcpu *v; > + > + for_each_vcpu ( curr->domain, v ) > + v->arch.hvm_vmx.ept_spurious_misconfig = 1; > + } > + curr->arch.hvm_vmx.ept_spurious_misconfig = 0; > + ept_sync_domain(p2m); > + p2m_unlock(p2m); > + > + return !!okay; seems a bit baroque. Can we go for 'bool_t okay = 0' at the top and then if ( okay ) { struct vcpu *v; for_each_vcpu ( curr->domain, v ) v->arch.hvm_vmx.ept_spurious_misconfig = 1; } else okay = curr->arch.hvm_vmx.ept_spurious_misconfig; curr->arch.hvm_vmx.ept_spurious_misconfig = 0; ept_sync_domain(p2m); p2m_unlock(p2m); return okay; instead? With that change, Reviewed-by: Tim Deegan Cheers, Tim.