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 /tools/misc | |
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 'tools/misc')
-rw-r--r-- | tools/misc/xen-hvmctx.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/misc/xen-hvmctx.c b/tools/misc/xen-hvmctx.c index 5dc534d27e..f980a422cf 100644 --- a/tools/misc/xen-hvmctx.c +++ b/tools/misc/xen-hvmctx.c @@ -383,6 +383,13 @@ static void dump_viridian_vcpu(void) (unsigned long long) p.apic_assist); } +static void dump_vmce_vcpu(void) +{ + HVM_SAVE_TYPE(VMCE_VCPU) p; + READ(p); + printf(" VMCE_VCPU: caps %" PRIx64 "\n", p.caps); +} + int main(int argc, char **argv) { int entry, domid; @@ -449,6 +456,7 @@ int main(int argc, char **argv) case HVM_SAVE_CODE(MTRR): dump_mtrr(); break; case HVM_SAVE_CODE(VIRIDIAN_DOMAIN): dump_viridian_domain(); break; case HVM_SAVE_CODE(VIRIDIAN_VCPU): dump_viridian_vcpu(); break; + case HVM_SAVE_CODE(VMCE_VCPU): dump_vmce_vcpu(); break; case HVM_SAVE_CODE(END): break; default: printf(" ** Don't understand type %u: skipping\n", |