[PATCH v2] xen/riscv: fix sstc init to write vstimecmp instead of stimecmp

Baptiste Le Duc posted 1 patch 4 days, 4 hours ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/1779207317.8631fc262581453bbf619ec5b2062170.19e4105277b000f373@vates.tech
xen/arch/riscv/time.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH v2] xen/riscv: fix sstc init to write vstimecmp instead of stimecmp
Posted by Baptiste Le Duc 4 days, 4 hours ago
According to the comment above initializing of CSR_VSTIMECMP should be used instead of CSR_STIMECM.

Fixes: 25e032730690 ("xen/riscv: allow Xen to use SSTC while hiding it from guests")

Signed-off-by: Baptiste Le Duc <baptiste.le-duc@vates.tech>
---
 xen/arch/riscv/time.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/riscv/time.c b/xen/arch/riscv/time.c
index 8769709e52..10b7e35f13 100644
--- a/xen/arch/riscv/time.c
+++ b/xen/arch/riscv/time.c
@@ -101,6 +101,6 @@ void __init preinit_xen_time(void)
          * Thereby to avoid spurious VS-timer irqs set vstimecmp CSR to
          * ULONG_MAX.
          */
-        csr_write64(CSR_STIMECMP, ULONG_MAX);
+        csr_write64(CSR_VSTIMECMP, ULONG_MAX);
     }
 }
-- 
2.54.0
Re: [PATCH v2] xen/riscv: fix sstc init to write vstimecmp instead of stimecmp
Posted by Oleksii Kurochko 4 days, 3 hours ago

On 5/19/26 6:14 PM, Baptiste Le Duc wrote:
> According to the comment above initializing of CSR_VSTIMECMP should be used instead of CSR_STIMECM.

Probably, it is something wrong with my e-mail app but this line looks 
long enough.

I think we have to follow 80 chars per line.

Nit: s/CSR_STIMECM/CSR_STIMECMP

> 
> Fixes: 25e032730690 ("xen/riscv: allow Xen to use SSTC while hiding it from guests")

Nit: there is no need for empty line between Fixes: and Signed-off-by.

> 
> Signed-off-by: Baptiste Le Duc <baptiste.le-duc@vates.tech>

Nit: it also would be nice to put here what was changed, for example,
---
Changes in v2:
  - Update the commit message.
---

Please don't rush to send a new version of the patch. Probably 
committers will agree to make suggested fixes during commit.

With fixes mentioned above:
  Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

Thanks!

~ Oleksii
Re: [PATCH v2] xen/riscv: fix sstc init to write vstimecmp instead of stimecmp
Posted by Jan Beulich 3 days, 13 hours ago
On 19.05.2026 18:28, Oleksii Kurochko wrote:
> On 5/19/26 6:14 PM, Baptiste Le Duc wrote:
>> According to the comment above initializing of CSR_VSTIMECMP should be used instead of CSR_STIMECM.
> 
> Probably, it is something wrong with my e-mail app but this line looks 
> long enough.
> 
> I think we have to follow 80 chars per line.

Just to mention - for commit messages I think the limit is 75 or 76.

Jan
Re: [PATCH v2] xen/riscv: fix sstc init to write vstimecmp instead of stimecmp
Posted by Andrew Cooper 4 days, 3 hours ago
On 19/05/2026 5:28 pm, Oleksii Kurochko wrote:
>
>
> On 5/19/26 6:14 PM, Baptiste Le Duc wrote:
>> According to the comment above initializing of CSR_VSTIMECMP should
>> be used instead of CSR_STIMECM.
>
> Probably, it is something wrong with my e-mail app but this line looks
> long enough.
>
> I think we have to follow 80 chars per line.
>
> Nit: s/CSR_STIMECM/CSR_STIMECMP
>
>>
>> Fixes: 25e032730690 ("xen/riscv: allow Xen to use SSTC while hiding
>> it from guests")
>
> Nit: there is no need for empty line between Fixes: and Signed-off-by.
>
>>
>> Signed-off-by: Baptiste Le Duc <baptiste.le-duc@vates.tech>
>
> Nit: it also would be nice to put here what was changed, for example,
> ---
> Changes in v2:
>  - Update the commit message.
> ---
>
> Please don't rush to send a new version of the patch. Probably
> committers will agree to make suggested fixes during commit.
>
> With fixes mentioned above:
>  Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

In this case, it's probably easiest for me to fix up on commit to
produce a good example to follow.

~Andrew