hw/riscv/riscv-iommu: Use standard EN_PRI bit for PRI
PATCH v2 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]>
Reviewed-by Nutty Liu <[email protected]>
Change in V2:
Align code
Signed-off-by Jay 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 10 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]>Reviewed-by Nutty Liu <[email protected]>Change in V2:
Align code
In future don't include the changelog in the commit message please
Quoted 2 lines
Signed-off-by Jay Chang <[email protected]>
Reviewed-by Alistair Francis <[email protected]>
Alistair
Quoted 26 lines
--- hw/riscv/riscv-iommu.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)hw/riscv/riscv-iommu.c +2
-6@@ -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. */ --2.48.1
Alistair Francis
AppliedQuoted 4 lines · Jay Chang
Replace the temporary custom extension bit (TC[32]) with the standard
EN_PRIbit defined in RISC-V IOMMU specification.
Quoted 8 lines
Signed-off-by Jay Chang <[email protected]>Reviewed-by Frank Chang <[email protected]>Reviewed-by Nutty Liu <[email protected]>Change in V2:
Align codeSigned-off-by Jay Chang <[email protected]>
Thanks!
Applied to riscv-to-apply.next
Alistair
Quoted 26 lines
--- hw/riscv/riscv-iommu.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)hw/riscv/riscv-iommu.c +2
-6@@ -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. */ --2.48.1