]> xenbits.xensource.com Git - xen.git/commitdiff
VT-d: PCI segment numbers are up to 16 bits wide
authorJan Beulich <jbeulich@suse.com>
Fri, 15 Oct 2021 09:04:22 +0000 (11:04 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 15 Oct 2021 09:04:22 +0000 (11:04 +0200)
We shouldn't silently truncate respective values.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
master commit: a3dd33e63c2c8c51102f223e6efe2e3d3bdcbec1
master date: 2021-09-20 10:25:03 +0200

xen/drivers/passthrough/vtd/iommu.c

index be4eced660fbae552d6783ee02ce8b16752b47da..fbc749436be9160e4dc969e7fe7e80259cbefa67 100644 (file)
@@ -1471,7 +1471,8 @@ static int domain_context_mapping(struct domain *domain, u8 devfn,
 {
     struct acpi_drhd_unit *drhd;
     int ret = 0;
-    u8 seg = pdev->seg, bus = pdev->bus, secbus;
+    uint16_t seg = pdev->seg;
+    uint8_t bus = pdev->bus, secbus;
 
     drhd = acpi_find_matched_drhd_unit(pdev);
     if ( !drhd )
@@ -1681,7 +1682,8 @@ static int domain_context_unmap(struct domain *domain, u8 devfn,
     struct acpi_drhd_unit *drhd;
     struct vtd_iommu *iommu;
     int ret = 0;
-    u8 seg = pdev->seg, bus = pdev->bus, tmp_bus, tmp_devfn, secbus;
+    uint16_t seg = pdev->seg;
+    uint8_t bus = pdev->bus, tmp_bus, tmp_devfn, secbus;
     bool found;
 
     drhd = acpi_find_matched_drhd_unit(pdev);