SHA256
1
0
forked from pool/xen
Olaf Hering 2011-08-16 09:17:40 +00:00 committed by Git OBS Bridge
parent 1e7e3e1850
commit d793408b8a
4 changed files with 4 additions and 93 deletions

View File

@ -1,74 +0,0 @@
# HG changeset patch
# User Tim Deegan <Tim.Deegan@citrix.com>
# Date 1313145221 -3600
# Node ID 84e3706df07a1963e23cd3875d8603917657d462
# Parent cb22fa57ff252893b6adb1481e09b1287eacd990
Passthrough: disable bus-mastering on any card that causes an IOMMU fault.
This stops the card from raising back-to-back faults and live-locking
the CPU that handles them.
Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Wei Wang2 <wei.wang2@amd.com>
Acked-by: Allen M Kay <allen.m.kay@intel.com>
Index: xen-4.1.1-testing/xen/drivers/passthrough/amd/iommu_init.c
===================================================================
--- xen-4.1.1-testing.orig/xen/drivers/passthrough/amd/iommu_init.c
+++ xen-4.1.1-testing/xen/drivers/passthrough/amd/iommu_init.c
@@ -462,7 +462,7 @@ static hw_irq_controller iommu_msi_type
static void parse_event_log_entry(u32 entry[])
{
- u16 domain_id, device_id;
+ u16 domain_id, device_id, bdf, cword;
u32 code;
u64 *addr;
char * event_str[] = {"ILLEGAL_DEV_TABLE_ENTRY",
@@ -497,6 +497,18 @@ static void parse_event_log_entry(u32 en
"%s: domain = %d, device id = 0x%04x, "
"fault address = 0x%"PRIx64"\n",
event_str[code-1], domain_id, device_id, *addr);
+
+ /* Tell the device to stop DMAing; we can't rely on the guest to
+ * control it for us. */
+ for ( bdf = 0; bdf < ivrs_bdf_entries; bdf++ )
+ if ( get_dma_requestor_id(bdf) == device_id )
+ {
+ cword = pci_conf_read16(PCI_BUS(bdf), PCI_SLOT(bdf),
+ PCI_FUNC(bdf), PCI_COMMAND);
+ pci_conf_write16(PCI_BUS(bdf), PCI_SLOT(bdf),
+ PCI_FUNC(bdf), PCI_COMMAND,
+ cword & ~PCI_COMMAND_MASTER);
+ }
}
else
{
Index: xen-4.1.1-testing/xen/drivers/passthrough/vtd/iommu.c
===================================================================
--- xen-4.1.1-testing.orig/xen/drivers/passthrough/vtd/iommu.c
+++ xen-4.1.1-testing/xen/drivers/passthrough/vtd/iommu.c
@@ -887,7 +887,7 @@ static void iommu_page_fault(int irq, vo
while (1)
{
u8 fault_reason;
- u16 source_id;
+ u16 source_id, cword;
u32 data;
u64 guest_addr;
int type;
@@ -920,6 +920,14 @@ static void iommu_page_fault(int irq, vo
iommu_page_fault_do_one(iommu, type, fault_reason,
source_id, guest_addr);
+ /* Tell the device to stop DMAing; we can't rely on the guest to
+ * control it for us. */
+ cword = pci_conf_read16(PCI_BUS(source_id), PCI_SLOT(source_id),
+ PCI_FUNC(source_id), PCI_COMMAND);
+ pci_conf_write16(PCI_BUS(source_id), PCI_SLOT(source_id),
+ PCI_FUNC(source_id), PCI_COMMAND,
+ cword & ~PCI_COMMAND_MASTER);
+
fault_index++;
if ( fault_index > cap_num_fault_regs(iommu->cap) )
fault_index = 0;

View File

@ -1,20 +1,8 @@
-------------------------------------------------------------------
Mon Aug 15 12:12:06 CEST 2011 - ohering@suse.de
- bnc#710035 - update xen_pvdrivers.conf to load pv drivers only
when running in a hvm guest
-------------------------------------------------------------------
Mon Aug 15 11:54:08 CEST 2011 - ohering@suse.de
- Include gcc46 only when its available (>11.4 && >sles11sp1)
-------------------------------------------------------------------
Fri Aug 12 10:50:13 MDT 2011 - carnold@novell.com
- bnc#712051 - VUL-1: xen: IOMMU fault livelock
23762-CVE-2011-3131.patch
-------------------------------------------------------------------
Fri Aug 12 09:43:23 MDT 2011 - carnold@novell.com

View File

@ -192,7 +192,6 @@ Patch50: 23735-guest-dom0-cap.patch
Patch51: 23746-vtd-cleanup-timers.patch
Patch52: 23747-mmcfg-base-address.patch
Patch53: 23749-mmcfg-reservation.patch
Patch54: 23762-CVE-2011-3131.patch
# Upstream qemu patches
# Our patches
Patch300: xen-config.diff
@ -734,7 +733,6 @@ tar xfj %{SOURCE2} -C $RPM_BUILD_DIR/%{xen_build_dir}/tools
%patch51 -p1
%patch52 -p1
%patch53 -p1
%patch54 -p1
%patch300 -p1
%patch301 -p1
%patch302 -p1

View File

@ -1,8 +1,7 @@
# Install the paravirtualized drivers before native drivers
# Use module aliases instead of module names
install libata { if test -f /sys/class/dmi/id/product_name -a -f /sys/class/dmi/id/sys_vendor ; then if grep -q "HVM domU" /sys/class/dmi/id/product_name && grep -q "Xen" /sys/class/dmi/id/sys_vendor ; then /sbin/modprobe xen:vbd ; fi ; fi ; } ; /sbin/modprobe --ignore-install libata $CMDLINE_OPTS
# Install the paravirtualized drivers
install libata /sbin/modprobe xen-vbd 2>&1 |:; /sbin/modprobe --ignore-install libata
install 8139cp { if test -f /sys/class/dmi/id/product_name -a -f /sys/class/dmi/id/sys_vendor ; then if grep -q "HVM domU" /sys/class/dmi/id/product_name && grep -q "Xen" /sys/class/dmi/id/sys_vendor ; then /sbin/modprobe xen:vif ; fi ; fi ; } ; /sbin/modprobe --ignore-install 8139cp $CMDLINE_OPTS
install 8139cp /sbin/modprobe xen-vnif 2>&1 |:; /sbin/modprobe --ignore-install 8139cp
install 8139too { if test -f /sys/class/dmi/id/product_name -a -f /sys/class/dmi/id/sys_vendor ; then if grep -q "HVM domU" /sys/class/dmi/id/product_name && grep -q "Xen" /sys/class/dmi/id/sys_vendor ; then /sbin/modprobe xen:vif ; fi ; fi ; } ; /sbin/modprobe --ignore-install 8139too $CMDLINE_OPTS
install 8139too /sbin/modprobe xen-vnif 2>&1 |:; /sbin/modprobe --ignore-install 8139too