summaryrefslogtreecommitdiff
path: root/arch/powerpc/kernel/secvar-ops.c
diff options
context:
space:
mode:
authorNayna Jain <nayna@linux.ibm.com>2019-11-10 21:10:33 -0600
committerMichael Ellerman <mpe@ellerman.id.au>2019-11-13 00:33:22 +1100
commit9155e2341aa8b5df057dc1c77633b33d1a4f17d2 (patch)
tree294435e811fa6529203d26b553e4c50fd12dc41a /arch/powerpc/kernel/secvar-ops.c
parent39a963b457b5c6cbbdc70441c9d496e39d151582 (diff)
powerpc/powernv: Add OPAL API interface to access secure variable
The X.509 certificates trusted by the platform and required to secure boot the OS kernel are wrapped in secure variables, which are controlled by OPAL. This patch adds firmware/kernel interface to read and write OPAL secure variables based on the unique key. This support can be enabled using CONFIG_OPAL_SECVAR. Signed-off-by: Claudio Carvalho <cclaudio@linux.ibm.com> Signed-off-by: Nayna Jain <nayna@linux.ibm.com> Signed-off-by: Eric Richter <erichte@linux.ibm.com> [mpe: Make secvar_ops __ro_after_init, only build opal-secvar.c if PPC_SECURE_BOOT=y] Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/1573441836-3632-2-git-send-email-nayna@linux.ibm.com
Diffstat (limited to 'arch/powerpc/kernel/secvar-ops.c')
-rw-r--r--arch/powerpc/kernel/secvar-ops.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/secvar-ops.c b/arch/powerpc/kernel/secvar-ops.c
new file mode 100644
index 000000000000..6a29777d6a2d
--- /dev/null
+++ b/arch/powerpc/kernel/secvar-ops.c
@@ -0,0 +1,17 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2019 IBM Corporation
+ * Author: Nayna Jain
+ *
+ * This file initializes secvar operations for PowerPC Secureboot
+ */
+
+#include <linux/cache.h>
+#include <asm/secvar.h>
+
+const struct secvar_operations *secvar_ops __ro_after_init;
+
+void set_secvar_ops(const struct secvar_operations *ops)
+{
+ secvar_ops = ops;
+}