Gregory Haskins wrote:
> This is a cleanup patch to "de-VMX" the general code.  It was developed in the
> preempt-hooks branch, but it should apply elsewhere as well.
>
>   

Many cooks on this patch...

> @@ -310,16 +301,13 @@ void kvm_io_bus_register_dev(struct kvm_io_bus *bus,
>                            struct kvm_io_device *dev);
>  
>  struct kvm_vcpu {
> +     int valid;
>   

This is okay as a temporary measure, until the vcpu array is replaced by 
a vcpu pointer array (when vcpu->valid can be replaced by vcpu != NULL).


>       struct kvm *kvm;
>       struct preempt_hook preempt_hook;
>       int vcpu_id;
> -     union {
> -             struct vmcs *vmcs;
> -             struct vcpu_svm *svm;
> -     };
> +     void *_priv;
>   

The other cooks did this by embedding the one of the structures within 
the other, which reduces indirections.

> @@ -1664,7 +1664,7 @@ void load_msrs(struct vmx_msr_entry *e, int n)
>  }
>  EXPORT_SYMBOL_GPL(load_msrs);
>  
> -void save_msrs(struct vmx_msr_entry *e, int n)
> +void save_msrs(struct kvm_msr_entry *e, int n)
>  {
>       int i;
>   

This isn't actually used in svm, so we can keep the name vmx_msr_entry 
and just move the function.  It need not be done in this patch.

> --- a/drivers/kvm/svm.c
> +++ b/drivers/kvm/svm.c
> @@ -49,6 +49,8 @@ MODULE_LICENSE("GPL");
>  #define SVM_FEATURE_LBRV (1 << 1)
>  #define SVM_DEATURE_SVML (1 << 2)
>  
> +#define svm(vcpu) ((struct vcpu_svm*)vcpu->_priv)
> +
>   

Inline function.

> };
> +
> +#define vmx(vcpu) ((struct vcpu_vmx*)vcpu->_priv)
> +
>   

Inline function.


Patch looks good except for the extra indirection.  But maybe a later 
patch can do that.  Paul?  Rusty?

-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
kvm-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to