From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: Registers need to recover when emulating L2 vmexit Date: Mon, 8 Jul 2013 20:18:37 +0300 Message-ID: <20130708171837.GC26728@redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm , Paolo Bonzini , Jan Kiszka To: Arthur Chunqi Li Return-path: Received: from mx1.redhat.com ([209.132.183.28]:21107 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751874Ab3GHRSk (ORCPT ); Mon, 8 Jul 2013 13:18:40 -0400 Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Jul 08, 2013 at 07:50:45PM +0800, Arthur Chunqi Li wrote: > Hi Gleb and Paolo, > >From current KVM codes, when L2 cause VMEXIT or L1 fails to enter L2, > host VMX will execute nested_vmx_vmexit() and > nested_vmx_entry_failure(). Both of them calls > load_vmcs12_host_state() which loads vmcs12's HOST fields as vmcs01's > GUEST fields. But the HOST and GUEST fields are not accurately > correspondence, e.g. GUEST_CS/ES..._BASE/LIMIT/AR. What will these > MSRs be set? > This is not MSRs, but VMCS field. Currently they are set to whatever value they had in vmcs01 when L1 executed VMLAUNCH, but this is incorrect. They should be set according to section 27.5.2 "Loading Host Segment and Descriptor-Table Registers" of SDM. -- Gleb.