@@ -53,6 +53,15 @@ The ACRN hypervisor shell supports the following commands:
5353 * - wrmsr [-p<pcpu_id>] <msr_index> <value>
5454 - Write ``value `` (in hexadecimal) to the model-specific register (MSR) at
5555 index ``msr_index `` (in hexadecimal) for CPU ID ``pcpu_id ``.
56+ * - vmexit [enable | disable | clear | <vm_id>]
57+ - Controls collection and display of vmexit occurrences useful for
58+ real-time performance profiling.
59+
60+ * **enable ** and **disable ** determine if vmexit data is collected
61+ (enabled by default in a debug-mode build).
62+ * **clear ** resets counters back to zero.
63+ * **<vm_id> ** displays vmexit data per vmexit reason for all vCPUs for that VM.
64+ * If no argument is given, data for all VMs is displayed.
5665
5766Command Examples
5867****************
@@ -249,3 +258,39 @@ In the following example, we can set the IA32_APIC_BASE value of pCPU 1 through
249258the command::
250259
251260 wrmsr -p1 1b 0xfee00c00
261+
262+ vmexit
263+ ======
264+
265+ VMexit data collection is enabled by default in a debug-mode ACRN build. There
266+ should be little impact on real-time system performance since a tuned RTVM
267+ should have very few vmexits.
268+
269+ You can disable vmexit data collection using the ACRN shell's ``vmexit disable ``
270+ command.
271+
272+ The ``vmexit `` command with no arguments (or with a <vm_id> argument) shows a
273+ table of counters for each vmexit reason, for all VM's (or just the
274+ specified VM's) vCPUs, showing the latency time counts. For example:
275+
276+ .. figure :: images/vmexit-example.png
277+ :align: center
278+
279+ VMexit reason codes are defined in the (ACRN) kernel source code
280+ :acrn_file: `hypervisor/include/arch/x86/asm/vmx.h ` (search for "VM exit
281+ reasons"). Here are a few examples:
282+
283+ .. list-table ::
284+ :header-rows: 1
285+ :widths: 20 80
286+
287+ * - VMexit reason code
288+ - Explanation
289+ * - 0x01
290+ - An external interrupt (IRQ) arrived
291+ * - 0x0a
292+ - The guest VM software attempted to execute the CPUID instruction.
293+ * - 0x0c
294+ - The guest VM attempted to execute HLT instruction.
295+ * - 0x12
296+ - The execution of VMCALL by the guest VM caused an ordinary VM exit.
0 commit comments