Skip to content

Commit

Permalink
xen: enable platform-pci only in a Xen guest
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
  • Loading branch information
Olaf Hering authored and Konrad Rzeszutek Wilk committed Jul 19, 2012
1 parent 254d1a3 commit 38ad4f4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/xen/platform-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 38ad4f4

Please sign in to comment.