Skip to content

Commit

Permalink
Merge pull request #480 from ved-rivos/0214
Browse files Browse the repository at this point in the history
G should be returned only if PASID present
  • Loading branch information
ved-rivos authored Feb 14, 2025
2 parents 5cce4f2 + 17fff95 commit aac13c1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions iommu_ref_model/libiommu/src/iommu_second_stage_trans.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ second_stage_address_translation(
// No translation or protection.
gpte->raw = 0;
gpte->PPN = gpa / PAGESIZE;
gpte->D = gpte->A = gpte->G = gpte->U = 1;
gpte->D = gpte->A = gpte->U = 1;
gpte->X = gpte->W = gpte->R = gpte->V = 1;
gpte->N = 0;
gpte->N = gpte->G = 0;
gpte->PBMT = PMA;
// The translation range size returned in a Success response to
// an ATS translation request, when either stages of address
Expand Down
2 changes: 1 addition & 1 deletion iommu_ref_model/libiommu/src/iommu_translate.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ iommu_translate_iova(
((vs_pte.PBMT != PMA) || (is_msi == 1) || (DC.tc.T2GPA == 1))) ? 1 : 0;
rsp_msg->trsp.N = 0;
rsp_msg->trsp.AMA = 0;
rsp_msg->trsp.Global = vs_pte.G;
rsp_msg->trsp.Global = req->pid_valid ? vs_pte.G : 0;
rsp_msg->trsp.U = (is_msi & is_mrif);
rsp_msg->trsp.R = (vs_pte.R & g_pte.R);
rsp_msg->trsp.W = (vs_pte.W & g_pte.W & vs_pte.D & g_pte.D);
Expand Down
4 changes: 2 additions & 2 deletions iommu_ref_model/libiommu/src/iommu_two_stage_trans.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ two_stage_address_translation(
i = 0;
pte->raw = 0;
pte->PPN = 0;
pte->D = pte->A = pte->G = pte->U = 1;
pte->D = pte->A = pte->U = 1;
pte->X = pte->W = pte->R = pte->V = 1;
pte->N = 0;
pte->N = pte->G = 0;
pte->PBMT = PMA;
*pa = iova;
// The translation range size returned in a Success response to
Expand Down

0 comments on commit aac13c1

Please sign in to comment.