diff options
author | Jan Beulich <jbeulich@suse.com> | 2012-02-24 09:07:54 +0100 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2012-02-24 09:07:54 +0100 |
commit | e1dc98e3c3619cf7a050cc898ecb9288eceb5915 (patch) | |
tree | 0acf478885bffcdf4584716e62ff7fc87f799d6a /xen/include/asm-x86/mce.h | |
parent | b272353fe98db5bdc73fff3c60a0574835df4c87 (diff) | |
download | xen-e1dc98e3c3619cf7a050cc898ecb9288eceb5915.tar.gz xen-e1dc98e3c3619cf7a050cc898ecb9288eceb5915.tar.bz2 xen-e1dc98e3c3619cf7a050cc898ecb9288eceb5915.zip |
x86/vMCE: save/restore MCA capabilities
This allows migration to a host with less MCA banks than the source
host had, while without this patch accesses to the excess banks' MSRs
caused #GP-s in the guest after migration (and it depended on the guest
kernel whether this would be fatal).
A fundamental question is whether we should also save/restore MCG_CTL
and MCi_CTL, as the HVM save record would better be defined to the
complete state that needs saving from the beginning (I'm unsure whether
the save/restore logic allows for future extension of an existing
record).
Of course, this change is expected to make migration from new to older
Xen impossible (again I'm unsure what the save/restore logic does with
records it doesn't even know about).
The (trivial) tools side change may seem unrelated, but the code should
have been that way from the beginning to allow the hypervisor to look
at currently unused ext_vcpucontext fields without risking to read
garbage when those fields get a meaning assigned in the future. This
isn't being enforced here - should it be? (Obviously, for backwards
compatibility, the hypervisor must assume these fields to be clear only
when the extended context's size exceeds the old original one.)
A future addition to this change might be to allow configuration of the
number of banks and other MCA capabilities for a guest before it starts
(i.e. to not inherits the values seen on the first host it runs on).
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/include/asm-x86/mce.h')
-rw-r--r-- | xen/include/asm-x86/mce.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/xen/include/asm-x86/mce.h b/xen/include/asm-x86/mce.h index 8ff4e3634e..10bef1841b 100644 --- a/xen/include/asm-x86/mce.h +++ b/xen/include/asm-x86/mce.h @@ -16,7 +16,6 @@ struct bank_entry { struct domain_mca_msrs { /* Guest should not change below values after DOM boot up */ - uint64_t mcg_cap; uint64_t mcg_ctl; uint64_t mcg_status; uint64_t *mci_ctl; @@ -28,6 +27,8 @@ struct domain_mca_msrs /* Guest vMCE MSRs virtualization */ extern int vmce_init_msr(struct domain *d); extern void vmce_destroy_msr(struct domain *d); +extern void vmce_init_vcpu(struct vcpu *); +extern int vmce_restore_vcpu(struct vcpu *, uint64_t caps); extern int vmce_wrmsr(uint32_t msr, uint64_t val); extern int vmce_rdmsr(uint32_t msr, uint64_t *val); |