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] VT-d: avoid faulting in print_iommu_regs(

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] VT-d: avoid faulting in print_iommu_regs()
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 24 Mar 2010 04:30:36 -0700
Delivery-date: Wed, 24 Mar 2010 04:30:49 -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 Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1269428706 0
# Node ID 3c8719d2cb8d8df095f616eacadda3cb7d970a05
# Parent  fcbaa25e227c2685482456499e63fff7a84128ff
VT-d: avoid faulting in print_iommu_regs()

In c/s 21027 I overlooked that using this function when bad table data
was found requires the function to also do some range checking.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
---
 xen/drivers/passthrough/vtd/utils.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff -r fcbaa25e227c -r 3c8719d2cb8d xen/drivers/passthrough/vtd/utils.c
--- a/xen/drivers/passthrough/vtd/utils.c       Wed Mar 24 11:04:05 2010 +0000
+++ b/xen/drivers/passthrough/vtd/utils.c       Wed Mar 24 11:05:06 2010 +0000
@@ -67,10 +67,13 @@ void print_iommu_regs(struct acpi_drhd_u
     printk(" CAP = %"PRIx64"\n", cap = dmar_readq(iommu->reg, DMAR_CAP_REG));
     printk(" n_fault_reg = %"PRIx64"\n", cap_num_fault_regs(cap));
     printk(" fault_recording_offset = %"PRIx64"\n", cap_fault_reg_offset(cap));
-    printk(" fault_recording_reg_l = %"PRIx64"\n",
-           dmar_readq(iommu->reg, cap_fault_reg_offset(cap)));
-    printk(" fault_recording_reg_h = %"PRIx64"\n",
-           dmar_readq(iommu->reg, cap_fault_reg_offset(cap) + 8));
+    if ( cap_fault_reg_offset(cap) < PAGE_SIZE )
+    {
+        printk(" fault_recording_reg_l = %"PRIx64"\n",
+               dmar_readq(iommu->reg, cap_fault_reg_offset(cap)));
+        printk(" fault_recording_reg_h = %"PRIx64"\n",
+               dmar_readq(iommu->reg, cap_fault_reg_offset(cap) + 8));
+    }
     printk(" ECAP = %"PRIx64"\n", dmar_readq(iommu->reg, DMAR_ECAP_REG));
     printk(" GCMD = %x\n", dmar_readl(iommu->reg, DMAR_GCMD_REG));
     printk(" GSTS = %x\n", dmar_readl(iommu->reg, DMAR_GSTS_REG));

_______________________________________________
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] VT-d: avoid faulting in print_iommu_regs(), Xen patchbot-unstable <=