• Jens Wiklander's avatar
    optee: add asynchronous notifications · 6749e69c
    Jens Wiklander authored
    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: default avatarSumit Garg <sumit.garg@linaro.org>
    Acked-by: default avatarArd Biesheuvel <ardb@kernel.org>
    Signed-off-by: default avatarJens Wiklander <jens.wiklander@linaro.org>
    6749e69c
optee_msg.h 11.6 KB