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

Re: [Xen-devel] [PATCH 1/4] nested vmx: Use a list to store the launched vvmcs for L1 VMM




> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@xxxxxxxx]
> Sent: Thursday, January 17, 2013 7:38 PM
> To: Xu, Dongxiao
> Cc: Dong, Eddie; Nakajima, Jun; Zhang, Xiantao; xen-devel
> Subject: Re: [Xen-devel] [PATCH 1/4] nested vmx: Use a list to store the
> launched vvmcs for L1 VMM
> 
> >>> On 17.01.13 at 06:37, Dongxiao Xu <dongxiao.xu@xxxxxxxxx> wrote:
> > @@ -74,6 +77,11 @@ void nvmx_vcpu_destroy(struct vcpu *v)
> >          free_xenheap_page(nvcpu->nv_n2vmcx);
> >          nvcpu->nv_n2vmcx = NULL;
> >      }
> > +
> > +    list_for_each_entry_safe(item, n, &nvmx->launched_list, node) {
> 
> Misplaced brace.
> 
> > +        list_del(&item->node);
> > +        xfree(item);
> > +    }
> >  }
> >
> >  void nvmx_domain_relinquish_resources(struct domain *d)
> > @@ -1198,6 +1206,59 @@ int nvmx_handle_vmxoff(struct cpu_user_regs
> *regs)
> >      return X86EMUL_OKAY;
> >  }
> >
> > +static int vvmcs_launched(struct list_head *launched_list, paddr_t
> vvmcs_pa)
> 
> Returning bool_t really?
> 
> > +{
> > +    struct vvmcs_list *vvmcs = NULL;
> 
> Pointless initializer.
> 
> > +    struct list_head *pos;
> > +    int launched = 0;
> 
> bool_t?
> 
> > @@ -1230,8 +1293,8 @@ int nvmx_handle_vmresume(struct cpu_user_regs
> *regs)
> >          return X86EMUL_OKAY;
> >      }
> >
> > -    launched = __get_vvmcs(vcpu_nestedhvm(v).nv_vvmcx,
> > -                           NVMX_LAUNCH_STATE);
> > +    launched = vvmcs_launched(&nvmx->launched_list,
> > +                              virt_to_maddr(nvcpu->nv_vvmcx));
> 
> nv_vvmcx is obtained through hvm_map_guest_frame_rw(), so
> you can't validly use virt_to_maddr() on it. I know there are other
> examples of this in the code, but they're all wrong and will all get
> fixed once I get to submit the 16Tb support patches.

What's the correct way to get such machine address?
Also could you help to explain why it is wrong?

Thanks,
Dongxiao

> 
> Jan


_______________________________________________
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®.