From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mukesh Rathor Subject: Re: RFC: PVH set vcpu info context in vmcs.... Date: Mon, 19 Aug 2013 14:46:55 -0700 Message-ID: <20130819144655.130e1dff@mantra.us.oracle.com> References: <20130812184513.56188d29@mantra.us.oracle.com> <520A2D0402000078000EB7E7@nat28.tlf.novell.com> <20130813191203.0e2e0d5f@mantra.us.oracle.com> <520B661202000078000EBC88@nat28.tlf.novell.com> <20130814172515.11fb949a@mantra.us.oracle.com> <520C91E702000078000EC0E4@nat28.tlf.novell.com> <20130815192638.170772e0@mantra.us.oracle.com> <520DF0AC02000078000EC77B@nat28.tlf.novell.com> <20130816152837.7c04822f@mantra.us.oracle.com> <20130816183709.4b8bde2c@mantra.us.oracle.com> <5211F4C902000078000A0810@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VBXHy-0004yH-SM for xen-devel@lists.xenproject.org; Mon, 19 Aug 2013 21:47:04 +0000 In-Reply-To: <5211F4C902000078000A0810@nat28.tlf.novell.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: Jan Beulich Cc: xen-devel@lists.xenproject.org, keir.xen@gmail.com, tim@xen.org List-Id: xen-devel@lists.xenproject.org On Mon, 19 Aug 2013 10:34:49 +0100 "Jan Beulich" wrote: > >>> Mukesh Rathor 08/17/13 3:37 AM >>> > >/* > >* Set vmcs fields during boot of a vcpu. Called from > >arch_set_info_guest. * > >* Boot vcpu call is from tools via: > >* do_domctl -> XEN_DOMCTL_setvcpucontext -> arch_set_info_guest > >* > >* Secondary vcpu's are brought up by the guest itself via: > >* do_vcpu_op -> VCPUOP_initialise -> arch_set_info_guest > >* (In case of linux, the call comes from > >cpu_initialize_context()). > > So here you describe clearly that the function is to be called for > each vCPU exactly once. No vCPU == 0 special casing needed (also not > in the caller, as I understood you moved the check there - if not, > all is fine). No more check for vcpu==0 needed now. > >int vmx_pvh_vcpu_boot_set_info(struct vcpu *v, > >struct vcpu_guest_context *ctxtp) > >{ > >if ( ctxtp->ldt_base || ctxtp->ldt_ents || > >ctxtp->user_regs.cs || ctxtp->user_regs.ss || ctxtp->user_regs.es || > >ctxtp->user_regs.ds || ctxtp->user_regs.fs || ctxtp->user_regs.gs || > >ctxtp->gdt.pvh.addr || ctxtp->gdt.pvh.limit || > >ctxtp->fs_base || ctxtp->gs_base_user ) > >return -EINVAL; > > I assume there's be a place where these restrictions are both > documented and rationalized; otherwise this looks pretty arbitrary. Yes, I'll document the API. thanks mukesh