diff --git a/iommu_ref_model/libiommu/src/iommu_ats.c b/iommu_ref_model/libiommu/src/iommu_ats.c index dc9625e3..21123a08 100644 --- a/iommu_ref_model/libiommu/src/iommu_ats.c +++ b/iommu_ref_model/libiommu/src/iommu_ats.c @@ -147,15 +147,17 @@ handle_page_request( // a. `ddtp.iommu_mode` is `2LVL` and `DDI[2]` is not 0 // b. `ddtp.iommu_mode` is `1LVL` and either `DDI[2]` is not 0 or `DDI[1]` is not 0 if ( g_reg_file.ddtp.iommu_mode == DDT_2LVL && DDI[2] != 0 ) { - report_fault(260, PAGE_REQ_MSG_CODE, 0, PCIE_MESSAGE_REQUEST, 0, + cause = 260; // "Transaction type disallowed" + report_fault(cause, PAGE_REQ_MSG_CODE, 0, PCIE_MESSAGE_REQUEST, 0, device_id, pr->PV, pr->PID, pr->PRIV); - response_code = RESPONSE_FAILURE; + response_code = INVALID_REQUEST; goto send_prgr; } if ( g_reg_file.ddtp.iommu_mode == DDT_1LVL && (DDI[2] != 0 || DDI[1] != 0) ) { - report_fault(260, PAGE_REQ_MSG_CODE, 0, PCIE_MESSAGE_REQUEST, 0, + cause = 260; // "Transaction type disallowed" + report_fault(cause, PAGE_REQ_MSG_CODE, 0, PCIE_MESSAGE_REQUEST, 0, device_id, pr->PV, pr->PID, pr->PRIV); - response_code = RESPONSE_FAILURE; + response_code = INVALID_REQUEST; goto send_prgr; } // To process a "Page Request" or "Stop Marker" message, the IOMMU first diff --git a/iommu_ref_model/test/test_app.c b/iommu_ref_model/test/test_app.c index 3666ef13..9163c41b 100644 --- a/iommu_ref_model/test/test_app.c +++ b/iommu_ref_model/test/test_app.c @@ -204,7 +204,7 @@ main(void) { exp_msg.EXEC_REQ = 0; exp_msg.DSV = 1; exp_msg.DSEG = 0x43; - exp_msg.PAYLOAD = (0x1234UL << 48UL) | (RESPONSE_FAILURE << 44UL); + exp_msg.PAYLOAD = (0x1234UL << 48UL) | (INVALID_REQUEST << 44UL); handle_page_request(&pr); fail_if( ( exp_msg_received == 0 ) ); fail_if( ( check_msg_faults(260, pr.PV, pr.PID, pr.PRIV, 0x431234, PAGE_REQ_MSG_CODE) < 0 ) ); @@ -233,7 +233,7 @@ main(void) { exp_msg.EXEC_REQ = 0; exp_msg.DSV = 1; exp_msg.DSEG = 0x43; - exp_msg.PAYLOAD = (0x1234UL << 48UL) | (RESPONSE_FAILURE << 44UL); + exp_msg.PAYLOAD = (0x1234UL << 48UL) | (INVALID_REQUEST << 44UL); handle_page_request(&pr); fail_if( ( exp_msg_received == 0 ) ); fail_if( ( check_msg_faults(260, pr.PV, pr.PID, pr.PRIV, 0x431234, PAGE_REQ_MSG_CODE) < 0 ) ); @@ -259,7 +259,7 @@ main(void) { exp_msg.EXEC_REQ = 0; exp_msg.DSV = 1; exp_msg.DSEG = 0x43; - exp_msg.PAYLOAD = (0x1234UL << 48UL) | (RESPONSE_FAILURE << 44UL); + exp_msg.PAYLOAD = (0x1234UL << 48UL) | (INVALID_REQUEST << 44UL); handle_page_request(&pr); fail_if( ( exp_msg_received == 0 ) ); fail_if( ( check_msg_faults(260, pr.PV, pr.PID, pr.PRIV, 0x431234, PAGE_REQ_MSG_CODE) < 0 ) );