x86/MCE: sanitize domain/vcpu ID handling
authorJan Beulich <jbeulich@suse.com>
Wed, 8 Mar 2017 14:07:41 +0000 (15:07 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 8 Mar 2017 14:07:41 +0000 (15:07 +0100)
commitbf118558984ebd42843bc81f873b3f378aca4fdd
tree0b80c1871c6018f1b75113b8863b4ede3eecd55c
parent7b726df89c2ec55aeb19cd37395777091c1c32fa
x86/MCE: sanitize domain/vcpu ID handling

Storing -1 into both fields was misleading consumers: We really should
have a manifest constant for "invalid vCPU" here, and the already
existing DOMID_INVALID should be used.

Also correct a bogus (dead code) check in mca_init_global(), at once
introducing a manifest constant for the early boot "invalid vCPU"
pointer (avoiding proliferation of the open coding). Make that pointer
a non-canonical address at once.

Finally, don't leave mc_domid uninitialized in mca_init_bank().

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/cpu/mcheck/mcaction.c
xen/arch/x86/cpu/mcheck/mce.c
xen/arch/x86/cpu/mcheck/vmce.c
xen/arch/x86/domain_page.c
xen/arch/x86/setup.c
xen/include/asm-x86/setup.h
xen/include/public/arch-x86/xen-mca.h