[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen staging] amd/iommu: assign iommu devices to Xen



commit b6bd02b7a877f9fac2de69e64d8245d56f92ab25
Author:     Roger Pau Monné <roger.pau@xxxxxxxxxx>
AuthorDate: Fri Nov 30 12:09:09 2018 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Fri Nov 30 12:09:09 2018 +0100

    amd/iommu: assign iommu devices to Xen
    
    AMD IOMMU devices are exposed on the PCI bus, and thus are assigned by
    default to the hardware domain. This can cause issues because the
    IOMMU devices themselves are not behind an IOMMU, so update_paging_mode will
    return an error if Xen tries to expand the page tables of a domain
    that has assigned devices not behind an IOMMU. update_paging_mode
    failing will cause the domain to be destroyed.
    
    Fix this by hiding PCI IOMMU devices, so they are not assigned to the
    hardware domain.
    
    Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
    Acked-by: Brian Woods <brian.woods@xxxxxxx>
---
 xen/drivers/passthrough/amd/iommu_init.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/drivers/passthrough/amd/iommu_init.c 
b/xen/drivers/passthrough/amd/iommu_init.c
index 15c10b0929..17f39552a9 100644
--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -993,6 +993,8 @@ static void * __init allocate_ppr_log(struct amd_iommu 
*iommu)
 
 static int __init amd_iommu_init_one(struct amd_iommu *iommu)
 {
+    pci_hide_device(iommu->seg, PCI_BUS(iommu->bdf), PCI_DEVFN2(iommu->bdf));
+
     if ( map_iommu_mmio_region(iommu) != 0 )
         goto error_out;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.