hw/riscv/riscv-iommu: Use standard EN_PRI bit for PRI
PATCH 1/1 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 <[email protected]>
Reviewed-by Frank Chang <[email protected]>
--- hw/riscv/riscv-iommu.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
hw/riscv/riscv-iommu.c +2 -5
@@ -1572,11 +1572,8 @@ static int riscv_iommu_translate(RISCVIOMMUState *s, RISCVIOMMUContext *ctx,riscv_iommu_hpm_incr_ctr (s, ctx,RISCV_IOMMU_HPMEVENT_URQ ); iot_cache =g_hash_table_ref (s->iot_cache); -/* -* TC[32] is reserved for custom extensions, used here to temporarily -* enable automatic page-request generation for ATS queries. -*/ - enable_pri = (iotlb->perm ==IOMMU_NONE ) && (ctx->tc &BIT_ULL (32 )); + enable_pri = (iotlb->perm ==IOMMU_NONE ) && + (ctx->tc &RISCV_IOMMU_DC_TC_EN_PRI ); enable_pid = (ctx->tc &RISCV_IOMMU_DC_TC_PDTV );/* Check for ATS request. */
Signature · 1 line
2.48.1
Quoted 14 lines · Jay Chang
Replace the temporary custom extension bit (TC[32]) with the standard
EN_PRIbit defined in RISC-V IOMMU specification.Signed-off-by Jay Chang <[email protected]>Reviewed-by Frank Chang <[email protected]>--- hw/riscv/riscv-iommu.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)hw/riscv/riscv-iommu.c +0
-0
hw/riscv/riscv-iommu.c static int riscv_iommu_translate(RISCVIOMMUState *s, RISCVIOMMUContext *ctx, · line 1576
Quoted 10 lines
hw/riscv/riscv-iommu.c +2
-5@@ -1572,11 +1572,8 @@ static int riscv_iommu_translate(RISCVIOMMUState *s, RISCVIOMMUContext *ctx,riscv_iommu_hpm_incr_ctr (s, ctx,RISCV_IOMMU_HPMEVENT_URQ ); iot_cache =g_hash_table_ref (s->iot_cache); -/* -* TC[32] is reserved for custom extensions, used here to temporarily -* enable automatic page-request generation for ATS queries. -*/ - enable_pri = (iotlb->perm ==IOMMU_NONE ) && (ctx->tc &BIT_ULL (32 )); + enable_pri = (iotlb->perm ==IOMMU_NONE ) && + (ctx->tc &RISCV_IOMMU_DC_TC_EN_PRI );
Better to align with the first word on the right side of '='. Like:
+ enable_pri = (iotlb->perm == IOMMU_NONE) &&
+ (ctx->tc & RISCV_IOMMU_DC_TC_EN_PRI);
Otherwise,
Reviewed-by Nutty Liu <[email protected]>
Thanks,
Nutty
Quoted 3 lines
hw/riscv/riscv-iommu.c +0
-0enable_pid = (ctx->tc &RISCV_IOMMU_DC_TC_PDTV );/* Check for ATS request. */