diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2018-03-07 02:39:12 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2018-03-08 06:30:37 -0500 |
commit | 63338a38db955cb4e0352c11b78732157c78d30b (patch) | |
tree | e8cdd67b1ca569a67cb63908f586bba6caff8336 | |
parent | 0a5169add90e43ab45ab1ba34223b8583fcaf675 (diff) |
jailhouse: Provide detection for non-x86 systems
Implement jailhouse_paravirt() via device tree probing on architectures
!= x86. Will be used by the PCI core.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Juergen Gross <jgross@suse.com>
Cc: jailhouse-dev@googlegroups.com
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: linux-pci@vger.kernel.org
Cc: virtualization@lists.linux-foundation.org
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Link: https://lkml.kernel.org/r/dae9fe0c6e63141c28ca90492fa5712b4c33ffb5.1520408357.git.jan.kiszka@siemens.com
-rw-r--r-- | Documentation/devicetree/bindings/jailhouse.txt | 8 | ||||
-rw-r--r-- | arch/x86/include/asm/jailhouse_para.h | 2 | ||||
-rw-r--r-- | include/linux/hypervisor.h | 17 |
3 files changed, 24 insertions, 3 deletions
diff --git a/Documentation/devicetree/bindings/jailhouse.txt b/Documentation/devicetree/bindings/jailhouse.txt new file mode 100644 index 000000000000..2901c25ff340 --- /dev/null +++ b/Documentation/devicetree/bindings/jailhouse.txt | |||
@@ -0,0 +1,8 @@ | |||
1 | Jailhouse non-root cell device tree bindings | ||
2 | -------------------------------------------- | ||
3 | |||
4 | When running in a non-root Jailhouse cell (partition), the device tree of this | ||
5 | platform shall have a top-level "hypervisor" node with the following | ||
6 | properties: | ||
7 | |||
8 | - compatible = "jailhouse,cell" | ||
diff --git a/arch/x86/include/asm/jailhouse_para.h b/arch/x86/include/asm/jailhouse_para.h index 875b54376689..b885a961a150 100644 --- a/arch/x86/include/asm/jailhouse_para.h +++ b/arch/x86/include/asm/jailhouse_para.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* SPDX-License-Identifier: GPL2.0 */ | 1 | /* SPDX-License-Identifier: GPL2.0 */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Jailhouse paravirt_ops implementation | 4 | * Jailhouse paravirt detection |
5 | * | 5 | * |
6 | * Copyright (c) Siemens AG, 2015-2017 | 6 | * Copyright (c) Siemens AG, 2015-2017 |
7 | * | 7 | * |
diff --git a/include/linux/hypervisor.h b/include/linux/hypervisor.h index b19563f9a8eb..fc08b433c856 100644 --- a/include/linux/hypervisor.h +++ b/include/linux/hypervisor.h | |||
@@ -8,15 +8,28 @@ | |||
8 | */ | 8 | */ |
9 | 9 | ||
10 | #ifdef CONFIG_X86 | 10 | #ifdef CONFIG_X86 |
11 | |||
12 | #include <asm/jailhouse_para.h> | ||
11 | #include <asm/x86_init.h> | 13 | #include <asm/x86_init.h> |
14 | |||
12 | static inline void hypervisor_pin_vcpu(int cpu) | 15 | static inline void hypervisor_pin_vcpu(int cpu) |
13 | { | 16 | { |
14 | x86_platform.hyper.pin_vcpu(cpu); | 17 | x86_platform.hyper.pin_vcpu(cpu); |
15 | } | 18 | } |
16 | #else | 19 | |
20 | #else /* !CONFIG_X86 */ | ||
21 | |||
22 | #include <linux/of.h> | ||
23 | |||
17 | static inline void hypervisor_pin_vcpu(int cpu) | 24 | static inline void hypervisor_pin_vcpu(int cpu) |
18 | { | 25 | { |
19 | } | 26 | } |
20 | #endif | 27 | |
28 | static inline bool jailhouse_paravirt(void) | ||
29 | { | ||
30 | return of_find_compatible_node(NULL, NULL, "jailhouse,cell"); | ||
31 | } | ||
32 | |||
33 | #endif /* !CONFIG_X86 */ | ||
21 | 34 | ||
22 | #endif /* __LINUX_HYPEVISOR_H */ | 35 | #endif /* __LINUX_HYPEVISOR_H */ |