Skip to contentSkip to conversation

iommu: fix arm build after e9be34be5

PATCH In review Wei Liu 4 participants 6 messages Oct 9, 2018 – Oct 10, 2018

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

PATCH 1/1 iommu: fix arm build after e9be34be5

The function iommu_share_p2m_table is used by both ARM and x86 but hap_enabled macro is x86 only. Put the ASSERT under CONFIG_X86.

---
 xen/drivers/passthrough/iommu.c | 2 ++
 1 file changed, 2 insertions(+)
xen/drivers/passthrough/iommu.c +2 -0
index e03de6e3ab..8b438ae4bc 100644
@@ -505,7 +505,9 @@ int iommu_do_domctl(
 
 void iommu_share_p2m_table(struct domain* d)
 {
+#ifdef CONFIG_X86
     ASSERT(hap_enabled(d));
+#endif
     /*
      * iommu_use_hap_pt(d) cannot be used here because during domain
      * construction need_iommu(d) will always return false here.
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Wei Liu

The function iommu_share_p2m_table is used by both ARM and x86 but hap_enabled macro is x86 only. Put the ASSERT under CONFIG_X86.

I had a patch to just remove the ASSERT, but that's fine also.

Thanks!

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

#2 lore raw
In reply to Wei Liu
Quoted 11 lines

-----Original Message-----
From: Xen-devel [mailto:[email protected]] On Behalf Of Wei Liu
Sent: 09 October 2018 19:58
To: [email protected]
Cc: Wei Liu <[email protected]>; Jan Beulich <[email protected]>; Roger Pau Monne <[email protected]>
Subject: [Xen-devel] [PATCH] iommu: fix arm build after e9be34be5

The function iommu_share_p2m_table is used by both ARM and x86 but hap_enabled macro is x86 only. Put the ASSERT under CONFIG_X86.

Would it be unreasonable to make hap_enabled() common and define it to true for ARM?

Paul

Quoted 25 lines
---
 xen/drivers/passthrough/iommu.c | 2 ++
 1 file changed, 2 insertions(+)
xen/drivers/passthrough/iommu.c +2 -1
index e03de6e3ab..8b438ae4bc 100644
@@ -505,7 +505,9 @@ int iommu_do_domctl(
 
 void iommu_share_p2m_table(struct domain* d)
 {
+#ifdef CONFIG_X86
     ASSERT(hap_enabled(d));
+#endif
     /*
      * iommu_use_hap_pt(d) cannot be used here because during domain
      * construction need_iommu(d) will always return false here.
--

2.11.0

Quoted 4 lines

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

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

#3 lore raw
Quoted 9 lines · Paul Durrant
Quoted 9 lines

-----Original Message-----
From: Xen-devel [mailto:[email protected]] On Behalf Of Wei Liu
Sent: 09 October 2018 19:58
To: [email protected]
Cc: Wei Liu <[email protected]>; Jan Beulich <[email protected]>; Roger Pau Monne <[email protected]>
Subject: [Xen-devel] [PATCH] iommu: fix arm build after e9be34be5

Quoted 4 lines
Quoted 2 lines

The function iommu_share_p2m_table is used by both ARM and x86 but hap_enabled macro is x86 only. Put the ASSERT under CONFIG_X86.

Would it be unreasonable to make hap_enabled() common and define it to true for ARM?

I assumed hap_enabled was hardcoded to true for ARM, but it's only used in x86 code and vm_event so far (and here now), so I'm not sure if it's worth it.

In any case, I think this should go in as it fixes the build, and adding hap_enabled for ARM can be done later.

Roger.

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

#4 lore raw
Quoted 24 lines

-----Original Message-----
From: Roger Pau Monne
Sent: 10 October 2018 10:13
To: Paul Durrant <[email protected]>
Cc: Wei Liu <[email protected]>; [email protected]; Jan Beulich <[email protected]>
Subject: Re: [Xen-devel] [PATCH] iommu: fix arm build after e9be34be5

Quoted 2 lines · Paul Durrant
Quoted 2 lines

-----Original Message-----
From: Xen-devel [mailto:[email protected]] On

Behalf

Quoted 4 lines
Quoted 4 lines

Of Wei Liu
Sent: 09 October 2018 19:58
To: [email protected]
Cc: Wei Liu <[email protected]>; Jan Beulich <[email protected]>;

Roger

Quoted 7 lines
Quoted 5 lines

Pau Monne <[email protected]>
Subject: [Xen-devel] [PATCH] iommu: fix arm build after e9be34be5

The function iommu_share_p2m_table is used by both ARM and x86 but hap_enabled macro is x86 only. Put the ASSERT under CONFIG_X86.

Would it be unreasonable to make hap_enabled() common and define it to

Quoted 9 lines

true for ARM?

I assumed hap_enabled was hardcoded to true for ARM, but it's only used in x86 code and vm_event so far (and here now), so I'm not sure if it's worth it.

In any case, I think this should go in as it fixes the build, and adding hap_enabled for ARM can be done later.

Oh yes. It can certainly be tidied later.

Paul

Quoted 1 line

Roger.

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

Acked-by on v1 1/1
#5 lore raw
In reply to Wei Liu
Quoted 5 lines
Quoted 1 line
Quoted 1 line · On 09.10.18 at 20:58, <[email protected]> wrote:

The function iommu_share_p2m_table is used by both ARM and x86 but hap_enabled macro is x86 only. Put the ASSERT under CONFIG_X86.

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