Skip to contentSkip to conversation

xen: enable platform-pci only in a Xen guest

PATCH New Olaf Hering 1 participant 1 message Jul 10, 2012 Xen hypervisor interface

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen: enable platform-pci only in a Xen guest

While debugging kexec issues in a PVonHVM guest I modified xen_hvm_platform() to return false to disable all PV drivers. This caused a crash in platform_pci_init() because it expects certain data structures to be initialized properly.

To avoid such a crash make sure the driver is initialized only if running in a Xen guest.

---
 drivers/xen/platform-pci.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/xen/platform-pci.c +3 -0
index 2389e58..97ca359 100644
@@ -109,6 +109,9 @@ static int __devinit platform_pci_init(struct pci_dev *pdev,
 	long mmio_addr, mmio_len;
 	unsigned int max_nr_gframes;
 
+	if (!xen_domain())
+		return -ENODEV;
+
 	i = pci_enable_device(pdev);
 	if (i)
 		return i;
Signature · 1 line
1.7.3.4