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] x86/mca: MCA physical address check when

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86/mca: MCA physical address check when calculate domain
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Sat, 14 May 2011 07:15:32 +0100
Delivery-date: Fri, 13 May 2011 23:15:54 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/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 Liu, Jinsong <jinsong.liu@xxxxxxxxx>
# Date 1305186738 -3600
# Node ID ab93de9a608df7146ceca38f2b6f65a9a5fad1f2
# Parent  0c446850d85e654dfde039a0a1a5acd4e6b3c278
x86/mca: MCA physical address check when calculate domain

Bank addr maybe invalid, or Bank addr maybe physical/memory/linear
address or segment offset.  This patch add mca
MCi_STATUS_MISCV/MCi_STATUS_ADDRV check, and add physical address
verify, so that it work safe when calculate domain.

Signed-off-by: Liu, Jinsong <jinsong.liu@xxxxxxxxx>
---


diff -r 0c446850d85e -r ab93de9a608d xen/arch/x86/cpu/mcheck/mce.c
--- a/xen/arch/x86/cpu/mcheck/mce.c     Wed May 11 12:58:04 2011 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce.c     Thu May 12 08:52:18 2011 +0100
@@ -151,7 +151,6 @@
                                          struct mc_info *mi, int bank)
 {
     struct mcinfo_bank *mib;
-    uint64_t addr=0, misc = 0;
 
     if (!mi)
         return NULL;
@@ -170,22 +169,23 @@
     mib->common.size = sizeof (struct mcinfo_bank);
     mib->mc_bank = bank;
 
-    addr = misc = 0;
     if (mib->mc_status & MCi_STATUS_MISCV)
         mib->mc_misc = mca_rdmsr(MSR_IA32_MCx_MISC(bank));
 
     if (mib->mc_status & MCi_STATUS_ADDRV)
-    {
         mib->mc_addr = mca_rdmsr(MSR_IA32_MCx_ADDR(bank));
 
-        if (mfn_valid(paddr_to_pfn(mib->mc_addr))) {
-            struct domain *d;
+    if ((mib->mc_status & MCi_STATUS_MISCV) &&
+        (mib->mc_status & MCi_STATUS_ADDRV) &&
+        ((mib->mc_misc & MCi_MISC_ADDRMOD_MASK) == MCi_MISC_PHYSMOD) && 
+        (who == MCA_POLLER || who == MCA_CMCI_HANDLER) &&
+        (mfn_valid(paddr_to_pfn(mib->mc_addr))))
+    {
+        struct domain *d;
 
-            d = maddr_get_owner(mib->mc_addr);
-            if (d != NULL && (who == MCA_POLLER ||
-                              who == MCA_CMCI_HANDLER))
-                mib->mc_domid = d->domain_id;
-        }
+        d = maddr_get_owner(mib->mc_addr);
+        if (d)
+            mib->mc_domid = d->domain_id;
     }
 
     if (who == MCA_CMCI_HANDLER) {

_______________________________________________
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] x86/mca: MCA physical address check when calculate domain, Xen patchbot-unstable <=