WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] svm: Handle MC4_MISC threshold register f

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] svm: Handle MC4_MISC threshold register for guests
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 04 Jun 2007 03:15:29 -0700
Delivery-date: Mon, 04 Jun 2007 03:16:20 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1180009829 -3600
# Node ID 2623444e6d335c0b5780c01339199a2f69f79092
# Parent  acee9e2c6f8be4f4e89d0f402d05de4970edb24e
svm: Handle MC4_MISC threshold register for guests

The threshold register has been introduced in AMD RevF CPUs along with
SVM (Actually this MCA/MCE msr register existed before, but had no
meaning). Therefore no need for additional cpuid checks.

On read access it reports the HVM guest the register has been locked
by the BIOS. This means, it is not available for OS use. Thus, write
accesses are simply ignored. This behaviour actually matches real HW,
so guests can deal with this.

Signed-off-by: Christoph Egger <Christoph.Egger@xxxxxxx>
---
 xen/arch/x86/hvm/svm/svm.c |   16 ++++++++++++++++
 xen/include/asm-x86/msr.h  |   21 +++++++++++++++++++++
 2 files changed, 37 insertions(+)

diff -r acee9e2c6f8b -r 2623444e6d33 xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c        Thu May 24 11:33:39 2007 +0100
+++ b/xen/arch/x86/hvm/svm/svm.c        Thu May 24 13:30:29 2007 +0100
@@ -177,6 +177,14 @@ static inline int long_mode_do_msr_write
         if ( !svm_paging_enabled(v) )
             vmcb->efer &= ~(EFER_LME | EFER_LMA);
 
+        break;
+
+    case MSR_K8_MC4_MISC: /* Threshold register */
+        /*
+         * MCA/MCE: Threshold register is reported to be locked, so we ignore
+         * all write accesses. This behaviour matches real HW, so guests should
+         * have no problem with this.
+         */
         break;
 
     default:
@@ -2062,6 +2070,14 @@ static inline void svm_do_msr_access(
             msr_content = v->arch.hvm_svm.cpu_shadow_efer;
             break;
 
+        case MSR_K8_MC4_MISC: /* Threshold register */
+            /*
+             * MCA/MCE: We report that the threshold register is unavailable
+             * for OS use (locked by the BIOS).
+             */
+            msr_content = 1ULL << 61; /* MC4_MISC.Locked */
+            break;
+
         default:
             if ( rdmsr_hypervisor_regs(ecx, &eax, &edx) ||
                  rdmsr_safe(ecx, eax, edx) == 0 )
diff -r acee9e2c6f8b -r 2623444e6d33 xen/include/asm-x86/msr.h
--- a/xen/include/asm-x86/msr.h Thu May 24 11:33:39 2007 +0100
+++ b/xen/include/asm-x86/msr.h Thu May 24 13:30:29 2007 +0100
@@ -216,6 +216,27 @@ static inline void write_efer(__u64 val)
 #define MSR_IA32_MC0_STATUS            0x401
 #define MSR_IA32_MC0_ADDR              0x402
 #define MSR_IA32_MC0_MISC              0x403
+
+/* K8 Machine Check MSRs */
+#define MSR_K8_MC1_CTL                 0x404
+#define MSR_K8_MC1_STATUS              0x405
+#define MSR_K8_MC1_ADDR                        0x406
+#define MSR_K8_MC1_MISC                        0x407
+
+#define MSR_K8_MC2_CTL                 0x408
+#define MSR_K8_MC2_STATUS              0x409
+#define MSR_K8_MC2_ADDR                        0x40A
+#define MSR_K8_MC2_MISC                        0x40B
+
+#define MSR_K8_MC3_CTL                 0x40C
+#define MSR_K8_MC3_STATUS              0x40D
+#define MSR_K8_MC3_ADDR                        0x40E
+#define MSR_K8_MC3_MISC                        0x40F
+
+#define MSR_K8_MC4_CTL                 0x410
+#define MSR_K8_MC4_STATUS              0x411
+#define MSR_K8_MC4_ADDR                        0x412
+#define MSR_K8_MC4_MISC                        0x413
 
 /* Pentium IV performance counter MSRs */
 #define MSR_P4_BPU_PERFCTR0            0x300

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] svm: Handle MC4_MISC threshold register for guests, Xen patchbot-unstable <=