diff mbox series

[6/7] lib: sbi: sse: use PRV_S instead of hardcoded value for mode

Message ID 20240409100216.263256-7-cleger@rivosinc.com
State Accepted
Headers show
Series lib: sbi: sse: fixes after review | expand

Commit Message

Clément Léger April 9, 2024, 10:02 a.m. UTC
Rather then passing 1 to sbi_domain_check_addr_range() for supervisor
mode, use PRV_S.

Signed-off-by: Clément Léger <cleger@rivosinc.com>
---
 lib/sbi/sbi_sse.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Anup Patel May 7, 2024, 11:47 a.m. UTC | #1
On Tue, Apr 9, 2024 at 3:32 PM Clément Léger <cleger@rivosinc.com> wrote:
>
> Rather then passing 1 to sbi_domain_check_addr_range() for supervisor
> mode, use PRV_S.
>
> Signed-off-by: Clément Léger <cleger@rivosinc.com>

LGTM.

Reviewed-by: Anup Patel <anup@brainfault.org>

Regards,
Anup

> ---
>  lib/sbi/sbi_sse.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lib/sbi/sbi_sse.c b/lib/sbi/sbi_sse.c
> index 8b448bf..85137c2 100644
> --- a/lib/sbi/sbi_sse.c
> +++ b/lib/sbi/sbi_sse.c
> @@ -837,8 +837,8 @@ int sbi_sse_attr_check(uint32_t base_attr_id, uint32_t attr_count,
>                 return SBI_EINVALID_ADDR;
>
>         if (!sbi_domain_check_addr_range(sbi_domain_thishart_ptr(), phys_lo,
> -                                        sizeof(unsigned long) * attr_count, 1,
> -                                        access))
> +                                        sizeof(unsigned long) * attr_count,
> +                                        PRV_S, access))
>                 return SBI_EINVALID_ADDR;
>
>         return SBI_OK;
> --
> 2.43.0
>
>
> --
> opensbi mailing list
> opensbi@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/opensbi
diff mbox series

Patch

diff --git a/lib/sbi/sbi_sse.c b/lib/sbi/sbi_sse.c
index 8b448bf..85137c2 100644
--- a/lib/sbi/sbi_sse.c
+++ b/lib/sbi/sbi_sse.c
@@ -837,8 +837,8 @@  int sbi_sse_attr_check(uint32_t base_attr_id, uint32_t attr_count,
 		return SBI_EINVALID_ADDR;
 
 	if (!sbi_domain_check_addr_range(sbi_domain_thishart_ptr(), phys_lo,
-					 sizeof(unsigned long) * attr_count, 1,
-					 access))
+					 sizeof(unsigned long) * attr_count,
+					 PRV_S, access))
 		return SBI_EINVALID_ADDR;
 
 	return SBI_OK;