diff --git a/iommu_ref_model/libiommu/src/iommu_second_stage_trans.c b/iommu_ref_model/libiommu/src/iommu_second_stage_trans.c index 77a6985..f486181 100644 --- a/iommu_ref_model/libiommu/src/iommu_second_stage_trans.c +++ b/iommu_ref_model/libiommu/src/iommu_second_stage_trans.c @@ -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 diff --git a/iommu_ref_model/libiommu/src/iommu_translate.c b/iommu_ref_model/libiommu/src/iommu_translate.c index 045568a..2751f09 100644 --- a/iommu_ref_model/libiommu/src/iommu_translate.c +++ b/iommu_ref_model/libiommu/src/iommu_translate.c @@ -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); diff --git a/iommu_ref_model/libiommu/src/iommu_two_stage_trans.c b/iommu_ref_model/libiommu/src/iommu_two_stage_trans.c index 4f7eb5e..c979fc7 100644 --- a/iommu_ref_model/libiommu/src/iommu_two_stage_trans.c +++ b/iommu_ref_model/libiommu/src/iommu_two_stage_trans.c @@ -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