OSDN Git Service

optee: add asynchronous notifications
authorJens Wiklander <jens.wiklander@linaro.org>
Tue, 15 Jun 2021 20:23:54 +0000 (22:23 +0200)
committerJens Wiklander <jens.wiklander@linaro.org>
Wed, 17 Nov 2021 13:08:57 +0000 (14:08 +0100)
commit6749e69c4dadd352bdfdb306513aa48cc15fbdd6
treeeb89ef076b0ec295b78866d6f7f7225e7df1007d
parent787c80cc7b22804aa370f04a19f9fe0fa98b1e49
optee: add asynchronous notifications

Adds support for asynchronous notifications from secure world to normal
world. This allows a design with a top half and bottom half type of
driver where the top half runs in secure interrupt context and a
notifications tells normal world to schedule a yielding call to do the
bottom half processing.

The protocol is defined in optee_msg.h optee_rpc_cmd.h and optee_smc.h.

A notification consists of a 32-bit value which normal world can
retrieve using a fastcall into secure world. The value
OPTEE_SMC_ASYNC_NOTIF_VALUE_DO_BOTTOM_HALF (0) has a special meaning.
When this value is sent it means that normal world is supposed to make a
yielding call OPTEE_MSG_CMD_DO_BOTTOM_HALF.

Notification capability is negotiated while the driver is initialized.
If both sides supports these notifications then they are enabled.

An interrupt is used to notify the driver that there are asynchronous
notifications pending. The maximum needed notification value is
communicated at this stage. This allows scaling up when needed.

Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
drivers/tee/optee/optee_msg.h
drivers/tee/optee/optee_private.h
drivers/tee/optee/optee_smc.h
drivers/tee/optee/smc_abi.c