[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] RFC: PVH set vcpu info context in vmcs....



On Wed, 14 Aug 2013 17:25:15 -0700
Mukesh Rathor <mukesh.rathor@xxxxxxxxxx> wrote:

> On Wed, 14 Aug 2013 10:12:18 +0100
> "Jan Beulich" <JBeulich@xxxxxxxx> wrote:
.......
> int vmx_pvh_set_vcpu_info(struct vcpu *v, struct vcpu_guest_context
> *ctxtp) {
>     int rc;
> 
>     if ( !(ctxtp->flags & VGCF_in_kernel) )
>         return -EINVAL;
> 
>     if ( ctxtp->ldt_base || ctxtp->ldt_ents ||
>          ctxtp->user_regs.ss || ctxtp->user_regs.es ||
> ctxtp->user_regs.ds || ctxtp->user_regs.fs || ctxtp->user_regs.gs )
>         return -EINVAL;
> 
>     if ( ctxtp->user_regs.cs == 0 || (ctxtp->user_regs.cs & 7) )
>         return -EINVAL;
> 
>     vmx_vmcs_enter(v);
>     __vmwrite(GUEST_GDTR_BASE, ctxtp->gdt.pvh.addr);
>     __vmwrite(GUEST_GDTR_LIMIT, ctxtp->gdt.pvh.limit);
> 
>     /* IA-32e: ss/es/ds are ignored. */
>     if ( (rc = hvm_load_segment_selector(v, x86_seg_cs,
> ctxtp->user_regs.cs)) ) goto out;
> 
>     __vmwrite(GUEST_FS_BASE, ctxtp->fs_base);
>     __vmwrite(GUEST_GS_BASE, ctxtp->gs_base_kernel);
> 
>     if ( (rc = vmx_add_guest_msr(MSR_SHADOW_GS_BASE)) )
>         goto out;
>     vmx_write_guest_msr(MSR_SHADOW_GS_BASE, ctxtp->gs_base_user);
> 

Jan,

Thinking about this more, I realized we are unnecessarily creating
a vmcs intercept for gs_base_user. How about we not allow that either?

thanks
mukesh


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.