SVM: correct CPUID event processing
authorJan Beulich <jbeulich@suse.com>
Wed, 25 Sep 2019 13:51:52 +0000 (15:51 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 25 Sep 2019 13:51:52 +0000 (15:51 +0200)
commit4f54473d0007ad60e0a9fda180213fc8bef1488a
tree3bfdb76ec6882aa4a836a549b1ba46ebc8acf8d9
parentc9c7ac508b3f65f7d5f9685893096a1b22d8b176
SVM: correct CPUID event processing

hvm_monitor_cpuid() expects the input registers, not two of the outputs
(it was this way right from its introduction by commit d05f1eb374
["hvm/svm: implement CPUID events"]).

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 <jbeulich@suse.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Acked-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
Reviewed-by: Alexandru Isaila <aisaila@bitdefender.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
xen/arch/x86/hvm/hvm.c
xen/arch/x86/hvm/svm/svm.c
xen/arch/x86/hvm/vmx/vmx.c
xen/include/asm-x86/hvm/hvm.h