Skip to content

Commit

Permalink
Merge pull request #432 from ved-rivos/0926_1
Browse files Browse the repository at this point in the history
Fix PF vs. GPF priority
  • Loading branch information
ved-rivos authored Sep 26, 2024
2 parents 4d7fad2 + bd5b4f6 commit 97f18bb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 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 @@ -302,12 +302,12 @@ two_stage_address_translation(
// – If the comparison fails, return to step 2
if ( (pte->A == 1) && ( (pte->D == 1) || (is_write == 0) || (pte->W == 0) ) ) goto step_8;

// If G-stage does not provide write permission then cause guest page fault
if ( gpte.W == 0 ) goto guest_page_fault;

// A and/or D bit update needed
if ( SADE == 0 ) goto page_fault;

// If G-stage does not provide write permission then cause guest page fault
if ( gpte.W == 0 ) goto guest_page_fault;

// Count S/VS stage page walks
count_events(PV, PID, PSCV, PSCID, DID, GV, GSCID, S_VS_PT_WALKS);
amo_pte.raw = 0;
Expand Down

0 comments on commit 97f18bb

Please sign in to comment.