linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/3] introduce tee-based EFI Runtime Variable Service
@ 2023-05-26  1:07 Masahisa Kojima
  2023-05-26  1:07 ` [PATCH v5 1/3] efi: expose efivar generic ops register function Masahisa Kojima
                   ` (3 more replies)
  0 siblings, 4 replies; 34+ messages in thread
From: Masahisa Kojima @ 2023-05-26  1:07 UTC (permalink / raw)
  To: Ard Biesheuvel, Jens Wiklander, Sumit Garg, linux-kernel, op-tee
  Cc: Ilias Apalodimas, Johan Hovold, Masahisa Kojima

This series introduces the tee based EFI Runtime Variable Service.

The eMMC device is typically owned by the non-secure world(linux in
this case). There is an existing solution utilizing eMMC RPMB partition
for EFI Variables, it is implemented by interacting with
OP-TEE, StandaloneMM(as EFI Variable Service Pseudo TA), eMMC driver
and tee-supplicant. The last piece is the tee-based variable access
driver to interact with OP-TEE and StandaloneMM.

Changelog:
v4 -> v5
- rebase to efi-next based on v6.4-rc1
- set generic_ops.query_variable_info, it works as expected as follows.
$ df -h /sys/firmware/efi/efivars/
Filesystem      Size  Used Avail Use% Mounted on
efivarfs         16K  1.3K   15K   8% /sys/firmware/efi/efivars

v3 -> v4:
- replace the reference from EDK2 to PI Specification
- remove EDK2 source code reference comments
- prepare nonblocking variant of set_variable, it just returns
  EFI_UNSUPPORTED
- remove redundant buffer size check
- argument name change in mm_communicate
- function interface changes in setup_mm_hdr to remove (void **) cast

v2 -> v3:
- add CONFIG_EFI dependency to TEE_STMM_EFI
- add missing return code check for tee_client_invoke_func()
- directly call efivars_register/unregister from tee_stmm_efi.c

rfc v1 -> v2:
- split patch into three patches, one for drivers/tee,
  one for include/linux/efi.h, and one for the driver/firmware/efi/stmm
- context/session management into probe() and remove() same as other tee
client driver
- StMM variable driver is moved from driver/tee/optee to driver/firmware/efi
- use "tee" prefix instead of "optee" in driver/firmware/efi/stmm/tee_stmm_efi.c,
  this file does not contain op-tee specific code, abstracted by tee layer and
  StMM variable driver will work on other tee implementation.
- PTA_STMM_CMD_COMMUNICATE -> PTA_STMM_CMD_COMMUNICATE
- implement query_variable_store() but currently not used
- no use of TEEC_SUCCESS, it is defined in driver/tee/optee/optee_private.h.
  Other tee client drivers use 0 instead of using TEEC_SUCCESS
- remove TEEC_ERROR_EXCESS_DATA status, it is referred just to output
error message

Masahisa Kojima (3):
  efi: expose efivar generic ops register function
  efi: Add EFI_ACCESS_DENIED status code
  efi: Add tee-based EFI variable driver

 drivers/firmware/efi/Kconfig                 |  15 +
 drivers/firmware/efi/Makefile                |   1 +
 drivers/firmware/efi/efi.c                   |  12 +
 drivers/firmware/efi/stmm/mm_communication.h | 236 +++++++
 drivers/firmware/efi/stmm/tee_stmm_efi.c     | 638 +++++++++++++++++++
 include/linux/efi.h                          |   4 +
 6 files changed, 906 insertions(+)
 create mode 100644 drivers/firmware/efi/stmm/mm_communication.h
 create mode 100644 drivers/firmware/efi/stmm/tee_stmm_efi.c

-- 
2.30.2


^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2023-06-09  8:03 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-26  1:07 [PATCH v5 0/3] introduce tee-based EFI Runtime Variable Service Masahisa Kojima
2023-05-26  1:07 ` [PATCH v5 1/3] efi: expose efivar generic ops register function Masahisa Kojima
2023-05-26  1:07 ` [PATCH v5 2/3] efi: Add EFI_ACCESS_DENIED status code Masahisa Kojima
2023-05-26  1:07 ` [PATCH v5 3/3] efi: Add tee-based EFI variable driver Masahisa Kojima
2023-06-06  6:39   ` Jan Kiszka
2023-06-06  6:51     ` Sumit Garg
2023-06-06  6:57       ` Ard Biesheuvel
2023-06-06  7:51         ` Sumit Garg
2023-06-06  7:52         ` Jan Kiszka
2023-06-07  6:34           ` Ilias Apalodimas
2023-06-07  6:35             ` Ilias Apalodimas
2023-06-07  7:25             ` Sumit Garg
2023-06-07  8:25               ` Ilias Apalodimas
2023-06-07 12:40                 ` Jan Kiszka
2023-06-07 15:18                   ` Sumit Garg
2023-06-07 16:04                     ` Jan Kiszka
2023-06-07 16:09                       ` Ilias Apalodimas
2023-06-07 16:59                         ` Ilias Apalodimas
2023-06-07 17:14                           ` Jan Kiszka
2023-06-07 18:17                             ` Ilias Apalodimas
2023-06-07 19:46                               ` Jan Kiszka
2023-06-08  6:21                                 ` Ilias Apalodimas
2023-06-08 13:52                                   ` Ard Biesheuvel
2023-06-08 19:38                                     ` Ilias Apalodimas
2023-06-09  6:18                                       ` Jan Kiszka
2023-06-09  6:34                                         ` Ilias Apalodimas
2023-06-09  6:40                                           ` Jan Kiszka
2023-06-09  8:00                                             ` Ilias Apalodimas
2023-06-09  6:16                                     ` Jan Kiszka
2023-06-09  6:22                                       ` Ilias Apalodimas
2023-06-09  6:36                                         ` Jan Kiszka
2023-05-26 13:09 ` [PATCH v5 0/3] introduce tee-based EFI Runtime Variable Service Ard Biesheuvel
2023-05-29  9:05   ` Jens Wiklander
2023-05-29 13:29     ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).