From patchwork Wed Nov 28 11:04:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Bader X-Patchwork-Id: 202431 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 8E5A42C008F for ; Wed, 28 Nov 2012 22:04:36 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TdfRF-0007lb-M5; Wed, 28 Nov 2012 11:04:21 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TdfRC-0007lD-8d for kernel-team@lists.ubuntu.com; Wed, 28 Nov 2012 11:04:18 +0000 Received: from p5b2e2057.dip.t-dialin.net ([91.46.32.87] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1TdfRC-0005ll-3U for kernel-team@lists.ubuntu.com; Wed, 28 Nov 2012 11:04:18 +0000 From: Stefan Bader To: kernel-team@lists.ubuntu.com Subject: [Quantal SRU] xen: enable platform-pci only in a Xen guest Date: Wed, 28 Nov 2012 12:04:17 +0100 Message-Id: <1354100657-13063-1-git-send-email-stefan.bader@canonical.com> X-Mailer: git-send-email 1.7.9.5 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com This is a change asked to be included by Citrix. There is a crash if the cpuid bits of a guest are masked in a way that it would not detect the hypervisor being present (so the guest thinks it run on bare-metal). The exact masking is unknown, though. The patch, however, looks like a straight forward change and is upstream as well. -Stefan From 38ad4f4b6cc713b3c42cb4252688ef5c296d7455 Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Tue, 10 Jul 2012 15:31:39 +0200 Subject: [PATCH] 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. Signed-off-by: Olaf Hering Signed-off-by: Konrad Rzeszutek Wilk BugLink: http://bugs.launchpad.net/bugs/1081054 (cherry-picked from commit 38ad4f4b6cc713b3c42cb4252688ef5c296d7455 upstream) Signed-off-by: Stefan Bader Acked-by: Colin Ian King --- drivers/xen/platform-pci.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/xen/platform-pci.c b/drivers/xen/platform-pci.c index 2389e58..97ca359 100644 --- a/drivers/xen/platform-pci.c +++ b/drivers/xen/platform-pci.c @@ -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;