intel_iommu: Do not report recoverable faults to host
PATCH 1/1 intel_iommu: Do not report recoverable faults to host
--- hw/i386/intel_iommu.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-)
hw/i386/intel_iommu.c +24 -2
@@ -1857,6 +1857,21 @@ static const bool vtd_qualified_faults[] = { [VTD_FR_MAX] = false, }; +static const bool vtd_recoverable_faults[] = { + [VTD_FR_WRITE ] = true, + [VTD_FR_READ ] = true, + [VTD_FR_PASID_DIR_ENTRY_P ] = true, + [VTD_FR_PASID_ENTRY_P ] = true, + [VTD_FR_FS_PAGING_ENTRY_INV ] = true, + [VTD_FR_FS_PAGING_ENTRY_P ] = true, + [VTD_FR_FS_PAGING_ENTRY_RSVD ] = true, + [VTD_FR_PASID_ENTRY_FSPTPTR_INV ] = true, + [VTD_FR_FS_NON_CANONICAL ] = true, + [VTD_FR_FS_PAGING_ENTRY_US ] = true, + [VTD_FR_SM_WRITE ] = true, + [VTD_FR_MAX ] = false, +}; +/* To see if a fault condition is "qualified", which is reported to software * only if the FPD field in the context-entry used to process the faulting * request is 0.
@@ -1866,6 +1881,11 @@ static inline bool vtd_is_qualified_fault(VTDFaultReason fault)return vtd_qualified_faults[fault]; } +static inline bool vtd_is_recoverable_fault (VTDFaultReason fault,int iommu_idx) +{ +return iommu_idx ==VTD_IDX_ATS && vtd_recoverable_faults[fault]; +} +static inline bool vtd_is_interrupt_addr (hwaddr addr) {return VTD_INTERRUPT_ADDR_FIRST <= addr && addr <=VTD_INTERRUPT_ADDR_LAST ;
@@ -2237,8 +2257,10 @@ static bool vtd_do_iommu_translate(VTDAddressSpace *vtd_as, PCIBus *bus, }if (ret_fr) { -vtd_report_fault (s, -ret_fr, is_fpd_set, source_id, - addr, is_write, pasid !=PCI_NO_PASID , pasid); +if (!vtd_is_recoverable_fault (-ret_fr, iommu_idx)) { +vtd_report_fault (s, -ret_fr, is_fpd_set, source_id, + addr, is_write, pasid !=PCI_NO_PASID , pasid); + } goto error; }
Signature · 1 line
2.53.0
Hi Clement,
Quoted 19 lines
-----Original Message-----
From: Clement Mathieu--Drif <[email protected]>
Subject: [PATCH]intel_iommu: Do not report recoverable faults to hostSigned-off-by Clement Mathieu--Drif <[email protected]>---
hw/i386/intel_iommu.c| 26 ++++++++++++++++++++++++--1 file changed, 24 insertions(+), 2 deletions(-)hw/i386/intel_iommu.c +2
-0@@ -1857,6 +1857,21 @@ static const bool vtd_qualified_faults[] = { [VTD_FR_MAX] = false, }; +static const bool vtd_recoverable_faults[] = { + [VTD_FR_WRITE ] = true,
hw/i386/intel_iommu.c static const bool vtd_qualified_faults[] = { · line 1871
Quoted 10 lines
hw/i386/intel_iommu.c +10
-0+ [VTD_FR_READ] = true, + [VTD_FR_PASID_DIR_ENTRY_P] = true, + [VTD_FR_PASID_ENTRY_P] = true, + [VTD_FR_FS_PAGING_ENTRY_INV] = true, + [VTD_FR_FS_PAGING_ENTRY_P] = true, + [VTD_FR_FS_PAGING_ENTRY_RSVD] = true, + [VTD_FR_PASID_ENTRY_FSPTPTR_INV] = true, + [VTD_FR_FS_NON_CANONICAL] = true, + [VTD_FR_FS_PAGING_ENTRY_US] = true, + [VTD_FR_SM_WRITE] = true,
Which fault reason is classified as recoverable fault? Is this documented somewhere?
Thanks
Zhenzhong
Quoted 36 lines
hw/i386/intel_iommu.c +8
-0+ [VTD_FR_MAX] = false, +}; +/* To see if a fault condition is "qualified", which is reported to software * only if the FPD field in the context-entry used to process the faulting * request is 0. @@ -1866,6 +1881,11 @@ static inline bool vtd_is_qualified_fault(VTDFaultReason fault) return vtd_qualified_faults[fault]; } +static inline bool vtd_is_recoverable_fault (VTDFaultReason fault,int iommu_idx) +{ +return iommu_idx ==VTD_IDX_ATS && vtd_recoverable_faults[fault]; +} +static inline bool vtd_is_interrupt_addr (hwaddr addr) {return VTD_INTERRUPT_ADDR_FIRST <= addr && addr <=
VTD_INTERRUPT_ADDR_LAST;hw/i386/intel_iommu.c +4
-3@@ -2237,8 +2257,10 @@ static boolvtd_do_iommu_translate (VTDAddressSpace *vtd_as, PCIBus *bus, } if (ret_fr) { - vtd_report_fault(s, -ret_fr, is_fpd_set, source_id, - addr, is_write, pasid != PCI_NO_PASID, pasid); + if (!vtd_is_recoverable_fault(-ret_fr, iommu_idx)) { + vtd_report_fault(s, -ret_fr, is_fpd_set, source_id, + addr, is_write, pasid != PCI_NO_PASID, pasid); + } goto error; } --2.53.0
Hi Zhenzhon,
Yes, you can have a look at table 26 of VT-d 4.1 or table 30 of VT-d 5.1.
These faults are descibed as follows:
"When remapping hardware detects a recoverable fault on a translation-request from Device-TLB, it is not reported to software as a fault. Instead, remapping hardware sends a successful translation completion with limited or no permission/privileges"
In the aforementioned tables, such erros contain mentions like "Success with R=W=U=S=0" or "Success with effective permission".
cmd
________________________________
From: Duan, Zhenzhong <[email protected]>
Sent: 09 February 2026 08:34
To: CLEMENT MATHIEU--DRIF <[email protected]>; [email protected] <[email protected]>
Cc: [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; Tian, Kevin <[email protected]>; Liu, Yi L <[email protected]>; [email protected] <[email protected]>
Subject: RE: [PATCH] intel_iommu: Do not report recoverable faults to host
Caution: External email. Do not open attachments or click links, unless this email comes from a known sender and you know the content is safe.
Hi Clement,
Quoted 19 lines
-----Original Message-----
From: Clement Mathieu--Drif <[email protected]>
Subject: [PATCH]intel_iommu: Do not report recoverable faults to hostSigned-off-by Clement Mathieu--Drif <[email protected]>---
hw/i386/intel_iommu.c| 26 ++++++++++++++++++++++++--1 file changed, 24 insertions(+), 2 deletions(-)hw/i386/intel_iommu.c +2
-0@@ -1857,6 +1857,21 @@ static const bool vtd_qualified_faults[] = { [VTD_FR_MAX] = false, }; +static const bool vtd_recoverable_faults[] = { + [VTD_FR_WRITE ] = true,
hw/i386/intel_iommu.c static const bool vtd_qualified_faults[] = { · line 1871
Quoted 10 lines
hw/i386/intel_iommu.c +10
-0+ [VTD_FR_READ] = true, + [VTD_FR_PASID_DIR_ENTRY_P] = true, + [VTD_FR_PASID_ENTRY_P] = true, + [VTD_FR_FS_PAGING_ENTRY_INV] = true, + [VTD_FR_FS_PAGING_ENTRY_P] = true, + [VTD_FR_FS_PAGING_ENTRY_RSVD] = true, + [VTD_FR_PASID_ENTRY_FSPTPTR_INV] = true, + [VTD_FR_FS_NON_CANONICAL] = true, + [VTD_FR_FS_PAGING_ENTRY_US] = true, + [VTD_FR_SM_WRITE] = true,
Which fault reason is classified as recoverable fault? Is this documented somewhere?
Thanks
Zhenzhong
Quoted 36 lines
hw/i386/intel_iommu.c +8
-0+ [VTD_FR_MAX] = false, +}; +/* To see if a fault condition is "qualified", which is reported to software * only if the FPD field in the context-entry used to process the faulting * request is 0. @@ -1866,6 +1881,11 @@ static inline bool vtd_is_qualified_fault(VTDFaultReason fault) return vtd_qualified_faults[fault]; } +static inline bool vtd_is_recoverable_fault (VTDFaultReason fault,int iommu_idx) +{ +return iommu_idx ==VTD_IDX_ATS && vtd_recoverable_faults[fault]; +} +static inline bool vtd_is_interrupt_addr (hwaddr addr) {return VTD_INTERRUPT_ADDR_FIRST <= addr && addr <=
VTD_INTERRUPT_ADDR_LAST;hw/i386/intel_iommu.c +4
-3@@ -2237,8 +2257,10 @@ static boolvtd_do_iommu_translate (VTDAddressSpace *vtd_as, PCIBus *bus, } if (ret_fr) { - vtd_report_fault(s, -ret_fr, is_fpd_set, source_id, - addr, is_write, pasid != PCI_NO_PASID, pasid); + if (!vtd_is_recoverable_fault(-ret_fr, iommu_idx)) { + vtd_report_fault(s, -ret_fr, is_fpd_set, source_id, + addr, is_write, pasid != PCI_NO_PASID, pasid); + } goto error; } --2.53.0
Duan, Zhenzhong
Reviewed-byThanks Clement.
From: CLEMENT MATHIEU--DRIF <[email protected]>
Sent: Monday, February 9, 2026 4:42 PM
To: Duan, Zhenzhong <[email protected]>; [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Tian, Kevin <[email protected]>; Liu, Yi L <[email protected]>; [email protected]
Subject: Re: [PATCH] intel_iommu: Do not report recoverable faults to host
Hi Zhenzhon,
Yes, you can have a look at table 26 of VT-d 4.1 or table 30 of VT-d 5.1.
These faults are descibed as follows:
"When remapping hardware detects a recoverable fault on a translation-request from Device-TLB, it is not reported to software as a fault. Instead, remapping hardware sends a successful translation completion with limited or no permission/privileges"
In the aforementioned tables, such erros contain mentions like "Success with R=W=U=S=0" or "Success with effective permission".
cmd
________________________________
From: Duan, Zhenzhong <[email protected]<mailto:[email protected]>>
Sent: 09 February 2026 08:34
To: CLEMENT MATHIEU--DRIF <[email protected]<mailto:[email protected]>>; [email protected]<mailto:[email protected]> <[email protected]<mailto:[email protected]>>
Cc: [email protected]<mailto:[email protected]> <[email protected]<mailto:[email protected]>>; [email protected]<mailto:[email protected]> <[email protected]<mailto:[email protected]>>; [email protected]<mailto:[email protected]> <[email protected]<mailto:[email protected]>>; [email protected]<mailto:[email protected]> <[email protected]<mailto:[email protected]>>; [email protected]<mailto:[email protected]> <[email protected]<mailto:[email protected]>>; Tian, Kevin <[email protected]<mailto:[email protected]>>; Liu, Yi L <[email protected]<mailto:[email protected]>>; [email protected]<mailto:[email protected]> <[email protected]<mailto:[email protected]>>
Subject: RE: [PATCH] intel_iommu: Do not report recoverable faults to host
Caution: External email. Do not open attachments or click links, unless this email comes from a known sender and you know the content is safe.
Hi Clement,
Quoted 19 lines
-----Original Message-----
From: Clement Mathieu--Drif <[email protected]<mailto:[email protected]>>
Subject: [PATCH]intel_iommu: Do not report recoverable faults to host---
hw/i386/intel_iommu.c| 26 ++++++++++++++++++++++++--1 file changed, 24 insertions(+), 2 deletions(-)hw/i386/intel_iommu.c +2
-0@@ -1857,6 +1857,21 @@ static const bool vtd_qualified_faults[] = { [VTD_FR_MAX] = false, }; +static const bool vtd_recoverable_faults[] = { + [VTD_FR_WRITE ] = true,
hw/i386/intel_iommu.c static const bool vtd_qualified_faults[] = { · line 1871
Quoted 10 lines
hw/i386/intel_iommu.c +10
-0+ [VTD_FR_READ] = true, + [VTD_FR_PASID_DIR_ENTRY_P] = true, + [VTD_FR_PASID_ENTRY_P] = true, + [VTD_FR_FS_PAGING_ENTRY_INV] = true, + [VTD_FR_FS_PAGING_ENTRY_P] = true, + [VTD_FR_FS_PAGING_ENTRY_RSVD] = true, + [VTD_FR_PASID_ENTRY_FSPTPTR_INV] = true, + [VTD_FR_FS_NON_CANONICAL] = true, + [VTD_FR_FS_PAGING_ENTRY_US] = true, + [VTD_FR_SM_WRITE] = true,
Which fault reason is classified as recoverable fault? Is this documented somewhere?
Thanks
Zhenzhong
Quoted 36 lines
hw/i386/intel_iommu.c +8
-0+ [VTD_FR_MAX] = false, +}; +/* To see if a fault condition is "qualified", which is reported to software * only if the FPD field in the context-entry used to process the faulting * request is 0. @@ -1866,6 +1881,11 @@ static inline bool vtd_is_qualified_fault(VTDFaultReason fault) return vtd_qualified_faults[fault]; } +static inline bool vtd_is_recoverable_fault (VTDFaultReason fault,int iommu_idx) +{ +return iommu_idx ==VTD_IDX_ATS && vtd_recoverable_faults[fault]; +} +static inline bool vtd_is_interrupt_addr (hwaddr addr) {return VTD_INTERRUPT_ADDR_FIRST <= addr && addr <=
VTD_INTERRUPT_ADDR_LAST;hw/i386/intel_iommu.c +4
-3@@ -2237,8 +2257,10 @@ static boolvtd_do_iommu_translate (VTDAddressSpace *vtd_as, PCIBus *bus, } if (ret_fr) { - vtd_report_fault(s, -ret_fr, is_fpd_set, source_id, - addr, is_write, pasid != PCI_NO_PASID, pasid); + if (!vtd_is_recoverable_fault(-ret_fr, iommu_idx)) { + vtd_report_fault(s, -ret_fr, is_fpd_set, source_id, + addr, is_write, pasid != PCI_NO_PASID, pasid); + } goto error; } --2.53.0