From: Andrew Jones <andrew.jones@linux.dev>
To: Koichiro Den <den@valinux.co.jp>
Cc: Anup Patel <anup@brainfault.org>,
Atish Patra <atish.patra@linux.dev>,
Paul Walmsley <pjw@kernel.org>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Alexandre Ghiti <alex@ghiti.fr>,
Bingyu Xian <shanbeeyoo@gmail.com>,
kvm@vger.kernel.org, kvm-riscv@lists.infradead.org,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/3] RISC-V: KVM: Batch user accesses when updating steal time
Date: Sun, 22 Nov 2026 12:58:10 +0100 [thread overview]
Message-ID: <awLYx5ASZJLHDcpv@orel> (raw)
In-Reply-To: <20261121173526.892344-3-den@valinux.co.jp>
On Sun, Nov 22, 2026 at 02:35:25AM +0900, Koichiro Den wrote:
> Updating the SBI STA shared structure performs 2x get_user() + 3x
> put_user() calls, each of which toggles sstatus.SUM.
>
> Keep SUM enabled across all five accesses to the shared structure.
>
> Signed-off-by: Koichiro Den <den@valinux.co.jp>
> ---
> Changes since v1:
> - Drop might_fault(). (Andrew)
> - Use scoped_user_rw_access(). (Andrew)
> - Use le32_add_cpu() and le64_add_cpu() to avoid the extra temporaries.
>
> Note:
> - I haven't carried over Andrew's Reviewed-by since the scoped_
> conversion reworks the fault paths. Would appreciate another look.
> - As in v1, I kept WARN_ON() for uaccess failures.
>
> v1: https://lore.kernel.org/r/20261118062242.2914385-2-den@valinux.co.jp/
>
> arch/riscv/kvm/vcpu_sbi_sta.c | 60 +++++++++++++++++------------------
> 1 file changed, 30 insertions(+), 30 deletions(-)
>
Reviewed-by: Andrew Jones <andrew.jones@linux.dev>
next prev parent reply other threads:[~2026-11-22 11:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-21 17:35 [PATCH v2 0/3] RISC-V: KVM: Lessen steal time update overhead Koichiro Den
2026-11-21 17:35 ` [PATCH v2 1/3] RISC-V: KVM: Order writes to the SBI STA shared structure Koichiro Den
2026-11-22 11:57 ` Andrew Jones
2026-11-21 17:35 ` [PATCH v2 2/3] RISC-V: KVM: Batch user accesses when updating steal time Koichiro Den
2026-11-22 11:58 ` Andrew Jones [this message]
2026-11-21 17:35 ` [PATCH v2 3/3] RISC-V: KVM: Skip steal-time updates when run_delay is unchanged Koichiro Den
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=awLYx5ASZJLHDcpv@orel \
--to=andrew.jones@linux.dev \
--cc=alex@ghiti.fr \
--cc=anup@brainfault.org \
--cc=aou@eecs.berkeley.edu \
--cc=atish.patra@linux.dev \
--cc=den@valinux.co.jp \
--cc=kvm-riscv@lists.infradead.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=pjw@kernel.org \
--cc=shanbeeyoo@gmail.com \
/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