public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Jones <andrew.jones@linux.dev>
To: Akshay Behl <akshaybehl231@gmail.com>
Cc: kvm@vger.kernel.org, cleger@rivosinc.com, atishp@rivosinc.com
Subject: Re: [kvm-unit-tests PATCH v3] riscv: Refactor SBI FWFT lock tests
Date: Fri, 21 Mar 2025 11:33:49 +0100	[thread overview]
Message-ID: <20250321-276b647d439670efb4fca0e4@orel> (raw)
In-Reply-To: <20250320173235.16547-1-akshaybehl231@gmail.com>

On Thu, Mar 20, 2025 at 11:02:35PM +0530, Akshay Behl wrote:
> This patch adds a generic function for lock tests for all
> the sbi fwft features. It expects the feature is already
> locked before being called and tests the locked feature.
> 
> Signed-off-by: Akshay Behl <akshaybehl231@gmail.com>
> ---
> v3:
>  - Fixed indentation.
>  - Removed unnecessary comments.
>  - Added locked prefix.
> 
> v2:
>  - Made changes to handel non boolean feature tests.
> 
> riscv/sbi-fwft.c | 50 ++++++++++++++++++++++++++++++++----------------
>  1 file changed, 34 insertions(+), 16 deletions(-)
> 
> diff --git a/riscv/sbi-fwft.c b/riscv/sbi-fwft.c
> index 581cbf6b..c4d0b170 100644
> --- a/riscv/sbi-fwft.c
> +++ b/riscv/sbi-fwft.c
> @@ -74,6 +74,37 @@ static void fwft_check_reset(uint32_t feature, unsigned long reset)
>  	sbiret_report(&ret, SBI_SUCCESS, reset, "resets to %lu", reset);
>  }
>  
> +/* Must be called after locking the feature using SBI_FWFT_SET_FLAG_LOCK */
> +static void fwft_feature_lock_test_values(uint32_t feature, size_t nr_values,
> +	unsigned long test_values[], unsigned long locked_value)

Additional lines of parameters should line up underneath each other, i.e.

static void fwft_feature_lock_test_values(uint32_t feature, size_t nr_values,
                                          unsigned long test_values[],
                                          unsigned long locked_value)

I suggest reading other code (there's a function just above this one,
fwft_set_and_check_raw(), for example) to get a feel for the coding
style.

In this case, I've fixed it up while applying.

Applied to riscv/sbi

https://gitlab.com/jones-drew/kvm-unit-tests/-/commits/riscv/sbi

Thanks,
drew

  reply	other threads:[~2025-03-21 10:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-20 17:32 [kvm-unit-tests PATCH v3] riscv: Refactor SBI FWFT lock tests Akshay Behl
2025-03-21 10:33 ` Andrew Jones [this message]
2025-03-22 10:46 ` Andrew Jones

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=20250321-276b647d439670efb4fca0e4@orel \
    --to=andrew.jones@linux.dev \
    --cc=akshaybehl231@gmail.com \
    --cc=atishp@rivosinc.com \
    --cc=cleger@rivosinc.com \
    --cc=kvm@vger.kernel.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