[PATCH] lib:sbi fix the trap_regs point misalignment issue
Li, Yong
yong.li at intel.com
Wed Jun 12 19:53:53 PDT 2024
> -----Original Message-----
> From: Li, Yong <yong.li at intel.com>
> Sent: Wednesday, June 12, 2024 11:24 AM
> To: opensbi at lists.infradead.org
> Cc: Li, Yong <yong.li at intel.com>; Yu Chien Peter Lin
> <peterlin at andestech.com>
> Subject: [PATCH] lib:sbi fix the trap_regs point misalignment issue
>
> This is to make the trap_regs pointer consistant with the one in
> CSR_MSCRATCH, in which a new sbi_trap_info and sbi_trap_context were
> introduced which caused the regression issue in domain context
>
> Cc: Yu Chien Peter Lin <peterlin at andestech.com>
> Signed-off-by: Yong Li <yong.li at intel.com>
This patch has been covered in previous Peter's patch,
"sbi: sbi_domain_context: Fix trap context for domain context switching"
No need to follow.
Thanks,
Yong Li
> ---
> lib/sbi/sbi_domain_context.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/sbi/sbi_domain_context.c b/lib/sbi/sbi_domain_context.c index
> 7528591..5a8f616 100755
> --- a/lib/sbi/sbi_domain_context.c
> +++ b/lib/sbi/sbi_domain_context.c
> @@ -67,7 +67,7 @@ static void switch_to_next_domain_context(struct
> sbi_context *ctx,
>
> /* Save current trap state and restore target domain's trap state */
> trap_regs = (struct sbi_trap_regs *)(csr_read(CSR_MSCRATCH) -
> - SBI_TRAP_REGS_SIZE);
> + SBI_TRAP_CONTEXT_SIZE);
> sbi_memcpy(&ctx->regs, trap_regs, sizeof(*trap_regs));
> sbi_memcpy(trap_regs, &dom_ctx->regs, sizeof(*trap_regs));
>
> --
> 2.25.1
More information about the opensbi
mailing list