PATCH for Issue 225

Anup Patel Anup.Patel at wdc.com
Sun Oct 17 22:17:01 PDT 2021


Hi Vasan,

Only plain text emails are allowed in OpenSBI mailing list so please
take care in future emails.

Please see further comments inline below...

Regards,
Anup

From: Vasan VS <vasan.vs at gmail.com>
Date: Monday, 18 October 2021 at 1:32 AM
To: Atish Patra <Atish.Patra at wdc.com>, Anup Patel <Anup.Patel at wdc.com>
Cc: "opensbi at lists.infradead.org" <opensbi at lists.infradead.org>
Subject: PATCH for Issue 225

Please review the following fix for Issue #225 (https://github.com/riscv-software-src/opensbi/issues/225 )

diff --git a/lib/sbi/sbi_hart.c b/lib/sbi/sbi_hart.c
index 6254452..0659486 100644
--- a/lib/sbi/sbi_hart.c
+++ b/lib/sbi/sbi_hart.c
@@ -346,6 +346,7 @@ static unsigned long hart_pmp_get_allowed_addr(void)
  unsigned long val = 0;
  struct sbi_trap_info trap = {0};
 
+ csr_write(CSR_PMPCFG0, 0);

[Anup] Use csr_write_allowed() to set CSR_PMPCFG0 because PMP might
not be preset. If you get trap while updating CSR_PMPCFG0 then return 0.

  csr_write_allowed(CSR_PMPADDR0, (ulong)&trap, PMP_ADDR_MASK);
  if (!trap.cause) {
  val = csr_read_allowed(CSR_PMPADDR0, (ulong)&trap);



Regards

Vasan



More information about the opensbi mailing list