From 3a30d2c34d9c287f49419b44c768ffb70764325c Mon Sep 17 00:00:00 2001 From: Anup Patel Date: Sat, 19 Sep 2020 14:26:52 +0530 Subject: lib: sbi: Extend sbi_hsm_hart_start() for domains The sbi_hsm_hart_start() should consider the domain under which we are trying to start the HART. This will help ensure that HART A can start HART B only if both HARTs A and B belong to the same domain. We also have a special case when we bring-up boot HART of non-root domains in sbi_domain_finalize() where we should skip domain checks in sbi_hsm_hart_start(). To achieve this, sbi_hsm_hart_start() should do domain checks only when domain parameter is non-NULL. This patch extends sbi_hsm_hart_start() as-per above. Signed-off-by: Anup Patel Reviewed-by: Atish Patra --- lib/sbi/sbi_ecall_hsm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/sbi/sbi_ecall_hsm.c') diff --git a/lib/sbi/sbi_ecall_hsm.c b/lib/sbi/sbi_ecall_hsm.c index 3698a41..376740c 100644 --- a/lib/sbi/sbi_ecall_hsm.c +++ b/lib/sbi/sbi_ecall_hsm.c @@ -28,8 +28,8 @@ static int sbi_ecall_hsm_handler(unsigned long extid, unsigned long funcid, case SBI_EXT_HSM_HART_START: smode = csr_read(CSR_MSTATUS); smode = (smode & MSTATUS_MPP) >> MSTATUS_MPP_SHIFT; - ret = sbi_hsm_hart_start(scratch, args[0], args[1], - smode, args[2]); + ret = sbi_hsm_hart_start(scratch, sbi_domain_thishart_ptr(), + args[0], args[1], smode, args[2]); break; case SBI_EXT_HSM_HART_STOP: ret = sbi_hsm_hart_stop(scratch, TRUE); -- cgit v1.2.3