All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vMCE: Implement AMD MSRs
@ 2012-10-17 10:41 Christoph Egger
  0 siblings, 0 replies; only message in thread
From: Christoph Egger @ 2012-10-17 10:41 UTC (permalink / raw)
  To: xen-devel@lists.xen.org

[-- Attachment #1: Type: text/plain, Size: 339 bytes --]


Implement AMD MSRs for vMCE

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>


-- 
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Einsteinring 24, 85689 Dornach b. Muenchen
Geschaeftsfuehrer: Alberto Bozzo
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632

[-- Attachment #2: xen_vmce.diff --]
[-- Type: text/plain, Size: 1840 bytes --]

# User Christoph Egger
# Date 1350465050 -7200
implement AMD MSRs for vMCE

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>

diff -r 9181f580bc3f -r 7d79c4a86be5 xen/arch/x86/cpu/mcheck/amd_f10.c
--- a/xen/arch/x86/cpu/mcheck/amd_f10.c
+++ b/xen/arch/x86/cpu/mcheck/amd_f10.c
@@ -106,24 +106,43 @@ enum mcheck_type amd_f10_mcheck_init(str
 /* amd specific MCA MSR */
 int vmce_amd_wrmsr(struct vcpu *v, uint32_t msr, uint64_t val)
 {
-        switch (msr) {
-        case MSR_F10_MC4_MISC1:
-        case MSR_F10_MC4_MISC2:
-        case MSR_F10_MC4_MISC3:
-                break;
-        }
+	switch (msr) {
+	case MSR_F10_MC4_MISC1: /* DRAM error type */
+		v->arch.vmce.bank[1].mci_misc = val; 
+		mce_printk(MCE_VERBOSE, "MCE: wr msr %#"PRIx64"\n", val);
+		break;
+	case MSR_F10_MC4_MISC2: /* Link error type */
+	case MSR_F10_MC4_MISC3: /* L3 cache error type */
+		/* ignore write: we do not emulate link and l3 cache errors
+		 * to the guest.
+		 */
+		mce_printk(MCE_VERBOSE, "MCE: wr msr %#"PRIx64"\n", val);
+		break;
+	default:
+		return 0;
+	}
 
-        return 1;
+	return 1;
 }
 
 int vmce_amd_rdmsr(const struct vcpu *v, uint32_t msr, uint64_t *val)
 {
-        switch (msr) {
-        case MSR_F10_MC4_MISC1:
-        case MSR_F10_MC4_MISC2:
-        case MSR_F10_MC4_MISC3:
-                break;
-        }
+	switch (msr) {
+	case MSR_F10_MC4_MISC1: /* DRAM error type */
+		*val = v->arch.vmce.bank[1].mci_misc;
+		mce_printk(MCE_VERBOSE, "MCE: rd msr %#"PRIx64"\n", *val);
+		break;
+	case MSR_F10_MC4_MISC2: /* Link error type */
+	case MSR_F10_MC4_MISC3: /* L3 cache error type */
+		/* we do not emulate link and l3 cache
+		 * errors to the guest.
+		 */
+		*val = 0;
+		mce_printk(MCE_VERBOSE, "MCE: rd msr %#"PRIx64"\n", *val);
+		break;
+	default:
+		return 0;
+	}
 
-        return 1;
+	return 1;
 }

[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-10-17 10:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-17 10:41 [PATCH] vMCE: Implement AMD MSRs Christoph Egger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.