Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use check_access_perms term #308

Merged
merged 1 commit into from
May 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion iommu_ref_model/libiommu/include/iommu_translate.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__
4 changes: 2 additions & 2 deletions iommu_ref_model/libiommu/src/iommu_msi_trans.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
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 @@ -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;

Expand Down
Loading