From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: [PATCH] hvm/vpmu: Prevent core2_vpmu_dump() handler from incorrectly mutating state Date: Wed, 11 Sep 2013 17:58:31 +0100 Message-ID: <1378918711-21543-1-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: 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: Andrew Cooper , Eddie Dong , Keir Fraser , Jun Nakajima , Jan Beulich List-Id: xen-devel@lists.xenproject.org Discovered by Coverity, CID 1055181 The keyhandler was incorrectly setting VPMU_CONTEXT_LOADED when it was intending to check for it. Signed-off-by: Andrew Cooper CC: Keir Fraser CC: Jan Beulich CC: Jun Nakajima CC: Eddie Dong --- xen/arch/x86/hvm/vmx/vpmu_core2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/hvm/vmx/vpmu_core2.c b/xen/arch/x86/hvm/vmx/vpmu_core2.c index 8c556c7..c8095d7 100644 --- a/xen/arch/x86/hvm/vmx/vpmu_core2.c +++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c @@ -690,7 +690,7 @@ static void core2_vpmu_dump(struct vcpu *v) if ( !vpmu_is_set(vpmu, VPMU_RUNNING) ) { - if ( vpmu_set(vpmu, VPMU_CONTEXT_LOADED) ) + if ( vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED) ) printk(" vPMU loaded\n"); else printk(" vPMU allocated\n"); -- 1.7.10.4