]> git.ipfire.org Git - thirdparty/qemu.git/commit
hw/riscv/riscv-iommu: Fixup PDT Nested Walk
authorGuo Ren (Alibaba DAMO Academy) <guoren@kernel.org>
Sat, 13 Sep 2025 04:12:33 +0000 (00:12 -0400)
committerMichael Tokarev <mjt@tls.msk.ru>
Sat, 4 Oct 2025 07:33:39 +0000 (10:33 +0300)
commit4dc7ff79963640f2c70c90014bc9e9279c570c61
treedaa4a901160d093d0073207a798d9384847721b3
parent9bed57fb2e5fc8635a4f4998dff6b7fb6ab6447e
hw/riscv/riscv-iommu: Fixup PDT Nested Walk

Current implementation is wrong when iohgatp != bare. The RISC-V
IOMMU specification has defined that the PDT is based on GPA, not
SPA. So this patch fixes the problem, making PDT walk correctly
when the G-stage table walk is enabled.

Fixes: 0c54acb8243d ("hw/riscv: add RISC-V IOMMU base emulation")
Cc: qemu-stable@nongnu.org
Cc: Sebastien Boeuf <seb@rivosinc.com>
Cc: Tomasz Jeznach <tjeznach@rivosinc.com>
Reviewed-by: Weiwei Li <liwei1518@gmail.com>
Reviewed-by: Nutty Liu <liujingqi@lanxincomputing.com>
Signed-off-by: Guo Ren (Alibaba DAMO Academy) <guoren@kernel.org>
Tested-by: Chen Pei <cp0613@linux.alibaba.com>
Tested-by: Fangyu Yu <fangyu.yu@linux.alibaba.com>
Message-ID: <20250913041233.972870-1-guoren@kernel.org>
[ Changes by AF:
 - Add braces to if statements
]
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
(cherry picked from commit 15abfced803929f935bb59a0e1b02558bd8325c4)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/riscv/riscv-iommu.c