Skip to content

Commit a0c01e4

Browse files
jan-kiszkaKAGA-KOKO
authored andcommitted
x86/jailhouse: Initialize PCI support
With this change, PCI devices can be detected and used inside a non-root cell. Signed-off-by: Jan Kiszka <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/e8d19494b96b68a749bcac514795d864ad9c28c3.1511770314.git.jan.kiszka@siemens.com
1 parent cf878e1 commit a0c01e4

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

arch/x86/kernel/jailhouse.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <asm/hypervisor.h>
1717
#include <asm/i8259.h>
1818
#include <asm/irqdomain.h>
19+
#include <asm/pci_x86.h>
1920
#include <asm/reboot.h>
2021
#include <asm/setup.h>
2122

@@ -106,6 +107,19 @@ static void jailhouse_no_restart(void)
106107
machine_halt();
107108
}
108109

110+
static int __init jailhouse_pci_arch_init(void)
111+
{
112+
pci_direct_init(1);
113+
114+
/*
115+
* There are no bridges on the virtual PCI root bus under Jailhouse,
116+
* thus no other way to discover all devices than a full scan.
117+
*/
118+
pcibios_last_bus = 0xff;
119+
120+
return 0;
121+
}
122+
109123
static void __init jailhouse_init_platform(void)
110124
{
111125
u64 pa_data = boot_params.hdr.setup_data;
@@ -115,6 +129,7 @@ static void __init jailhouse_init_platform(void)
115129
x86_init.irqs.pre_vector_init = x86_init_noop;
116130
x86_init.timers.timer_init = jailhouse_timer_init;
117131
x86_init.mpparse.get_smp_config = jailhouse_get_smp_config;
132+
x86_init.pci.arch_init = jailhouse_pci_arch_init;
118133

119134
x86_platform.calibrate_cpu = jailhouse_get_tsc;
120135
x86_platform.calibrate_tsc = jailhouse_get_tsc;
@@ -157,6 +172,8 @@ static void __init jailhouse_init_platform(void)
157172

158173
precalibrated_tsc_khz = setup_data.tsc_khz;
159174

175+
pci_probe = 0;
176+
160177
/*
161178
* Avoid that the kernel complains about missing ACPI tables - there
162179
* are none in a non-root cell.

0 commit comments

Comments
 (0)