x86/svm: Clean up vmcbcleanbits_t handling
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 21 Apr 2020 17:18:08 +0000 (18:18 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 7 May 2020 12:50:38 +0000 (13:50 +0100)
commit06e6f3176804b7eabfd028ec3777a69668fad36a
tree24d08b093e1444df9049dd59a7f498dd925b7247
parent40675b4b874cb9fee0d4f0e12bb3e153ee1c135a
x86/svm: Clean up vmcbcleanbits_t handling

Rework the vmcbcleanbits_t definitons to use bool, drop 'fields' from the
namespace, position the comments in an unambiguous position, and include the
bit position.

In svm_vmexit_handler(), don't bother conditionally writing ~0 or 0 based on
hardware support.  The field was entirely unused and ignored on older
hardware (and we're already setting reserved cleanbits anyway).

In nsvm_vmcb_prepare4vmrun(), simplify the logic massively by dropping the
vcleanbit_set() macro using a vmcbcleanbits_t local variable which only gets
filled in the case that clean bits were valid previously.  Fix up the style on
impacted lines.

No practical change in behaviour.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hvm/svm/nestedsvm.c
xen/arch/x86/hvm/svm/svm.c
xen/arch/x86/hvm/svm/svmdebug.c
xen/include/asm-x86/hvm/svm/vmcb.h