From 5966ce084e4e0c8bb3d532496b287a922e4f19a6 Mon Sep 17 00:00:00 2001 From: Andrew Cooper Date: Sat, 12 Nov 2011 16:14:02 +0000 Subject: [PATCH] Revert c/s 23666:b96f8bdcaa15 KEXEC: disconnect all PCI devices from the PCI bus on crash It turns out that this causes all mannor of problems on certain motherboards (so far with no pattern I can discern) Problems include: * Hanging forever checking hlt instruction. * Panics when trying to change switch root device * Drivers hanging when trying to check for interrupts. From: Andrew Cooper Signed-off-by: Keir Fraser Committed-by: Keir Fraser xen-unstable changeset: 24137:0844b17df7a9 xen-unstable date: Fri Nov 11 18:14:35 2011 +0000 --- xen/arch/x86/crash.c | 3 --- xen/drivers/passthrough/pci.c | 19 ------------------- xen/include/xen/pci.h | 2 -- 3 files changed, 24 deletions(-) diff --git a/xen/arch/x86/crash.c b/xen/arch/x86/crash.c index 2636950dbc..68174b51fa 100644 --- a/xen/arch/x86/crash.c +++ b/xen/arch/x86/crash.c @@ -28,7 +28,6 @@ #include #include #include -#include #include static atomic_t waiting_for_crash_ipi; @@ -83,8 +82,6 @@ static void nmi_shootdown_cpus(void) msecs--; } - disconnect_pci_devices(); - /* Crash shutdown any IOMMU functionality as the crashdump kernel is not * happy when booting if interrupt/dma remapping is still enabled */ iommu_crash_shutdown(); diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c index 5b144190cd..9f902ab03b 100644 --- a/xen/drivers/passthrough/pci.c +++ b/xen/drivers/passthrough/pci.c @@ -499,25 +499,6 @@ int __init scan_pci_devices(void) return 0; } -/* Disconnect all PCI devices from the PCI buses. From the PCI spec: - * "When a 0 is written to [the COMMAND] register, the device is - * logically disconnected from the PCI bus for all accesses except - * configuration accesses. All devices are required to support - * this base level of functionality." - */ -void disconnect_pci_devices(void) -{ - struct pci_dev *pdev; - - spin_lock(&pcidevs_lock); - - list_for_each_entry ( pdev, &alldevs_list, alldevs_list ) - pci_conf_write16(pdev->bus, PCI_SLOT(pdev->devfn), - PCI_FUNC(pdev->devfn), PCI_COMMAND, 0); - - spin_unlock(&pcidevs_lock); -} - #ifdef SUPPORT_MSI_REMAPPING static void dump_pci_devices(unsigned char ch) { diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h index 0c6ea7e4a4..2bfe609649 100644 --- a/xen/include/xen/pci.h +++ b/xen/include/xen/pci.h @@ -94,8 +94,6 @@ int pci_remove_device(u8 bus, u8 devfn); struct pci_dev *pci_get_pdev(int bus, int devfn); struct pci_dev *pci_get_pdev_by_domain(struct domain *d, int bus, int devfn); -void disconnect_pci_devices(void); - uint8_t pci_conf_read8( unsigned int bus, unsigned int dev, unsigned int func, unsigned int reg); uint16_t pci_conf_read16(