On 19.09.2019 13:37, Jan Beulich wrote: > hvm_monitor_cpuid() expects the input registers, not two of the outputs. > > However, once having made the necessary adjustment, the SVM and VMX > functions are so similar that they should be folded (thus avoiding > further similar asymmetries to get introduced). Use the best of both > worlds by e.g. using "curr" consistently. This then being the only > caller of hvm_check_cpuid_faulting(), fold in that function as well. > > Signed-off-by: Jan Beulich <jbeul...@suse.com>
Reviewed-by: Alexandru Isaila <aisa...@bitdefender.com> > > --- a/xen/arch/x86/hvm/hvm.c > +++ b/xen/arch/x86/hvm/hvm.c > @@ -3349,14 +3349,28 @@ unsigned long copy_from_user_hvm(void *t > return rc ? len : 0; /* fake a copy_from_user() return code */ > } > Useful fold. Maybe a small comment with the reason to have one function would help. Something like both SVM and VMX do the same thing, but it's up to you if it is necessary. > -bool hvm_check_cpuid_faulting(struct vcpu *v) > +int hvm_vmexit_cpuid(struct cpu_user_regs *regs, unsigned int inst_len) Alex _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel