From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Nadav Har'El" Subject: Re: [PATCH 18/24] Exiting from L2 to L1 Date: Mon, 13 Sep 2010 11:01:44 +0200 Message-ID: <20100913090144.GA17418@fermat.math.technion.ac.il> References: <1276431753-nyh@il.ibm.com> <20100912170503.GA7828@fermat.math.technion.ac.il> <4C8D0C19.4050003@redhat.com> <201009131353.56814.sheng@linux.intel.com> <4C8DE630.9010405@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Sheng Yang , kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mailgw12.technion.ac.il ([132.68.225.12]:43633 "EHLO mailgw12.technion.ac.il" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752507Ab0IMJBv (ORCPT ); Mon, 13 Sep 2010 05:01:51 -0400 Content-Disposition: inline In-Reply-To: <4C8DE630.9010405@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Sep 13, 2010, Avi Kivity wrote about "Re: [PATCH 18/24] Exiting from L2 to L1": > So the following options should work: > > 1. vmcs12->vm_entry_intr_info_field = > vmcs_read32(VM_ENTRY_INTR_INFO_FIELD); Right, this was the original code in the patch. > 2. if (!(exit_reason & FAILED_ENTRY)) vmcs12->vm_exit_intry_info_field > &= ~VALID; I now prefer this code. It doesn't do vmread (but replaces it with a bunch of extra instructions - which might be even slower overall...). But the more interesting thing is that it doesn't copy irrelevant bits from vmcs02 to vmcs12, bits that might not have been set by L1 but rather by L0 which previously injected an interrupt into the same L2. These bits shouldn't matter (when !valid), but a nosy L1 might notice them... > 3. if (exit_reason & FAILED_ENTRY) vmcs12->vm_entry_intr_info_field = > vmcs_read32(VM_ENTRY_INTR_INFO_FIELD); I think you meant the opposite condition? if (!(exit_reason & FAILED_ENTRY)) vmcs12->vm_entry_intr_info_field = vmcs_read32(VM_ENTRY_INTR_INFO_FIELD); -- Nadav Har'El | Monday, Sep 13 2010, 5 Tishri 5771 nyh@math.technion.ac.il |----------------------------------------- Phone +972-523-790466, ICQ 13349191 |Always borrow money from pessimists. They http://nadav.harel.org.il |don't expect to be paid back.