diff --git a/iommu_ref_model/libiommu/include/iommu_translate.h b/iommu_ref_model/libiommu/include/iommu_translate.h index 7e8bb318..e9a096c6 100644 --- a/iommu_ref_model/libiommu/include/iommu_translate.h +++ b/iommu_ref_model/libiommu/include/iommu_translate.h @@ -113,6 +113,6 @@ msi_address_translation( uint64_t gpa, uint8_t is_exec, device_context_t *DC, uint8_t *is_msi, uint8_t *is_mrif, uint32_t *mrif_nid, uint64_t *dest_mrif_addr, uint32_t *cause, uint64_t *iotval2, uint64_t *pa, - uint64_t *page_sz, gpte_t *g_pte, uint8_t TTYP ); + uint64_t *page_sz, gpte_t *g_pte, uint8_t check_access_perms ); #endif // __IOMMU_TRANSLATE_H__ diff --git a/iommu_ref_model/libiommu/src/iommu_msi_trans.c b/iommu_ref_model/libiommu/src/iommu_msi_trans.c index ac61b497..703dd31d 100644 --- a/iommu_ref_model/libiommu/src/iommu_msi_trans.c +++ b/iommu_ref_model/libiommu/src/iommu_msi_trans.c @@ -21,7 +21,7 @@ msi_address_translation( uint64_t gpa, uint8_t is_exec, device_context_t *DC, uint8_t *is_msi, uint8_t *is_mrif, uint32_t *mrif_nid, uint64_t *dest_mrif_addr, uint32_t *cause, uint64_t *iotval2, uint64_t *pa, - uint64_t *page_sz, gpte_t *g_pte, uint8_t TTYP ) { + uint64_t *page_sz, gpte_t *g_pte, uint8_t check_access_perms ) { uint64_t A, m, I; uint8_t status; @@ -170,7 +170,7 @@ msi_address_translation( // transaction is treated as not requesting supervisor privilege. // a. If the transaction is a Untranslated or Translated read-for-execute then stop // and report "Instruction acccess fault" (cause = 1). - if ( is_exec && TTYP != PCIE_ATS_TRANSLATION_REQUEST ) { + if ( is_exec == 1 && check_access_perms == 1 ) { *cause = 1; return 1; } diff --git a/iommu_ref_model/libiommu/src/iommu_translate.c b/iommu_ref_model/libiommu/src/iommu_translate.c index cae1b77a..a4fea504 100644 --- a/iommu_ref_model/libiommu/src/iommu_translate.c +++ b/iommu_ref_model/libiommu/src/iommu_translate.c @@ -297,7 +297,7 @@ iommu_translate_iova( // If a fault is detected by the MSI address translation process then stop and // report the fault else the process continues at step 20. if ( msi_address_translation(gpa, is_exec, &DC, &is_msi, &is_mrif, &mrif_nid, &dest_mrif_addr, - &cause, &iotval2, &pa, &gst_page_sz, &g_pte, TTYP) ) + &cause, &iotval2, &pa, &gst_page_sz, &g_pte, check_access_perms) ) goto stop_and_report_fault; if ( is_msi == 1 ) goto skip_gpa_trans;