[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191110024541.31567-85-sashal@kernel.org>
Date: Sat, 9 Nov 2019 21:45:17 -0500
From: Sasha Levin <sashal@...nel.org>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
Cc: Dexuan Cui <decui@...rosoft.com>,
Thomas Gleixner <tglx@...utronix.de>,
Michael Kelley <mikelley@...rosoft.com>,
"H. Peter Anvin" <hpa@...or.com>,
KY Srinivasan <kys@...rosoft.com>,
Haiyang Zhang <haiyangz@...rosoft.com>,
Stephen Hemminger <sthemmin@...rosoft.com>,
"devel@...uxdriverproject.org" <devel@...uxdriverproject.org>,
Olaf Aepfle <olaf@...fle.de>,
Andy Whitcroft <apw@...onical.com>,
Jason Wang <jasowang@...hat.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Marcelo Cerri <marcelo.cerri@...onical.com>,
Josh Poulson <jopoulso@...rosoft.com>,
Sasha Levin <sashal@...nel.org>, linux-hyperv@...r.kernel.org
Subject: [PATCH AUTOSEL 4.14 085/109] x86/hyperv: Suppress "PCI: Fatal: No config space access function found"
From: Dexuan Cui <decui@...rosoft.com>
[ Upstream commit 2f285f46240d67060061d153786740d4df53cd78 ]
A Generation-2 Linux VM on Hyper-V doesn't have the legacy PCI bus, and
users always see the scary warning, which is actually harmless.
Suppress it.
Signed-off-by: Dexuan Cui <decui@...rosoft.com>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Reviewed-by: Michael Kelley <mikelley@...rosoft.com>
Cc: "H. Peter Anvin" <hpa@...or.com>
Cc: KY Srinivasan <kys@...rosoft.com>
Cc: Haiyang Zhang <haiyangz@...rosoft.com>
Cc: Stephen Hemminger <sthemmin@...rosoft.com>
Cc: "devel@...uxdriverproject.org" <devel@...uxdriverproject.org>
Cc: Olaf Aepfle <olaf@...fle.de>
Cc: Andy Whitcroft <apw@...onical.com>
Cc: Jason Wang <jasowang@...hat.com>
Cc: Vitaly Kuznetsov <vkuznets@...hat.com>
Cc: Marcelo Cerri <marcelo.cerri@...onical.com>
Cc: Josh Poulson <jopoulso@...rosoft.com>
Link: https://lkml.kernel.org/r/ <KU1P153MB0166D977DC930996C4BF538ABF1D0@...P153MB0166.APCP153.PROD.OUTLOOK.COM
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
arch/x86/hyperv/hv_init.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c
index 2e9d58cc371e6..2653b7b25d176 100644
--- a/arch/x86/hyperv/hv_init.c
+++ b/arch/x86/hyperv/hv_init.c
@@ -17,6 +17,7 @@
*
*/
+#include <linux/efi.h>
#include <linux/types.h>
#include <asm/hypervisor.h>
#include <asm/hyperv.h>
@@ -101,6 +102,22 @@ static int hv_cpu_init(unsigned int cpu)
return 0;
}
+static int __init hv_pci_init(void)
+{
+ int gen2vm = efi_enabled(EFI_BOOT);
+
+ /*
+ * For Generation-2 VM, we exit from pci_arch_init() by returning 0.
+ * The purpose is to suppress the harmless warning:
+ * "PCI: Fatal: No config space access function found"
+ */
+ if (gen2vm)
+ return 0;
+
+ /* For Generation-1 VM, we'll proceed in pci_arch_init(). */
+ return 1;
+}
+
/*
* This function is to be invoked early in the boot sequence after the
* hypervisor has been detected.
@@ -154,6 +171,8 @@ void hyperv_init(void)
hyper_alloc_mmu();
+ x86_init.pci.arch_init = hv_pci_init;
+
/*
* Register Hyper-V specific clocksource.
*/
--
2.20.1
Powered by blists - more mailing lists