qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] target/riscv/kvm: CSR related fixes
@ 2025-04-17 12:48 Daniel Henrique Barboza
  2025-04-17 12:48 ` [PATCH 1/7] target/riscv/kvm: minor fixes/tweaks Daniel Henrique Barboza
                   ` (6 more replies)
  0 siblings, 7 replies; 18+ messages in thread
From: Daniel Henrique Barboza @ 2025-04-17 12:48 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-riscv, alistair.francis, liwei1518, zhiwei_liu, palmer,
	abologna, Daniel Henrique Barboza

Hi,

This series contains fixes to address a problem reported by Andrea in
[1]. We're now handling CSRs like regular KVM extensions, i.e. we'll
verify if the CSR is available before attempting to read/write it.

A considerable amount of boilerplate had to be added, but as a reward
we've automated the process to a point where new CSRs can be added by
just adding them in an static array, and everything else is taken care
of.

Patch 6 re-introduces scounteren and senvcfg KVM CSRs, the patch that
we've reverted during the 10.0 cycle. We're ready to deal with older
kernels that don't know about them, so reintroduce it.

Patch 7 is a fix for an issue I've found with scounteren during testing.
It is a kernel issue at heart but QEMU must be able to deal with it due
to older kernels in the wild.



Andrea, if you could take these patches and test it with your setup that
would be terrific.



Patches based on alistair/riscv-to-apply.next.


[1] https://lore.kernel.org/qemu-riscv/CABJz62OfUDHYkQ0T3rGHStQprf1c7_E0qBLbLKhfv=+jb0SYAw@mail.gmail.com/

Daniel Henrique Barboza (7):
  target/riscv/kvm: minor fixes/tweaks
  target/riscv/kvm: turn u32/u64 reg functions in macros
  target/riscv/kvm: turn kvm_riscv_reg_id_ulong() in a macro
  target/riscv/kvm: add kvm_csr_cfgs[]
  target/riscv/kvm: do not read unavailable CSRs
  target/riscv/kvm: add missing KVM CSRs
  target/riscv/kvm: reset 'scounteren' with host val

 target/riscv/cpu.h         |   1 +
 target/riscv/kvm/kvm-cpu.c | 366 +++++++++++++++++++++++++------------
 2 files changed, 247 insertions(+), 120 deletions(-)

-- 
2.49.0



^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2025-04-24 12:38 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-17 12:48 [PATCH 0/7] target/riscv/kvm: CSR related fixes Daniel Henrique Barboza
2025-04-17 12:48 ` [PATCH 1/7] target/riscv/kvm: minor fixes/tweaks Daniel Henrique Barboza
2025-04-17 12:48 ` [PATCH 2/7] target/riscv/kvm: turn u32/u64 reg functions in macros Daniel Henrique Barboza
2025-04-17 12:48 ` [PATCH 3/7] target/riscv/kvm: turn kvm_riscv_reg_id_ulong() in a macro Daniel Henrique Barboza
2025-04-17 12:48 ` [PATCH 4/7] target/riscv/kvm: add kvm_csr_cfgs[] Daniel Henrique Barboza
2025-04-23 15:15   ` Andrew Jones
2025-04-23 19:45     ` Daniel Henrique Barboza
2025-04-24  8:19       ` Andrew Jones
2025-04-17 12:48 ` [PATCH 5/7] target/riscv/kvm: do not read unavailable CSRs Daniel Henrique Barboza
2025-04-23 15:25   ` Andrew Jones
2025-04-24 12:36     ` Daniel Henrique Barboza
2025-04-17 12:48 ` [PATCH 6/7] target/riscv/kvm: add missing KVM CSRs Daniel Henrique Barboza
2025-04-23 15:28   ` Andrew Jones
2025-04-17 12:48 ` [PATCH 7/7] target/riscv/kvm: reset 'scounteren' with host val Daniel Henrique Barboza
2025-04-23 15:46   ` Andrew Jones
2025-04-23 18:06     ` Andrea Bolognani
2025-04-23 18:46       ` Daniel Henrique Barboza
2025-04-24  9:07     ` Daniel Henrique Barboza

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).