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

Fix IOVA bits 63:32 must be 0 check for SXL=1 #286

Merged
merged 1 commit into from
Mar 19, 2024
Merged
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
8 changes: 5 additions & 3 deletions iommu_ref_model/libiommu/src/iommu_two_stage_trans.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,11 @@ two_stage_address_translation(
}
// Instruction fetch addresses and load and store effective addresses,
// which are 64 bits, must have bits 63:<VASIZE> all equal to bit
// (VASIZE-1), or else a page-fault exception will occur.
// Do the address is canonical check
if ( masked_upper_bits != 0 && masked_upper_bits != mask ) goto page_fault;
// (VASIZE-1), or else a page-fault exception will occur - for SXL=0
// Do the address is canonical check - for SXL=0
// For SXL = 1 check bits 63:32 are all 0
if ( (masked_upper_bits != 0 && masked_upper_bits != mask && SXL == 0) ||
(masked_upper_bits != 0 && SXL == 1) ) goto page_fault;

i = LEVELS - 1;
a = iosatp.PPN * PAGESIZE;
Expand Down
Loading