powerpc/powernv: Add OPAL API interface to access secure variable
authorNayna Jain <nayna@linux.ibm.com>
Mon, 11 Nov 2019 03:10:33 +0000 (21:10 -0600)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 12 Nov 2019 13:33:22 +0000 (00:33 +1100)
commit9155e2341aa8b5df057dc1c77633b33d1a4f17d2
tree294435e811fa6529203d26b553e4c50fd12dc41a
parent39a963b457b5c6cbbdc70441c9d496e39d151582
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
arch/powerpc/include/asm/opal-api.h
arch/powerpc/include/asm/opal.h
arch/powerpc/include/asm/secvar.h [new file with mode: 0644]
arch/powerpc/kernel/Makefile
arch/powerpc/kernel/secvar-ops.c [new file with mode: 0644]
arch/powerpc/platforms/powernv/Makefile
arch/powerpc/platforms/powernv/opal-call.c
arch/powerpc/platforms/powernv/opal-secvar.c [new file with mode: 0644]
arch/powerpc/platforms/powernv/opal.c