[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • To: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Thu, 11 Jan 2024 23:13:21 +0000
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>
  • Delivery-date: Thu, 11 Jan 2024 23:13:37 +0000
  • Ironport-data: A9a23:hiCaa6M1vRya2FnvrR3ml8FynXyQoLVcMsEvi/4bfWQNrUoj3jIBx jQZUG2GM66KM2T9L9l+OY2/8EoBvJTcx4JhGwto+SlhQUwRpJueD7x1DKtS0wC6dZSfER09v 63yTvGacajYm1eF/k/F3oDJ9CQ6jefQAOOkVIYoAwgpLSd8UiAtlBl/rOAwh49skLCRDhiE/ Nj/uKUzAnf8s9JPGjxSs/7rRC9H5qyo5GtB5wVmPpingXeF/5UrJMNHTU2OByOQrrl8RoaSW +vFxbelyWLVlz9F5gSNy+uTnuUiG9Y+DCDW4pZkc/HKbitq/0Te5p0TJvsEAXq7vh3S9zxHJ HehgrTrIeshFvWkdO3wyHC0GQkmVUFN0OevzXRSLaV/ZqAJGpfh66wGMa04AWEX0vtmPW9+s tgWFAomNUyc1sym7uqqEMA506zPLOGzVG8eknRpzDWfBvc6W5HTBa7N4Le03h9p2JoIR6yHI ZNEOHwwNHwsYDUWUrsTILs4kP2lmT/UdDpApUjOjaE2/3LS3Ep6172F3N/9I4bbHpgMwRnCz o7A10fkIDJGBeSY9SKA92jytMzyvwClZY1HQdVU8dY12QbOlwT/EiY+RVa95PW0lEO6c9ZeM FAPvDojq7Ao806mRcW7WAe3yFamlBMBX9tbE8Uh9RqAjKHT5m6xGWwsXjNHLts8u6cLqScCj wHT2YmzXHo27ezTFir1GqqoQS2aJDkpI19FQSE4dyBev8ayjpEd1gOVZ4M2eEKqteEZCQ0c0 hjT83Bi3uRL05JWv5hX62wrlN5Fm3QocuLWzl+ONo5dxlklDLNJnqTxgbQh0d5OLZyCUn6Kt 2Uels6V4YgmVM7VyHXcGrVSRer4u55p1QEwZnY2QvEcG8mFoSb/Lei8HhkiTKuWDir0UWCwO xKC0e+gzJRSIGGrfcdKj3GZUqwXIVzbPY29DJj8N4MeCqWdgSfbpEmCk2bMhTGy+KXt+IljU aqmnTGEVC1KUfU+nWDsF4/wE9YDn0gD+I8afrijpzzP7FZUTCf9pWstWLdWUt0E0Q==
  • Ironport-hdrordr: A9a23:SOIL+6yNIcKRI8tNSK7GKrPwFL1zdoMgy1knxilNoRw8SKKlfq eV7Y0mPH7P+VAssR4b+exoVJPtfZqYz+8R3WBzB8bEYOCFghrKEGgK1+KLqFeMJ8S9zJ846U 4JSdkHNDSaNzlHZKjBjzVQa+xQouW6zA==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

... rather than having them spread out.  Explain consicely why each is empty.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
CC: Jan Beulich <JBeulich@xxxxxxxx>
CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
CC: Wei Liu <wl@xxxxxxx>
CC: George Dunlap <george.dunlap@xxxxxxxxxx>

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

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 */
-- 
2.30.2




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.