Skip to contentSkip to conversation

x86/svm: invert valid condition in svm_get_pending_event()

PATCH In review Jinoh Kang 2 participants 2 messages Aug 18, 2023

lore
Share & tools
lore

Jinoh Kang

author
#0 lore raw

PATCH 1/1 x86/svm: invert valid condition in svm_get_pending_event()

Fixes 9864841914c2 ("x86/vm_event: add support for VM_EVENT_REASON_INTERRUPT")
---
 xen/arch/x86/hvm/svm/svm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/x86/hvm/svm/svm.c +1 -1
index 01dd592d9b83..beb076ea8d62 100644
@@ -2415,7 +2415,7 @@ static bool cf_check svm_get_pending_event(
 {
     const struct vmcb_struct *vmcb = v->arch.hvm.svm.vmcb;
 
-    if ( vmcb->event_inj.v )
+    if ( !vmcb->event_inj.v )
         return false;
 
     info->vector = vmcb->event_inj.vector;
Signature · 1 line
2.41.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 2 lines · Jinoh Kang
Fixes 9864841914c2 ("x86/vm_event: add support for VM_EVENT_REASON_INTERRUPT")

Yeah, that's just straight up broken.  I'm not aware of anyone having used this in anger on AMD systems yet.

I've tweaked the commit message a little bit on commit, to make it clearer what you're doing.  (You're not making the valid condition invalid, which is one interpretation of "invert" in that context).