qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH for-9.0 0/5] target/riscv/kvm: fix KVM reg id sizes
@ 2023-12-08 18:38 Daniel Henrique Barboza
  2023-12-08 18:38 ` [PATCH for-9.0 1/5] target/riscv/kvm: change KVM_REG_RISCV_FP_F to u32 Daniel Henrique Barboza
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Daniel Henrique Barboza @ 2023-12-08 18:38 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-riscv, alistair.francis, bmeng, liwei1518, zhiwei_liu,
	palmer, ajones, Daniel Henrique Barboza

Hi,

While working in a follow-up for the Vector KVM regs, where we would
read 'vlenb' and then all other vregs [1], Drew noticed that we're using
kvm_riscv_reg_id() in registers that are u32 and u64.

The helper is returning ulong regs for all cases, meaning that we return
the wrong size for u32 regs when running 6 in 64 bits (case of FP_F
regs) and u64 regs when running in 32 bits (case of FP_D and timer
regs).

It's best to do a quick bug fix round in the KVM reg IDs before adding
more IDs, so here we are.

This is marked as 9.0 because the fixes aren't critical enough to
postpone 8.2. Michael, patches 1, 2 and 3 are good candidates for
8.2-stable.

Alistair, in case these are accepted I'll re-send "[PATCH for-9.0 0/4]
target/riscv: add RVV CSRs" based on these fixes to avoid conflicts in
the tree.


[1] this is dependent on kernel side changes that are being discussed
here: https://lore.kernel.org/kvm/20231205174509.2238870-1-dbarboza@ventanamicro.com/
("[PATCH v3 0/3] RISC-V, KVM: add 'vlenb' and vector CSRs to get-reg-list")


Daniel Henrique Barboza (5):
  target/riscv/kvm: change KVM_REG_RISCV_FP_F to u32
  target/riscv/kvm: change KVM_REG_RISCV_FP_D to u64
  target/riscv/kvm: change timer regs size to u64
  target/riscv/kvm: add RISCV_CONFIG_REG()
  target/riscv/kvm: rename riscv_reg_id() to riscv_reg_id_ulong()

 target/riscv/kvm/kvm-cpu.c | 109 ++++++++++++++++++++-----------------
 1 file changed, 59 insertions(+), 50 deletions(-)

-- 
2.41.0



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

end of thread, other threads:[~2023-12-18  0:11 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-08 18:38 [PATCH for-9.0 0/5] target/riscv/kvm: fix KVM reg id sizes Daniel Henrique Barboza
2023-12-08 18:38 ` [PATCH for-9.0 1/5] target/riscv/kvm: change KVM_REG_RISCV_FP_F to u32 Daniel Henrique Barboza
2023-12-15 13:08   ` Andrew Jones
2023-12-08 18:38 ` [PATCH for-9.0 2/5] target/riscv/kvm: change KVM_REG_RISCV_FP_D to u64 Daniel Henrique Barboza
2023-12-15 13:11   ` Andrew Jones
2023-12-08 18:38 ` [PATCH for-9.0 3/5] target/riscv/kvm: change timer regs size " Daniel Henrique Barboza
2023-12-15 13:14   ` Andrew Jones
2023-12-08 18:38 ` [PATCH for-9.0 4/5] target/riscv/kvm: add RISCV_CONFIG_REG() Daniel Henrique Barboza
2023-12-15 13:18   ` Andrew Jones
2023-12-08 18:38 ` [PATCH for-9.0 5/5] target/riscv/kvm: rename riscv_reg_id() to riscv_reg_id_ulong() Daniel Henrique Barboza
2023-12-15 13:19   ` Andrew Jones
2023-12-18  0:09 ` [PATCH for-9.0 0/5] target/riscv/kvm: fix KVM reg id sizes Alistair Francis

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).