qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] target/riscv/kvm: reset time changes
@ 2025-02-20 16:13 Daniel Henrique Barboza
  2025-02-20 16:13 ` [PATCH 1/3] target/riscv/cpu: ignore TCG init for KVM CPUs in reset_hold Daniel Henrique Barboza
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Daniel Henrique Barboza @ 2025-02-20 16:13 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-riscv, alistair.francis, bmeng, liwei1518, zhiwei_liu,
	palmer, Daniel Henrique Barboza

Hi,

These patches were done in the context of gitlab #2573 [1]. The gitlab
entry per se will probably be closed as a guest software bug, but while
working on it I noticed that we're writing a TCG-initialized
env->mstatus in KVM.

This is happening because riscv_cpu_reset_hold() is doing all TCG
related initialization first, and then calling kvm_riscv_reset_vcpu() in
the end. For example, we're writing '0xa0000000' in 'sstatus' because
TCG is setting env->mstatus = 0xa0000000.

First patch separates KVM vcpu initialization from TCG, centering all
KVM reset procedure into kvm_riscv_reset_vcpu(). Patches 2 and 3 are
small improvements made around get/put KVM csr regs. 

[1] https://gitlab.com/qemu-project/qemu/-/issues/2573

Daniel Henrique Barboza (3):
  target/riscv/cpu: ignore TCG init for KVM CPUs in reset_hold
  target/riscv/kvm: use env->sie to read/write 'sie' CSR
  target/riscv/kvm: reset all available KVM CSRs in kvm_reset()

 target/riscv/cpu.c         |  9 +++++----
 target/riscv/kvm/kvm-cpu.c | 15 ++++++++++-----
 2 files changed, 15 insertions(+), 9 deletions(-)

-- 
2.48.1



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

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

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-20 16:13 [PATCH 0/3] target/riscv/kvm: reset time changes Daniel Henrique Barboza
2025-02-20 16:13 ` [PATCH 1/3] target/riscv/cpu: ignore TCG init for KVM CPUs in reset_hold Daniel Henrique Barboza
2025-02-21  8:17   ` Andrew Jones
2025-02-24  2:03   ` Alistair Francis
2025-02-24  9:59   ` Peter Maydell
2025-02-24 11:29     ` Daniel Henrique Barboza
2025-02-24 11:47       ` Peter Maydell
2025-02-24 12:00         ` Daniel Henrique Barboza
2025-02-20 16:13 ` [PATCH 2/3] target/riscv/kvm: use env->sie to read/write 'sie' CSR Daniel Henrique Barboza
2025-02-21  8:37   ` Andrew Jones
2025-02-21  9:26     ` Daniel Henrique Barboza
2025-02-20 16:13 ` [PATCH 3/3] target/riscv/kvm: reset all available KVM CSRs in kvm_reset() Daniel Henrique Barboza
2025-02-21  8:45   ` Andrew Jones
2025-02-21  9:01     ` Andrew Jones

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