Skip to contentSkip to conversation

riscv-to-apply queue

GIT PULL Applied Alistair Francis 2 participants 5 messages Mar 28, 2025 RISC-V

lore
Share & tools
lore
#0 lore raw

The following changes since commit b876e721f1c939f3e83ac85bd3c1c2821e12b3fa:

Update version for v10.0.0-rc1 release (2025-03-25 13:58:14 -0400)

are available in the Git repository at:

https://github.com/alistair23/qemu.git tags/pull-riscv-to-apply-20250328

for you to fetch changes up to 897c68fb795cf03b89b6688a6f945d68a765c3e4:

Revert "target/riscv/kvm: add missing KVM CSRs" (2025-03-28 16:50:25 +1000)

----------------------------------------------------------------
Fifth RISC-V PR for 10.0

* Add docs/specs/riscv-iommu.rst to MAINTAINERS
* Fix broken link to external risv iommu document
* Revert scounteren and senvcfg to fixup older kernel boots

----------------------------------------------------------------
Daniel Henrique Barboza (1):
Revert "target/riscv/kvm: add missing KVM CSRs"

hemanshu.khilari.foss (2):
docs: Added docs/specs/riscv-iommu.rst in MAINTAINERS file. docs/specs/riscv-iommu: Fixed broken link to external risv iommu document

 MAINTAINERS                | 1 +
 docs/specs/riscv-iommu.rst | 6 +++---
 target/riscv/kvm/kvm-cpu.c | 6 ------
 3 files changed, 4 insertions(+), 9 deletions(-)
#1 lore raw

[PULL 1/3] docs: Added docs/specs/riscv-iommu.rst in MAINTAINERS file.

From: "hemanshu.khilari.foss" <[email protected]>

Added docs/specs/riscv-iommu.rst under RISC-V TCG CPUs section in in MAINTAINERS file since
scripts/get_maintainer.pl -f docs/specs/riscv-iommu.rst doesn't list any maintainers.

Message-ID: <[email protected]>

---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)
MAINTAINERS +1 -0
index 8f470a1c9b..27f2cfd833 100644
@@ -319,6 +319,7 @@ L: [email protected]
 S: Supported
 F: configs/targets/riscv*
 F: docs/system/target-riscv.rst
+F: docs/specs/riscv-iommu.rst
 F: target/riscv/
 F: hw/char/riscv_htif.c
 F: hw/riscv/
Signature · 1 line
2.48.1
#2 lore raw

[PULL 2/3] docs/specs/riscv-iommu: Fixed broken link to external risv iommu document

In reply to Alistair Francis

From: "hemanshu.khilari.foss" <[email protected]>

The links to riscv iommu specification document are incorrect. This patch updates all the said link to point to correct location.

Cc: [email protected]
Cc: [email protected]
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2808

Message-ID: <[email protected]>

---
 docs/specs/riscv-iommu.rst | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
docs/specs/riscv-iommu.rst +3 -3
index 000c7e1f57..991d376fdc 100644
@@ -4,7 +4,7 @@ RISC-V IOMMU support for RISC-V machines
 ========================================
 
 QEMU implements a RISC-V IOMMU emulation based on the RISC-V IOMMU spec
-version 1.0 `iommu1.0`_.
+version 1.0 `iommu1.0.0`_.
 
 The emulation includes a PCI reference device (riscv-iommu-pci) and a platform
 bus device (riscv-iommu-sys) that QEMU RISC-V boards can use.  The 'virt'
@@ -14,7 +14,7 @@ riscv-iommu-pci reference device
 --------------------------------
 
 This device implements the RISC-V IOMMU emulation as recommended by the section
-"Integrating an IOMMU as a PCIe device" of `iommu1.0`_: a PCI device with base
+"Integrating an IOMMU as a PCIe device" of `iommu1.0.0`_: a PCI device with base
 class 08h, sub-class 06h and programming interface 00h.
 
 As a reference device it doesn't implement anything outside of the specification,
@@ -109,7 +109,7 @@ riscv-iommu options:
 - "s-stage": enabled
 - "g-stage": enabled
 
-.. _iommu1.0: https://github.com/riscv-non-isa/riscv-iommu/releases/download/v1.0/riscv-iommu.pdf
+.. _iommu1.0.0: https://github.com/riscv-non-isa/riscv-iommu/releases/download/v1.0.0/riscv-iommu.pdf
 
 .. _linux-v8: https://lore.kernel.org/linux-riscv/[email protected]/
 
Signature · 1 line
2.48.1
#3 lore raw

[PULL 3/3] Revert "target/riscv/kvm: add missing KVM CSRs"

In reply to Alistair Francis

From: Daniel Henrique Barboza <[email protected]>

This commit breaks KVM boot on older kernels, like reported in [1], due to senvcfg not being available in them.

There's also another problem related to scounteren. Using a recent enough guest buildroot, 'ping' will be build with rdtime support. In this case, doing a ping in a KVM guest while exposing scounteren will result in an error. The root cause relates to how KVM handles scounteren, but QEMU can work around it by initializing scounteren with the host value during init().

Fixing these issues in a non-rushed-bandaid manner results in an amount of design changes that I don't feel comfortable pushing during code freeze, so for 10.0 we'll remove the CSRs and re-introduce them in 10.1 with the adequate support.

This reverts commit 4db19d5b21e058e6eb3474b6be470d1184afaa9e.

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

Message-ID: <[email protected]>

---
 target/riscv/kvm/kvm-cpu.c | 6 ------
 1 file changed, 6 deletions(-)
target/riscv/kvm/kvm-cpu.c +0 -6
index 4ffeeaa1c9..0f4997a918 100644
@@ -624,8 +624,6 @@ static void kvm_riscv_reset_regs_csr(CPURISCVState *env)
     env->stval = 0;
     env->mip = 0;
     env->satp = 0;
-    env->scounteren = 0;
-    env->senvcfg = 0;
 }
 
 static int kvm_riscv_get_regs_csr(CPUState *cs)
@@ -641,8 +639,6 @@ static int kvm_riscv_get_regs_csr(CPUState *cs)
     KVM_RISCV_GET_CSR(cs, env, stval, env->stval);
     KVM_RISCV_GET_CSR(cs, env, sip, env->mip);
     KVM_RISCV_GET_CSR(cs, env, satp, env->satp);
-    KVM_RISCV_GET_CSR(cs, env, scounteren, env->scounteren);
-    KVM_RISCV_GET_CSR(cs, env, senvcfg, env->senvcfg);
 
     return 0;
 }
@@ -660,8 +656,6 @@ static int kvm_riscv_put_regs_csr(CPUState *cs)
     KVM_RISCV_SET_CSR(cs, env, stval, env->stval);
     KVM_RISCV_SET_CSR(cs, env, sip, env->mip);
     KVM_RISCV_SET_CSR(cs, env, satp, env->satp);
-    KVM_RISCV_SET_CSR(cs, env, scounteren, env->scounteren);
-    KVM_RISCV_SET_CSR(cs, env, senvcfg, env->senvcfg);
 
     return 0;
 }
Signature · 1 line
2.48.1