Re: [PATCH 20/27] nVMX: Deciding if L0 or L1 should handle an L2 exit

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

 



 On 10/20/2010 02:13 PM, Avi Kivity wrote:
+    switch (exit_reason) {
+    case EXIT_REASON_EXTERNAL_INTERRUPT:
+        return 0;
+    case EXIT_REASON_EXCEPTION_NMI:
+        if (!is_exception(intr_info))
+            return 0;
+        else if (is_page_fault(intr_info)&&  (!enable_ept))
+            return 0;
+

We may still find out later that the page fault needs to be intercepted by the guest, yes?

+        return (vmcs12->exception_bitmap&
+                (1u<<  (intr_info&  INTR_INFO_VECTOR_MASK)));
+    case EXIT_REASON_EPT_VIOLATION:
+        return 0;
+    case EXIT_REASON_INVLPG:
+        return (vmcs12->cpu_based_vm_exec_control&
+                CPU_BASED_INVLPG_EXITING);
+    case EXIT_REASON_MSR_READ:
+    case EXIT_REASON_MSR_WRITE:
+        return nested_vmx_exit_handled_msr(vcpu, vmcs12, exit_reason);
+    case EXIT_REASON_CR_ACCESS:
+        return nested_vmx_exit_handled_cr(vcpu, vmcs12);
+    case EXIT_REASON_DR_ACCESS:
+        return (vmcs12->cpu_based_vm_exec_control&
+                CPU_BASED_MOV_DR_EXITING);
+    default:
+        /*
+         * One particularly interesting case that is covered here is an
+         * exit caused by L2 running a VMX instruction. L2 is guest
+         * mode in L1's world, and according to the VMX spec running a
+         * VMX instruction in guest mode should cause an exit to root
+         * mode, i.e., to L1. This is why we need to return r=1 for
+         * those exit reasons too. This enables further nesting: Like
+         * L0 emulates VMX for L1, we now allow L1 to emulate VMX for
+         * L2, who will then be able to run L3.
+         */
+        return 1;

What about intr/nmi window?


Also WBINVD, pause loop exit, rdtsc[p], monitor/mwait, hlt.

It's best to list every exit reason here, so it's easier to review and maintain.


--
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux