mirror_ubuntu-kernels/arch/powerpc/platforms/pseries/plpks.h
Nayna Jain 2454a7af0f powerpc/pseries: define driver for Platform KeyStore
PowerVM provides an isolated Platform Keystore(PKS) storage allocation
for each LPAR with individually managed access controls to store
sensitive information securely. It provides a new set of hypervisor
calls for Linux kernel to access PKS storage.

Define POWER LPAR Platform KeyStore(PLPKS) driver using H_CALL interface
to access PKS storage.

Signed-off-by: Nayna Jain <nayna@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220723113048.521744-2-nayna@linux.ibm.com
2022-07-28 16:22:13 +10:00

72 lines
1.4 KiB
C

/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (C) 2022 IBM Corporation
* Author: Nayna Jain <nayna@linux.ibm.com>
*
* Platform keystore for pseries LPAR(PLPKS).
*/
#ifndef _PSERIES_PLPKS_H
#define _PSERIES_PLPKS_H
#include <linux/types.h>
#include <linux/list.h>
#define OSSECBOOTAUDIT 0x40000000
#define OSSECBOOTENFORCE 0x20000000
#define WORLDREADABLE 0x08000000
#define SIGNEDUPDATE 0x01000000
#define PLPKS_VAR_LINUX 0x01
#define PLPKS_VAR_COMMON 0x04
struct plpks_var {
char *component;
u8 *name;
u8 *data;
u32 policy;
u16 namelen;
u16 datalen;
u8 os;
};
struct plpks_var_name {
u8 *name;
u16 namelen;
};
struct plpks_var_name_list {
u32 varcount;
struct plpks_var_name varlist[];
};
/**
* Writes the specified var and its data to PKS.
* Any caller of PKS driver should present a valid component type for
* their variable.
*/
int plpks_write_var(struct plpks_var var);
/**
* Removes the specified var and its data from PKS.
*/
int plpks_remove_var(char *component, u8 varos,
struct plpks_var_name vname);
/**
* Returns the data for the specified os variable.
*/
int plpks_read_os_var(struct plpks_var *var);
/**
* Returns the data for the specified firmware variable.
*/
int plpks_read_fw_var(struct plpks_var *var);
/**
* Returns the data for the specified bootloader variable.
*/
int plpks_read_bootloader_var(struct plpks_var *var);
#endif