diff options
author | Liu, Jinsong <jinsong.liu@intel.com> | 2012-09-26 12:04:00 +0200 |
---|---|---|
committer | Liu, Jinsong <jinsong.liu@intel.com> | 2012-09-26 12:04:00 +0200 |
commit | 975b5bdf27031adef6587bb5c92b7a5800e051f1 (patch) | |
tree | e69cf436778fc15c19764cca89c0e164f228fc43 /xen/arch/x86/traps.c | |
parent | 8e804aec451a072022eece0980481ab545b5cd75 (diff) | |
download | xen-975b5bdf27031adef6587bb5c92b7a5800e051f1.tar.gz xen-975b5bdf27031adef6587bb5c92b7a5800e051f1.tar.bz2 xen-975b5bdf27031adef6587bb5c92b7a5800e051f1.zip |
x86: vMCE emulation
This patch provides virtual MCE support to guest. It emulates a simple
and clean MCE MSRs interface to guest by faking caps to guest if needed
and masking caps if unnecessary:
1. Providing a well-defined MCG_CAP to guest, filter out un-necessary
caps and provide only guest needed caps;
2. Disabling MCG_CTL to avoid model specific;
3. Sticking all 1's to MCi_CTL to guest to avoid model specific;
4. Enabling CMCI cap but never really inject to guest to prevent
polling periodically;
5. Masking MSCOD field of MCi_STATUS to avoid model specific;
6. Keeping natural semantics by per-vcpu instead of per-domain
variables;
7. Using bank1 and reserving bank0 to work around 'bank0 quirk' of some
very old processors;
8. Cleaning some vMCE# injection logic which shared by Intel and AMD
but useless under new vMCE implement;
9. Keeping compatilbe w/ old xen version which has been backported to
SLES11 SP2, so that old vMCE would not blocked when migrate to new
vMCE;
Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
- make printing consistent (and non-exploitable)
- fix return values of intel_mce_{rd,wr}msr() for out of range banks
- miscellaneous cleanup
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
Diffstat (limited to 'xen/arch/x86/traps.c')
-rw-r--r-- | xen/arch/x86/traps.c | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index 0e0a9022a7..58cf0de6c0 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -3141,50 +3141,6 @@ void async_exception_cleanup(struct vcpu *curr) break; ASSERT(trap <= VCPU_TRAP_LAST); - /* inject vMCE to PV_Guest including DOM0. */ - if ( trap == VCPU_TRAP_MCE ) - { - gdprintk(XENLOG_DEBUG, "MCE: Return from vMCE# trap!\n"); - if ( curr->vcpu_id == 0 ) - { - struct domain *d = curr->domain; - - if ( !d->arch.vmca_msrs->nr_injection ) - { - printk(XENLOG_WARNING "MCE: ret from vMCE#, " - "no injection node\n"); - goto end; - } - - d->arch.vmca_msrs->nr_injection--; - if ( !list_empty(&d->arch.vmca_msrs->impact_header) ) - { - struct bank_entry *entry; - - entry = list_entry(d->arch.vmca_msrs->impact_header.next, - struct bank_entry, list); - gdprintk(XENLOG_DEBUG, "MCE: delete last injection node\n"); - list_del(&entry->list); - } - else - printk(XENLOG_ERR "MCE: didn't found last injection node\n"); - - /* further injection */ - if ( d->arch.vmca_msrs->nr_injection > 0 && - guest_has_trap_callback(d, 0, TRAP_machine_check) && - !test_and_set_bool(curr->mce_pending) ) - { - int cpu = smp_processor_id(); - - cpumask_copy(curr->cpu_affinity_tmp, curr->cpu_affinity); - printk(XENLOG_DEBUG "MCE: CPU%d set affinity, old %d\n", - cpu, curr->processor); - vcpu_set_affinity(curr, cpumask_of(cpu)); - } - } - } - -end: /* Restore previous asynchronous exception mask. */ curr->async_exception_mask = curr->async_exception_state(trap).old_mask; } |