Skip to content

Commit 382d72a

Browse files
committed
Merge branch 'x86-hyperv-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 hyperv updates from Ingo Molnar: "Two small changes: a boot warning removal and a minor cleanup" * 'x86-hyperv-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/hyperv: Remove unused include x86/hyperv: Suppress "PCI: Fatal: No config space access function found"
2 parents ac73e08 + 5140a6f commit 382d72a

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

arch/x86/hyperv/hv_apic.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
*/
2121

2222
#include <linux/types.h>
23-
#include <linux/version.h>
2423
#include <linux/vmalloc.h>
2524
#include <linux/mm.h>
2625
#include <linux/clockchips.h>

arch/x86/hyperv/hv_init.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
*
1818
*/
1919

20+
#include <linux/efi.h>
2021
#include <linux/types.h>
2122
#include <asm/apic.h>
2223
#include <asm/desc.h>
@@ -253,6 +254,22 @@ static int hv_cpu_die(unsigned int cpu)
253254
return 0;
254255
}
255256

257+
static int __init hv_pci_init(void)
258+
{
259+
int gen2vm = efi_enabled(EFI_BOOT);
260+
261+
/*
262+
* For Generation-2 VM, we exit from pci_arch_init() by returning 0.
263+
* The purpose is to suppress the harmless warning:
264+
* "PCI: Fatal: No config space access function found"
265+
*/
266+
if (gen2vm)
267+
return 0;
268+
269+
/* For Generation-1 VM, we'll proceed in pci_arch_init(). */
270+
return 1;
271+
}
272+
256273
/*
257274
* This function is to be invoked early in the boot sequence after the
258275
* hypervisor has been detected.
@@ -329,6 +346,8 @@ void __init hyperv_init(void)
329346

330347
hv_apic_init();
331348

349+
x86_init.pci.arch_init = hv_pci_init;
350+
332351
/*
333352
* Register Hyper-V specific clocksource.
334353
*/

0 commit comments

Comments
 (0)