aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/asm-x86/mce.h
Commit message (Collapse)AuthorAgeFilesLines
* x86: vMCE save and restoreLiu, Jinsong2012-09-261-1/+1
| | | | | | | | | | | | | | | | | | | This patch provides vMCE save/restore when migration. 1. MCG_CAP is well-defined. However, considering future cap extension, we keep save/restore logic that Jan implement at c/s 24887; 2. MCi_CTL2 initialized by guestos when booting, so need save/restore otherwise guest would surprise; 3. Other MSRs do not need save/restore since they are either error- related and pointless to save/restore, or, unified among all vMCE platform; Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com> - fix handling of partial data in XEN_DOMCTL_set_ext_vcpucontext - fix adjustment of xen_domctl_ext_vcpucontext Signed-off-by: Jan Beulich <jbeulich@suse.com> Committed-by: Jan Beulich <jbeulich@suse.com>
* x86: vMCE emulationLiu, Jinsong2012-09-261-12/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* x86/MCE: remove mcg_ctl and other adjustment for future vMCELiu, Jinsong2012-08-071-1/+0
| | | | | | | | This is a middle-work patch, preparing for the future new vMCE model. It removes mcg_ctl, disables MCG_CTL_P, and sets bank count to 2. Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com> Committed-by: Jan Beulich <jbeulich@suse.com>
* Xen/MCE: stick all 1's to MCi_CTL of vMCELiu, Jinsong2012-07-191-1/+0
| | | | | | | | This patch is a middle-work patch, prepare for future new vMCE model. It remove mci_ctl array, and keep MCi_CTL all 1's. Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com> Committed-by: Keir Fraser <keir@xen.org>
* x86/vMCE: save/restore MCA capabilitiesJan Beulich2012-02-241-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* xen: remove more declarations from C files.Tim Deegan2011-05-271-0/+3
| | | | | | | | | | This patch moves some more, mostly data, extern declarations into header files. I haven't been as strict as I was with functions; in particular there are a number of declarations of assembler labels that are only used in one place. I've also left a few compat-mode tricks, and all the magic in symbols.c Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
* mce: Clean-up mcheck_init handlerKeir Fraser2010-06-091-2/+0
| | | | | | | | | | | | | | | | | | | | | | | Firstly and most importantly, the maxium MCA banks are hard-coded as MAX_NR_BANKS, which is 30. This is not architecture correct. This patch removes this definition, replacig the cpu_banks_t with mca_banks, and provide some basic function, like set/clear/test/alloc/free for mcabanks_t. Secondly, remove the broadcast_check code to intel specific, since only Intel platform support broadcast now. Thirdly, the X86_FEATURE_MCA check and CR4_MCE enable is done in every vendor-specifc callback, that's redundant, move it to mcheck_init. Also, we should enable CR4_MCE only in the end of the mcheck_init, to close the small window between CR4_enable and the mca setup. And we also move vmce specific code to vmce.c as vmce_init, to make code clean. Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com> Acked-By: Christoph Egger <Christoph.Egger@amd.com>
* vmce: Clean up implementation and setup/destroy.Keir Fraser2010-05-061-2/+1
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Clean up MCA MSR virtualization and vMCE injectionKeir Fraser2010-04-191-0/+36
Remove all virtual MCE related work into a seperated file. It also try to do some clean-up on the vMCE, including: a) renmae some function name like mce_init_msr/mce_rdmsr to be vmce_init_msr/vmce_rdmsr to make it more straightforward, b) make the vmca_msrs be a pointer in arch_domain, to decrease arch_domain's size c) extract per-bank MCA MSR access to be seperated function (bank_mce_wrmsr/bank_mce_rdmsr) to make it be a bit cleaner. d) A new file xen/include/asm-x86/mce.h is added for vmce related header. Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>