[xen staging] xen/iommu: fix dev assignment on ARM after 91d4eca7

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[xen staging] xen/iommu: fix dev assignment on ARM after 91d4eca7

patchbot
commit 1292f9a05943d32ef96eabb9f0c30cf681665c46
Author:     Stefano Stabellini <[hidden email]>
AuthorDate: Tue Jan 8 10:47:19 2019 -0800
Commit:     Stefano Stabellini <[hidden email]>
CommitDate: Tue Jan 8 10:47:19 2019 -0800

    xen/iommu: fix dev assignment on ARM after 91d4eca7
   
    Fix device assignment on ARM after 91d4eca7 "mm / iommu: split
    need_iommu() into has_iommu_pt() and need_iommu_pt_sync()".
   
    arch_iommu_populate_page_table returns -ENOSYS which causes
    iommu_construct to return early, although it is not an error.
   
    hd->status needs to be set to IOMMU_STATUS_initializing before calling
    iommu_use_hap_pt, otherwise iommu_use_hap_pt will return the wrong
    value.
   
    Signed-off-by: Stefano Stabellini <[hidden email]>
    Reviewed-by: Paul Durrant <[hidden email]>
    Acked-by: Jan Beulich <[hidden email]>
---
 xen/drivers/passthrough/iommu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index caff3ab243..b06393d17d 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -266,11 +266,12 @@ int iommu_construct(struct domain *d)
     if ( hd->status == IOMMU_STATUS_initialized )
         return 0;
 
+    hd->status = IOMMU_STATUS_initializing;
+
     if ( !iommu_use_hap_pt(d) )
     {
         int rc;
 
-        hd->status = IOMMU_STATUS_initializing;
         hd->need_sync = true;
 
         rc = arch_iommu_populate_page_table(d);
--
generated by git-patchbot for /home/xen/git/xen.git#staging

_______________________________________________
Xen-changelog mailing list
[hidden email]
https://lists.xenproject.org/xen-changelog