From 8842c52d58c34a627f54b7999cec6bdbda1903b4 Mon Sep 17 00:00:00 2001 From: Ji Luo Date: Thu, 18 Jun 2020 10:01:19 +0800 Subject: [PATCH] MA-17387 Remove the rpmb handle flag in hwcrypto The handle_rpmb flag should indicate whether the call will invoke RPMB callbacks, which has been removed by below commit: commit dfd911856d31fd91eb4e3c1edb1d691723c6edaf Author: Roberto Pereira Date: Thu Nov 2 15:09:20 2017 -0700 ql-tipc: trusty_ipc: Change ipc polling to be per device This allows ipc devices to provide service callbacks (e.g. rpmb) transparently to the application instead of needing to have prior knowledge of the expected request and having to poll the individual services' channels separately. Change-Id: I3257ae5e429f4a0c279f070d750b56c5600c38d5 Sync the change for hwcrypto, it will help remove some build warnings. Test: builds and boots with trusty. Signed-off-by: Ji Luo Change-Id: I696b13d9d509d5983c934df5ee6fb36e46f4c884 (cherry picked from commit 8812d39018c23cc26afa43a97acf27427979c90c) (cherry picked from commit e79c079bd3f10d4fd80d33edeae184d53f80f706) --- lib/trusty/ql-tipc/hwcrypto.c | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/lib/trusty/ql-tipc/hwcrypto.c b/lib/trusty/ql-tipc/hwcrypto.c index 9de113a166..dd866e5c2b 100644 --- a/lib/trusty/ql-tipc/hwcrypto.c +++ b/lib/trusty/ql-tipc/hwcrypto.c @@ -80,10 +80,9 @@ static int hwcrypto_read_response(struct hwcrypto_message *msg, uint32_t cmd, vo * @resp: the response buffer * @resp_size_p: pointer to the size of the response buffer. changed to the actual size of the response read from the secure side - * @handle_rpmb: true if the request is expected to invoke RPMB callbacks */ static int hwcrypto_do_tipc(uint32_t cmd, void *req, uint32_t req_size, void *resp, - uint32_t *resp_size_p, bool handle_rpmb) + uint32_t *resp_size_p) { int rc; struct hwcrypto_message msg = { .cmd = cmd }; @@ -99,16 +98,6 @@ static int hwcrypto_do_tipc(uint32_t cmd, void *req, uint32_t req_size, void *re return rc; } - if (handle_rpmb) { - /* handle any incoming RPMB requests */ - rc = rpmb_storage_proxy_poll(); - if (rc < 0) { - trusty_error("%s: failed (%d) to get RPMB requests\n", __func__, - rc); - return rc; - } - } - uint32_t resp_size = resp_size_p ? *resp_size_p : 0; rc = hwcrypto_read_response(&msg, cmd, resp, resp_size); if (rc < 0) { @@ -188,7 +177,7 @@ int hwcrypto_hash(uint32_t in_addr, uint32_t in_len, uint32_t out_addr, invalidate_dcache_range(start, end); int rc = hwcrypto_do_tipc(HWCRYPTO_HASH, (void*)&req, - sizeof(req), NULL, 0, false); + sizeof(req), NULL, 0); /* invalidate the dcache again before read to avoid coherency * problem caused by speculative memory access by the CPU. @@ -224,7 +213,7 @@ int hwcrypto_gen_blob(uint32_t plain_pa, invalidate_dcache_range(start, end); int rc = hwcrypto_do_tipc(HWCRYPTO_ENCAP_BLOB, (void*)&req, - sizeof(req), NULL, 0, false); + sizeof(req), NULL, 0); /* invalidate the dcache again before read to avoid coherency * problem caused by speculative memory access by the CPU. @@ -251,7 +240,7 @@ int hwcrypto_gen_rng(uint32_t buf, uint32_t len) invalidate_dcache_range(start, end); int rc = hwcrypto_do_tipc(HWCRYPTO_GEN_RNG, (void*)&req, - sizeof(req), NULL, 0, false); + sizeof(req), NULL, 0); /* invalidate the dcache again before read to avoid coherency * problem caused by speculative memory access by the CPU. @@ -278,7 +267,7 @@ int hwcrypto_gen_bkek(uint32_t buf, uint32_t len) invalidate_dcache_range(start, end); int rc = hwcrypto_do_tipc(HWCRYPTO_GEN_BKEK, (void*)&req, - sizeof(req), NULL, 0, false); + sizeof(req), NULL, 0); /* invalidate the dcache again before read to avoid coherency * problem caused by speculative memory access by the CPU. @@ -289,5 +278,5 @@ int hwcrypto_gen_bkek(uint32_t buf, uint32_t len) int hwcrypto_lock_boot_state(void) { - return hwcrypto_do_tipc(HWCRYPTO_LOCK_BOOT_STATE, NULL, 0, NULL, 0, false); + return hwcrypto_do_tipc(HWCRYPTO_LOCK_BOOT_STATE, NULL, 0, NULL, 0); } -- 2.17.1