Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * Copyright (C) 2022 IBM Corporation
0004  * Author: Nayna Jain <nayna@linux.ibm.com>
0005  *
0006  * Platform keystore for pseries LPAR(PLPKS).
0007  */
0008 
0009 #ifndef _PSERIES_PLPKS_H
0010 #define _PSERIES_PLPKS_H
0011 
0012 #include <linux/types.h>
0013 #include <linux/list.h>
0014 
0015 #define OSSECBOOTAUDIT 0x40000000
0016 #define OSSECBOOTENFORCE 0x20000000
0017 #define WORLDREADABLE 0x08000000
0018 #define SIGNEDUPDATE 0x01000000
0019 
0020 #define PLPKS_VAR_LINUX 0x01
0021 #define PLPKS_VAR_COMMON    0x04
0022 
0023 struct plpks_var {
0024     char *component;
0025     u8 *name;
0026     u8 *data;
0027     u32 policy;
0028     u16 namelen;
0029     u16 datalen;
0030     u8 os;
0031 };
0032 
0033 struct plpks_var_name {
0034     u8  *name;
0035     u16 namelen;
0036 };
0037 
0038 struct plpks_var_name_list {
0039     u32 varcount;
0040     struct plpks_var_name varlist[];
0041 };
0042 
0043 /**
0044  * Writes the specified var and its data to PKS.
0045  * Any caller of PKS driver should present a valid component type for
0046  * their variable.
0047  */
0048 int plpks_write_var(struct plpks_var var);
0049 
0050 /**
0051  * Removes the specified var and its data from PKS.
0052  */
0053 int plpks_remove_var(char *component, u8 varos,
0054              struct plpks_var_name vname);
0055 
0056 /**
0057  * Returns the data for the specified os variable.
0058  */
0059 int plpks_read_os_var(struct plpks_var *var);
0060 
0061 /**
0062  * Returns the data for the specified firmware variable.
0063  */
0064 int plpks_read_fw_var(struct plpks_var *var);
0065 
0066 /**
0067  * Returns the data for the specified bootloader variable.
0068  */
0069 int plpks_read_bootloader_var(struct plpks_var *var);
0070 
0071 #endif