xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hvm/vpmu: Prevent core2_vpmu_dump() handler from incorrectly mutating state
@ 2013-09-11 16:58 Andrew Cooper
  2013-09-12  7:45 ` [PATCH v2] hvm/vpmu: Prevent dump handlers " Jan Beulich
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Cooper @ 2013-09-11 16:58 UTC (permalink / raw)
  To: Xen-devel
  Cc: Andrew Cooper, Eddie Dong, Keir Fraser, Jun Nakajima, Jan Beulich

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 <andrew.cooper3@citrix.com>
CC: Keir Fraser <keir@xen.org>
CC: Jan Beulich <jbeulich@suse.com>
CC: Jun Nakajima <jun.nakajima@intel.com>
CC: Eddie Dong <eddie.dong@intel.com>
---
 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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-09-12 23:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-11 16:58 [PATCH] hvm/vpmu: Prevent core2_vpmu_dump() handler from incorrectly mutating state Andrew Cooper
2013-09-12  7:45 ` [PATCH v2] hvm/vpmu: Prevent dump handlers " Jan Beulich
2013-09-12  9:38   ` Andrew Cooper
2013-09-12 23:28   ` Suravee Suthikulanit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).