From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mukesh Rathor Subject: Re: RFC: PVH set vcpu info context in vmcs.... Date: Fri, 16 Aug 2013 18:37:09 -0700 Message-ID: <20130816183709.4b8bde2c@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> 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 1VAVSC-0001Ms-Ti for xen-devel@lists.xenproject.org; Sat, 17 Aug 2013 01:37:21 +0000 In-Reply-To: <20130816152837.7c04822f@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: Jan Beulich Cc: xen-devel , Keir Fraser , Tim Deegan List-Id: xen-devel@lists.xenproject.org On Fri, 16 Aug 2013 15:28:37 -0700 Mukesh Rathor wrote: > On Fri, 16 Aug 2013 08:28:12 +0100 > "Jan Beulich" wrote: ......... > Ok, I'll have to change tools to make sure they are zeroed in the > create path. I can do that. I'll also take that to mean you are ok > with the above short function with checks for zero... I'll have it > that way in the next version. Thank you very much :), I'm glad this > is finally resolved. 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. */ 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); return 0; }