x86/HVM: improve MTRR load checks
authorJan Beulich <jbeulich@suse.com>
Mon, 16 Jul 2018 13:08:02 +0000 (15:08 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 16 Jul 2018 13:08:02 +0000 (15:08 +0200)
commit76159f10b174d8a5cd4c50213a9d21fcc0e9441d
treec5ee002358130017f58e2ece05e94848bd75b163
parente3f667bc5f51d0aa44357a64ca134cd952679c81
x86/HVM: improve MTRR load checks

We should not assume that the incoming set of values contains exactly
MTRR_VCNT variable range MSRs. Permit a smaller amount and reject a
bigger one. As a result the save path then also needs to no longer use
a fixed upper bound, in turn requiring unused space in the save record
to be zeroed up front.

Also slightly refine types where appropriate.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
[switch to use MASK_EXTR to get VCNT]
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
xen/arch/x86/hvm/mtrr.c