From 56a6412de86537d3445e36a5a81f515fa2c683a7 Mon Sep 17 00:00:00 2001 From: Ashutosh Singh Date: Thu, 31 Mar 2016 17:18:34 +0100 Subject: [PATCH] pass r0-r6 as part of smc param In new communication protocol between optee os and linux driver, r0-r6 registers are used. opteed need to copy these registers as well when optee context registers are initialized. Change-Id: Ifb47b73f847c61746cb58ea78411c1c71f208030 Signed-off-by: Ashutosh Singh --- services/spd/opteed/opteed_main.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/services/spd/opteed/opteed_main.c b/services/spd/opteed/opteed_main.c index 7796fc4a5..6b4b14af1 100644 --- a/services/spd/opteed/opteed_main.c +++ b/services/spd/opteed/opteed_main.c @@ -265,6 +265,18 @@ uint64_t opteed_smc_handler(uint32_t smc_fid, cm_el1_sysregs_context_restore(SECURE); cm_set_next_eret_context(SECURE); + write_ctx_reg(get_gpregs_ctx(&optee_ctx->cpu_ctx), + CTX_GPREG_X4, + read_ctx_reg(get_gpregs_ctx(handle), + CTX_GPREG_X4)); + write_ctx_reg(get_gpregs_ctx(&optee_ctx->cpu_ctx), + CTX_GPREG_X5, + read_ctx_reg(get_gpregs_ctx(handle), + CTX_GPREG_X5)); + write_ctx_reg(get_gpregs_ctx(&optee_ctx->cpu_ctx), + CTX_GPREG_X6, + read_ctx_reg(get_gpregs_ctx(handle), + CTX_GPREG_X6)); /* Propagate hypervisor client ID */ write_ctx_reg(get_gpregs_ctx(&optee_ctx->cpu_ctx), CTX_GPREG_X7,