summaryrefslogtreecommitdiff
path: root/arch/powerpc/platforms/powernv/ultravisor.c
diff options
context:
space:
mode:
authorClaudio Carvalho <cclaudio@linux.ibm.com>2019-08-22 06:48:34 +0300
committerMichael Ellerman <mpe@ellerman.id.au>2019-08-30 02:40:15 +0300
commitbb04ffe85eebebd64d5e673a9434d968e80f3aa1 (patch)
treef0375d18e4466a0af554ed7a62db72b7cd3c2226 /arch/powerpc/platforms/powernv/ultravisor.c
parenta49dddbdb0cca1d00fc9251e543a0aac09a6a65b (diff)
downloadlinux-bb04ffe85eebebd64d5e673a9434d968e80f3aa1.tar.xz
powerpc/powernv: Introduce FW_FEATURE_ULTRAVISOR
In PEF enabled systems, some of the resources which were previously hypervisor privileged are now ultravisor privileged and controlled by the ultravisor firmware. This adds FW_FEATURE_ULTRAVISOR to indicate if PEF is enabled. The host kernel can use FW_FEATURE_ULTRAVISOR, for instance, to skip accessing resources (e.g. PTCR and LDBAR) in case PEF is enabled. Signed-off-by: Claudio Carvalho <cclaudio@linux.ibm.com> [ andmike: Device node name to "ibm,ultravisor" ] Signed-off-by: Michael Anderson <andmike@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20190822034838.27876-4-cclaudio@linux.ibm.com
Diffstat (limited to 'arch/powerpc/platforms/powernv/ultravisor.c')
-rw-r--r--arch/powerpc/platforms/powernv/ultravisor.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/powernv/ultravisor.c b/arch/powerpc/platforms/powernv/ultravisor.c
new file mode 100644
index 000000000000..02ac57b4bded
--- /dev/null
+++ b/arch/powerpc/platforms/powernv/ultravisor.c
@@ -0,0 +1,24 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Ultravisor high level interfaces
+ *
+ * Copyright 2019, IBM Corporation.
+ *
+ */
+#include <linux/init.h>
+#include <linux/printk.h>
+#include <linux/of_fdt.h>
+
+#include <asm/ultravisor.h>
+#include <asm/firmware.h>
+
+int __init early_init_dt_scan_ultravisor(unsigned long node, const char *uname,
+ int depth, void *data)
+{
+ if (!of_flat_dt_is_compatible(node, "ibm,ultravisor"))
+ return 0;
+
+ powerpc_firmware_features |= FW_FEATURE_ULTRAVISOR;
+ pr_debug("Ultravisor detected!\n");
+ return 1;
+}