From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mukesh Rathor Subject: Re: [PATCH RFC v12 08/21] pvh: vmx-specific changes Date: Tue, 17 Sep 2013 17:13:38 -0700 Message-ID: <20130917171338.7dd4d5c9@mantra.us.oracle.com> References: <1379089521-25720-1-git-send-email-george.dunlap@eu.citrix.com> <1379089521-25720-9-git-send-email-george.dunlap@eu.citrix.com> <52333F91.7080606@eu.citrix.com> <20130916161248.3cd0d87c@mantra.us.oracle.com> <52381748.1040300@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <52381748.1040300@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: George Dunlap Cc: Keir Fraser , Tim Deegan , Jan Beulich , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Tue, 17 Sep 2013 09:48:08 +0100 George Dunlap wrote: > On 09/17/2013 12:12 AM, Mukesh Rathor wrote: > > On Fri, 13 Sep 2013 17:38:41 +0100 > > George Dunlap wrote: > > > >> On 13/09/13 17:25, George Dunlap wrote: > >>> Changes: > >>> * Enforce HAP mode for now > >>> * Disable exits related to virtual interrupts or emulated APICs > >>> * Disable changing paging mode > >>> - "unrestricted guest" (i.e., real mode for EPT) disabled > > ........ > >>> + ASSERT(v->arch.hvm_vmx.exec_control & > >>> CPU_BASED_ACTIVATE_MSR_BITMAP); > >>> + ASSERT(!(v->arch.hvm_vmx.exec_control & > >>> CPU_BASED_RDTSC_EXITING)); + > >>> + /* > >>> + * Note: we run with default VM_ENTRY_LOAD_DEBUG_CTLS of > >>> 1, which means > >>> + * upon vmentry, the cpu reads/loads VMCS.DR7 and > >>> VMCS.DEBUGCTLS, and not > >>> + * use the host values. 0 would cause it to not use the > >>> VMCS values. > >>> + */ > >>> + > >>> + /* PVH: I don't think these are necessary */ > >>> + v->arch.hvm_vmx.exec_control &= > >>> ~CPU_BASED_VIRTUAL_NMI_PENDING; > >>> + vmentry_ctl &= ~VM_ENTRY_LOAD_GUEST_EFER; > >>> + vmentry_ctl &= ~VM_ENTRY_SMM; > >>> + vmentry_ctl &= ~VM_ENTRY_DEACT_DUAL_MONITOR; > >> > >> Mukesh, I couldn't figure out why you had set these. What are > >> these about, and are they really necessary? > > > > We clear those because: > > - VM_ENTRY_LOAD_GUEST_EFER: "Intel sdm 23.3.2.1 Loading Guest > > Control...." states that setting to 0 would cause the LMA to be > > loaded from VM_ENTRY_IA32E_MODE. > > OK -- but if we just set the LMA properly in the vmcs or wherever, > and prevent the guest from changing it, then it will DTRT, won't it? Hmm.. I gathered reading the SDMs that the LMA is set via VM_ENTRY_IA32E_MODE. We start the guest in Long mode. May be there are other ways, I am not sure. > > - VM_ENTRY_SMM: also according to the SDM must be 0 if not > > entering from SMM. > > - VM_ENTRY_DEACT_DUAL_MONITOR: same, must be 0 for entry outside > > SMM. > > But those have nothing to do with PVH -- Plain HVM guests needs that > as well. So they're already being cleared (or never being set) -- we > don't need to add these lines in a PVH-specific section. Right. Initially PVH was separate from HVM, hence these lines. thaks mukesh