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

Re: [Xen-devel] [PATCH 05/16] x86/monitor: relocate code more appropriately



> From: Corneliu ZUZU [mailto:czuzu@xxxxxxxxxxxxxxx]
> Sent: Monday, July 11, 2016 2:19 PM
> >
> > +static inline
> > +void monitor_ctrlreg_adjust_traps(struct domain *d, unsigned int index)
> > +{
> > +    /* For now, VMX only. */
> > +    ASSERT(cpu_has_vmx);
> > +
> > +    /* Other CRs than CR3 are always trapped. */
> > +    if ( VM_EVENT_X86_CR3 == index )
> > +        vmx_vm_event_update_cr3_traps(d);
>      [Kevin wrote]:
> 
>       Please add above into a hvm function instead of directly calling
>       vmx in common file. (other arch can have it unimplemented).
>       Then you don't need change this common code again later when
>       other archs are added
> 
> ---
> 
> 
> This is not common code, it's in arch/x86/monitor.c (?) and currently,
> as the above ASSERT indicates, only VMX is supported. If in the future
> support for SVM for example will be added, then the hvm move you suggest
> must be done (Jan also suggested this).
> Or, I only now realize, if you guys prefer doing this now I could add a
> vm_event_update_cr3_traps field in hvm_function_table, but BUG() in the
> SVM one..
> 

The latter is desired. Instead of BUG, it makes more sense to return
error on an arch which doesn't register the callback.

Thanks
Kevin
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

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