]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
jailhouse: Provide detection for non-x86 systems
authorJan Kiszka <jan.kiszka@siemens.com>
Wed, 7 Mar 2018 07:39:12 +0000 (08:39 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 8 Mar 2018 11:30:37 +0000 (12:30 +0100)
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
Documentation/devicetree/bindings/jailhouse.txt [new file with mode: 0644]
arch/x86/include/asm/jailhouse_para.h
include/linux/hypervisor.h

diff --git a/Documentation/devicetree/bindings/jailhouse.txt b/Documentation/devicetree/bindings/jailhouse.txt
new file mode 100644 (file)
index 0000000..2901c25
--- /dev/null
@@ -0,0 +1,8 @@
+Jailhouse non-root cell device tree bindings
+--------------------------------------------
+
+When running in a non-root Jailhouse cell (partition), the device tree of this
+platform shall have a top-level "hypervisor" node with the following
+properties:
+
+- compatible = "jailhouse,cell"
index 875b543766892e7686512e864a6ee4e95e04dea3..b885a961a150f079e38d4e5dbb8670ef9fde0b57 100644 (file)
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL2.0 */
 
 /*
- * Jailhouse paravirt_ops implementation
+ * Jailhouse paravirt detection
  *
  * Copyright (c) Siemens AG, 2015-2017
  *
index b19563f9a8ebb9c58e115b79fecde5a0167ba0e0..fc08b433c856d38cb374398da7078e305fc85564 100644 (file)
@@ -8,15 +8,28 @@
  */
 
 #ifdef CONFIG_X86
+
+#include <asm/jailhouse_para.h>
 #include <asm/x86_init.h>
+
 static inline void hypervisor_pin_vcpu(int cpu)
 {
        x86_platform.hyper.pin_vcpu(cpu);
 }
-#else
+
+#else /* !CONFIG_X86 */
+
+#include <linux/of.h>
+
 static inline void hypervisor_pin_vcpu(int cpu)
 {
 }
-#endif
+
+static inline bool jailhouse_paravirt(void)
+{
+       return of_find_compatible_node(NULL, NULL, "jailhouse,cell");
+}
+
+#endif /* !CONFIG_X86 */
 
 #endif /* __LINUX_HYPEVISOR_H */