From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tim Deegan Subject: Re: RFC: PVH set vcpu info context in vmcs.... Date: Sat, 17 Aug 2013 11:22:20 +0100 Message-ID: <20130817102220.GA86128@ocelot.phlegethon.org> 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> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VAdeN-0006JL-F6 for xen-devel@lists.xenproject.org; Sat, 17 Aug 2013 10:22:27 +0000 Content-Disposition: inline In-Reply-To: <20130816183709.4b8bde2c@mantra.us.oracle.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: Mukesh Rathor Cc: xen-devel , Keir Fraser , Jan Beulich List-Id: xen-devel@lists.xenproject.org At 18:37 -0700 on 16 Aug (1376678229), Mukesh Rathor wrote: > Ok, changed the tools to clear fields, tested and everything works: > > /* > * 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()). > * > * Note, PVH save/restore is expected to happen the HVM way, ie, > * do_domctl -> XEN_DOMCTL_sethvmcontext -> hvm_load/save > * and not get here. > * > * PVH 32bitfixme: this function needs to be modified for 32bit guest. What's the 32-bit interface going to be like? Presumably it will have to load segment state, so this is just postponing that work until then. > */ > 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; > > vmx_vmcs_enter(v); > __vmwrite(GUEST_GS_BASE, ctxtp->gs_base_kernel); > vmx_vmcs_exit(v); Why does this one field get loaded? Couldn't it be zero too? Tim.