@samitouri / QOSamiQemu / commits / b8c6f03cbe

hw/riscv/riscv-iommu: Use standard EN_PRI bit for PRI

Replace the temporary custom extension bit (TC[32]) with the standard EN_PRI bit defined in RISC-V IOMMU specification. Signed-off-by: Jay Chang <jay.chang@sifive.com> Reviewed-by: Frank Chang <frank.chang@sifive.com> Reviewed-by: Nutty Liu <nutty.liu@hotmail.com> Signed-off-by: Jay Chang <jay.chang@sifive.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-ID: <20260325014856.58948-1-jay.chang@sifive.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>

Jay Chang committed Mar 25, 2026 at 09:48 UTC b8c6f03cbecf11cf15bdcdba8f3b9fa596635e63
1 file changed +2 -5
hw/riscv/riscv-iommu.c
+2 -5
@@ -1572,11 +1572,8 @@ static int riscv_iommu_translate(RISCVIOMMUState *s, RISCVIOMMUContext *ctx,
1572 riscv_iommu_hpm_incr_ctr(s, ctx, RISCV_IOMMU_HPMEVENT_URQ);
1573
1574 iot_cache = g_hash_table_ref(s->iot_cache);
1575 - /*
1576 - * TC[32] is reserved for custom extensions, used here to temporarily
1577 - * enable automatic page-request generation for ATS queries.
1578 - */
1579 - enable_pri = (iotlb->perm == IOMMU_NONE) && (ctx->tc & BIT_ULL(32));
1575 + enable_pri = (iotlb->perm == IOMMU_NONE) &&
1576 + (ctx->tc & RISCV_IOMMU_DC_TC_EN_PRI);
1577 enable_pid = (ctx->tc & RISCV_IOMMU_DC_TC_PDTV);
1578
1579 /* Check for ATS request. */