From: "Jan Beulich" Subject: Re: [PATCH RFC] pvh: clearly specify used parameters in vcpu_guest_context Date: Fri, 15 Nov 2013 16:32:54 +0000 Message-ID: <52865AC60200007800103AAE@nat28.tlf.novell.com> References: <1384530622-31703-1-git-send-email-roger.pau@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VhMKG-0003QF-Pv for xen-devel@lists.xenproject.org; Fri, 15 Nov 2013 16:32:57 +0000 In-Reply-To: <1384530622-31703-1-git-send-email-roger.pau@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Roger Pau Monne Cc: George Dunlap , xen-devel@lists.xenproject.org, Keir Fraser , Tim Deegan List-Id: xen-devel@lists.xenproject.org >>> On 15.11.13 at 16:50, Roger Pau Monne wrote: > --- a/xen/arch/x86/domain.c > +++ b/xen/arch/x86/domain.c > @@ -704,9 +704,11 @@ int arch_set_info_guest( > /* PVH 32bitfixme */ > ASSERT(!compat); > > - if ( c(ctrlreg[1]) || c(ldt_base) || c(ldt_ents) || > + if ( c(ctrlreg[0]) || c(ctrlreg[1]) || c(ctrlreg[2]) || > + c(ctrlreg[4]) || c(ldt_base) || c(ldt_ents) || I think it should actually be a bug for the guest to request an all blank CR0 or CR4. Minimally CR0.PE, CR0.PG, and CR4.PAE would seem to be a valid requirement to be set. Apart from that ctrlreg[] is an 8-element array... And I don't see debugreg[] being verified at all. > c(user_regs.cs) || c(user_regs.ss) || c(user_regs.es) || > c(user_regs.ds) || c(user_regs.fs) || c(user_regs.gs) || > + c(kernel_ss) || c(kernel_sp) || c.nat->gs_base_kernel || So George and/or Mukesh found it necessary to set gs_base_kernel, and you rip it out? I'm curious as to what they're going to say... > --- a/xen/arch/x86/hvm/vmx/vmx.c > +++ b/xen/arch/x86/hvm/vmx/vmx.c > @@ -1492,10 +1492,6 @@ static void vmx_set_info_guest(struct vcpu *v, uint64_t gs_base_kernel) > __vmwrite(GUEST_INTERRUPTIBILITY_INFO, intr_shadow); > } > > - /* PVH 32bitfixme */ > - if ( is_pvh_vcpu(v) ) > - __vmwrite(GUEST_GS_BASE, gs_base_kernel); And if you rip it out, then you should remove the now unused function parameter here again. Jan