OpenSBI Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@suse.de>
To: opensbi@lists.infradead.org
Subject: [PATCH] lib: sbi: Add missing sscrind and sscfg extensions in sbi_hart_ext[]
Date: Wed, 20 Mar 2024 15:57:58 +0100	[thread overview]
Message-ID: <mvmo7b9gdc9.fsf@suse.de> (raw)
In-Reply-To: <20240320145051.1459406-1-cleger@rivosinc.com> ("Clément Léger"'s message of "Wed, 20 Mar 2024 15:50:43 +0100")

On M?r 20 2024, Cl?ment L?ger wrote:

> The sbi_hart_ext[] array is missing these two extensions ids. It is
> expected that this array contains all the extensions declaration at the
> same index of the SBI_HART_EXT_* define. Without this, when adding a new
> extension, there is a mismatch between ids and extension names and it
> can even display corrupted extension names.
>
> Signed-off-by: Cl?ment L?ger <cleger@rivosinc.com>
>
> ---
>  lib/sbi/sbi_hart.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/lib/sbi/sbi_hart.c b/lib/sbi/sbi_hart.c
> index 3d13694..d68e2a0 100644
> --- a/lib/sbi/sbi_hart.c
> +++ b/lib/sbi/sbi_hart.c
> @@ -666,6 +666,8 @@ const struct sbi_hart_ext_data sbi_hart_ext[] = {
>  	__SBI_HART_EXT_DATA(sdtrig, SBI_HART_EXT_SDTRIG),
>  	__SBI_HART_EXT_DATA(smcsrind, SBI_HART_EXT_SMCSRIND),
>  	__SBI_HART_EXT_DATA(smcdeleg, SBI_HART_EXT_SMCDELEG),
> +	__SBI_HART_EXT_DATA(sscsrind, SBI_HART_EXT_SSCSRIND),
> +	__SBI_HART_EXT_DATA(ssccfg, SBI_HART_EXT_SSCCFG),
>  };

Please add a static_assert to verify that the size of sbi_hart_ext
agrees with SBI_HART_EXT_MAX.

-- 
Andreas Schwab, SUSE Labs, schwab at suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


  reply	other threads:[~2024-03-20 14:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-20 14:50 [PATCH] lib: sbi: Add missing sscrind and sscfg extensions in sbi_hart_ext[] Clément Léger
2024-03-20 14:57 ` Andreas Schwab [this message]
2024-03-20 15:21   ` Clément Léger
2024-04-10  5:18 ` Anup Patel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=mvmo7b9gdc9.fsf@suse.de \
    --to=schwab@suse.de \
    --cc=opensbi@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox