lib: sbi: Extend sbi_hsm_hart_start() for domains
authorAnup Patel <anup.patel@wdc.com>
Sat, 19 Sep 2020 08:56:52 +0000 (14:26 +0530)
committerAnup Patel <anup@brainfault.org>
Tue, 20 Oct 2020 08:26:36 +0000 (13:56 +0530)
commit3a30d2c34d9c287f49419b44c768ffb70764325c
tree363cac510778fecc2c182ebcf58d5519cec33b08
parente73b92d8623e9599245c6921025cfe0b40141f07
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 <anup.patel@wdc.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
include/sbi/sbi_hsm.h
lib/sbi/sbi_domain.c
lib/sbi/sbi_ecall_hsm.c
lib/sbi/sbi_hsm.c