From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 20/27] nVMX: Deciding if L0 or L1 should handle an L2 exit Date: Wed, 20 Oct 2010 16:57:16 +0200 Message-ID: <4CBF034C.6040702@redhat.com> References: <1287309814-nyh@il.ibm.com> <201010171013.o9HADnE1029533@rice.haifa.ibm.com> <4CBEDCEA.1020507@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, gleb@redhat.com To: "Nadav Har'El" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:51897 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753275Ab0JTO5W (ORCPT ); Wed, 20 Oct 2010 10:57:22 -0400 In-Reply-To: <4CBEDCEA.1020507@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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.