From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Nadav Har'El" Subject: Re: [PATCH 23/31] nVMX: Correct handling of interrupt injection Date: Wed, 25 May 2011 13:56:00 +0300 Message-ID: <20110525105600.GA16418@fermat.math.technion.ac.il> References: <1305575004-nyh@il.ibm.com> <201105161955.p4GJtgKc001996@rice.haifa.ibm.com> <625BA99ED14B2D499DC4E29D8138F1505C9BFA3A70@shsmsx502.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "kvm@vger.kernel.org" , "gleb@redhat.com" , "avi@redhat.com" To: "Tian, Kevin" Return-path: Received: from mailgw12.technion.ac.il ([132.68.225.12]:37806 "EHLO mailgw12.technion.ac.il" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751324Ab1EYK4G (ORCPT ); Wed, 25 May 2011 06:56:06 -0400 Content-Disposition: inline In-Reply-To: <625BA99ED14B2D499DC4E29D8138F1505C9BFA3A70@shsmsx502.ccr.corp.intel.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, May 25, 2011, Tian, Kevin wrote about "RE: [PATCH 23/31] nVMX: Correct handling of interrupt injection": > > If L1 turns on VM_EXIT_ACK_INTR_ON_EXIT (again, no hypervisor that I know > > does), things look very different from the description above: L1 expects > > Type-1 bare metal hypervisor may enable this bit, such as Xen. This bit is > really prepared for L2 hypervisor since normally L2 hypervisor is tricky to > touch generic interrupt logic, and thus better to not ack it until interrupt > is enabled and then hardware will gear to the kernel interrupt handler > automatically. I have to be honest (and I was, in the patch set's introduction), this version of nested VMX was only tested with a KVM L1. We've had VMWARE Server running as a guest using a two-year-old branch of this code (as reported in our paper), but this code has changed considerably since and it probably will not work today. We've never tested Xen as L1. I'll remove the emphasis on "no hypervisor that I know does", but the important point remains: VM_EXIT_ACK_INTR_ON_EXIT is an optional feature, which we report is *not* supported, so L1 should not attempt to use it. As you said, it's not that difficult to support it, so we should, eventually, but it's not a priority right now. It's on my Bugzilla. > > +/* > > + * In nested virtualization, check if L1 asked to exit on external interrupts. > > + * For most existing hypervisors, this will always return true. > > + */ > > +static bool nested_exit_on_intr(struct kvm_vcpu *vcpu) > > +{ > > + return get_vmcs12(vcpu)->pin_based_vm_exec_control & > > + PIN_BASED_EXT_INTR_MASK; > > +} > > + > > could be a similar common wrapper like nested_cpu_has... I thought this made the callers easier to read, and didn't result in too much code duplication, so I prefer it this way. -- Nadav Har'El | Wednesday, May 25 2011, 21 Iyyar 5771 nyh@math.technion.ac.il |----------------------------------------- Phone +972-523-790466, ICQ 13349191 |Windows detected you moved your mouse. http://nadav.harel.org.il |Reboot for this change to take effect.