Skip to contentSkip to conversation

x86/iommu: fix hwdom iommu requirements check

PATCH In review Roger Pau Monne 4 participants 4 messages Sep 28, 2019 – Sep 30, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/iommu: fix hwdom iommu requirements check

Both a shadow and a HAP hwdom require an iommu and must be run in strict mode. Change the HAP check into a hvm domain check.

---
 xen/drivers/passthrough/iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/drivers/passthrough/iommu.c +1 -1
index 8b550f909b..9ef5f376c5 100644
@@ -154,7 +154,7 @@ custom_param("dom0-iommu", parse_dom0_iommu_param);
 
 static void __hwdom_init check_hwdom_reqs(struct domain *d)
 {
-    if ( iommu_hwdom_none || !hap_enabled(d) )
+    if ( iommu_hwdom_none || !is_hvm_domain(d) )
         return;
 
     iommu_hwdom_passthrough = false;
Signature · 7 lines
2.23.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Reviewed-by on v1 1/1
#2 lore raw
In reply to Roger Pau Monne
Quoted 8 lines

-----Original Message-----
From: Roger Pau Monne <[email protected]>
Sent: 28 September 2019 09:27
To: [email protected]
Cc: Roger Pau Monne <[email protected]>; Jan Beulich <[email protected]>; Paul Durrant <[email protected]>; Juergen Gross <[email protected]>
Subject: [PATCH] x86/iommu: fix hwdom iommu requirements check

Quoted 4 lines

Both a shadow and a HAP hwdom require an iommu and must be run in strict mode. Change the HAP check into a hvm domain check.

Yes, I completely forgot that it is legitimate for a PVH dom0 to operate in shadow mode.

Quoted 18 lines
---
 xen/drivers/passthrough/iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/drivers/passthrough/iommu.c +1 -2
index 8b550f909b..9ef5f376c5 100644
@@ -154,7 +154,7 @@ custom_param("dom0-iommu", parse_dom0_iommu_param);
 
 static void __hwdom_init check_hwdom_reqs(struct domain *d)
 {
-    if ( iommu_hwdom_none || !hap_enabled(d) )
+    if ( iommu_hwdom_none || !is_hvm_domain(d) )
         return;
 
     iommu_hwdom_passthrough = false;
--
Quoted 1 line

2.23.0

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Acked-by
#3 lore raw
Quoted 8 lines · Paul Durrant
Quoted 8 lines

-----Original Message-----
From: Roger Pau Monne <[email protected]>
Sent: 28 September 2019 09:27
To: [email protected]
Cc: Roger Pau Monne <[email protected]>; Jan Beulich <[email protected]>; Paul Durrant <[email protected]>; Juergen Gross <[email protected]>
Subject: [PATCH] x86/iommu: fix hwdom iommu requirements check

Quoted 8 lines
Quoted 4 lines

Both a shadow and a HAP hwdom require an iommu and must be run in strict mode. Change the HAP check into a hvm domain check.

Yes, I completely forgot that it is legitimate for a PVH dom0 to operate in shadow mode.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel