x86/hvm: Disallow moving the APIC MMIO window
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 10 Dec 2018 11:42:13 +0000 (11:42 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 18 Dec 2018 17:13:51 +0000 (17:13 +0000)
commit3b5e03b9396b54b938c76972a0d804f22cc4eb64
tree1f45793d5e20f861eb95cfe4497720ab32918d6d
parent529ccf68e87aa7b85d4a9db4c5af6e54e0ac3b85
x86/hvm: Disallow moving the APIC MMIO window

See the code comment for a full discussion, but in short: guests which
currently run under Xen don't move the window, because moving it has never
worked properly.  Implementing support for moving the window is never going to
work architecturally unless we switch to per-vcpu P2Ms (which seems very
unlikely), and would still be a substantial quantity of work for a feature
which is unused in practice.

Take the opportunity to rename vlapic_msr_set() to be consistent with the
other MSR handling functions, and return X86EMUL_* constants.  Add logic to
check for reserved bits, including refusing x2APIC mode if it has not been
offered to the guest.  Move the guest_{rd,wr}msr_x2apic() declarations into
vlapic.h which is a more appropriate place for them to live.

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/hvm.c
xen/arch/x86/hvm/vlapic.c
xen/include/asm-x86/hvm/hvm.h
xen/include/asm-x86/hvm/vlapic.h