diff mbox series

[v2,1/3] x86/vmx: Collect all emtpy VMExit cases together

Message ID 20240111231323.4043461-2-andrew.cooper3@citrix.com (mailing list archive)
State New, archived
Headers show
Series x86/vmx: Multiple fixes | expand

Commit Message

Andrew Cooper Jan. 11, 2024, 11:13 p.m. UTC
... rather than having them spread out.  Explain consicely why each is empty.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Wei Liu <wl@xen.org>
CC: George Dunlap <george.dunlap@citrix.com>

v2:
 * New.
---
 xen/arch/x86/hvm/vmx/vmx.c | 21 ++++++---------------
 1 file changed, 6 insertions(+), 15 deletions(-)

Comments

Jan Beulich Jan. 12, 2024, 10:32 a.m. UTC | #1
On 12.01.2024 00:13, Andrew Cooper wrote:
> ... rather than having them spread out.  Explain consicely why each is empty.
> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>
diff mbox series

Patch

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 8ff675883c2b..829c27f1fa33 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -4374,9 +4374,7 @@  void asmlinkage vmx_vmexit_handler(struct cpu_user_regs *regs)
         }
         break;
     }
-    case EXIT_REASON_EXTERNAL_INTERRUPT:
-        /* Already handled above. */
-        break;
+
     case EXIT_REASON_TRIPLE_FAULT:
         hvm_triple_fault();
         break;
@@ -4539,9 +4537,6 @@  void asmlinkage vmx_vmexit_handler(struct cpu_user_regs *regs)
         hvm_inject_hw_exception(X86_EXC_UD, X86_EVENT_NO_EC);
         break;
 
-    case EXIT_REASON_TPR_BELOW_THRESHOLD:
-        break;
-
     case EXIT_REASON_APIC_ACCESS:
         if ( !vmx_handle_eoi_write() && !handle_mmio() )
             hvm_inject_hw_exception(X86_EXC_GP, 0);
@@ -4680,15 +4675,6 @@  void asmlinkage vmx_vmexit_handler(struct cpu_user_regs *regs)
         vmx_handle_descriptor_access(exit_reason);
         break;
 
-    case EXIT_REASON_BUS_LOCK:
-        /*
-         * Nothing to do: just taking a vmexit should be enough of a pause to
-         * prevent a VM from crippling the host with bus locks.  Note
-         * EXIT_REASON_BUS_LOCK will always have bit 26 set in exit_reason, and
-         * hence the perf counter is already increased.
-         */
-        break;
-
     case EXIT_REASON_NOTIFY:
         __vmread(EXIT_QUALIFICATION, &exit_qualification);
 
@@ -4705,6 +4691,11 @@  void asmlinkage vmx_vmexit_handler(struct cpu_user_regs *regs)
 
         break;
 
+    case EXIT_REASON_EXTERNAL_INTERRUPT:  /* Handled earlier */
+    case EXIT_REASON_TPR_BELOW_THRESHOLD: /* Handled later in vmx_intr_assist() */
+    case EXIT_REASON_BUS_LOCK:            /* Nothing to do (rate-limit only) */
+        break;
+
     case EXIT_REASON_VMX_PREEMPTION_TIMER_EXPIRED:
     case EXIT_REASON_INVPCID:
     /* fall through */