diff options
author | Jason Chien <jason.chien@sifive.com> | 2024-11-14 14:56:17 +0800 |
---|---|---|
committer | Alistair Francis <alistair.francis@wdc.com> | 2024-12-20 11:19:16 +1000 |
commit | e5d28bf2b3064e986bfd7e0f0c9653017e20f3d8 (patch) | |
tree | 4b090e4cd89017bc01c4c9561c7718b595d25934 /scripts/xml-preprocess-test.py | |
parent | 3e9793ab01904144c204589811e0e879109a9713 (diff) | |
download | qemu-e5d28bf2b3064e986bfd7e0f0c9653017e20f3d8.zip qemu-e5d28bf2b3064e986bfd7e0f0c9653017e20f3d8.tar.gz qemu-e5d28bf2b3064e986bfd7e0f0c9653017e20f3d8.tar.bz2 |
hw/riscv/riscv-iommu.c: Correct the validness check of iova
From RISCV IOMMU spec section 2.1.3:
When SXL is 1, the following rules apply:
- If the first-stage is not Bare, then a page fault corresponding to the
original access type occurs if the IOVA has bits beyond bit 31 set to 1.
- If the second-stage is not Bare, then a guest page fault corresponding
to the original access type occurs if the incoming GPA has bits beyond bit
33 set to 1.
From RISCV IOMMU spec section 2.3 step 17:
Use the process specified in Section "Two-Stage Address Translation" of
the RISC-V Privileged specification to determine the GPA accessed by the
transaction.
From RISCV IOMMU spec section 2.3 step 19:
Use the second-stage address translation process specified in Section
"Two-Stage Address Translation" of the RISC-V Privileged specification
to translate the GPA A to determine the SPA accessed by the transaction.
This commit adds the iova check with the following rules:
- For Sv32, Sv32x4, Sv39x4, Sv48x4 and Sv57x4, the iova must be zero
extended.
- For Sv39, Sv48 and Sv57, the iova must be signed extended with most
significant bit.
Signed-off-by: Jason Chien <jason.chien@sifive.com>
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Message-ID: <20241114065617.25133-1-jason.chien@sifive.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Diffstat (limited to 'scripts/xml-preprocess-test.py')
0 files changed, 0 insertions, 0 deletions