plpks.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (C) 2022 IBM Corporation
  4. * Author: Nayna Jain <[email protected]>
  5. *
  6. * Platform keystore for pseries LPAR(PLPKS).
  7. */
  8. #ifndef _PSERIES_PLPKS_H
  9. #define _PSERIES_PLPKS_H
  10. #include <linux/types.h>
  11. #include <linux/list.h>
  12. #define OSSECBOOTAUDIT 0x40000000
  13. #define OSSECBOOTENFORCE 0x20000000
  14. #define WORLDREADABLE 0x08000000
  15. #define SIGNEDUPDATE 0x01000000
  16. #define PLPKS_VAR_LINUX 0x02
  17. #define PLPKS_VAR_COMMON 0x04
  18. struct plpks_var {
  19. char *component;
  20. u8 *name;
  21. u8 *data;
  22. u32 policy;
  23. u16 namelen;
  24. u16 datalen;
  25. u8 os;
  26. };
  27. struct plpks_var_name {
  28. u8 *name;
  29. u16 namelen;
  30. };
  31. struct plpks_var_name_list {
  32. u32 varcount;
  33. struct plpks_var_name varlist[];
  34. };
  35. /**
  36. * Writes the specified var and its data to PKS.
  37. * Any caller of PKS driver should present a valid component type for
  38. * their variable.
  39. */
  40. int plpks_write_var(struct plpks_var var);
  41. /**
  42. * Removes the specified var and its data from PKS.
  43. */
  44. int plpks_remove_var(char *component, u8 varos,
  45. struct plpks_var_name vname);
  46. /**
  47. * Returns the data for the specified os variable.
  48. */
  49. int plpks_read_os_var(struct plpks_var *var);
  50. /**
  51. * Returns the data for the specified firmware variable.
  52. */
  53. int plpks_read_fw_var(struct plpks_var *var);
  54. /**
  55. * Returns the data for the specified bootloader variable.
  56. */
  57. int plpks_read_bootloader_var(struct plpks_var *var);
  58. #endif