File 6148455f-VT-d-PCI-segment-numbers-16-bits.patch of Package xen.21118
# Commit a3dd33e63c2c8c51102f223e6efe2e3d3bdcbec1
# Date 2021-09-20 10:25:03 +0200
# Author Jan Beulich <jbeulich@suse.com>
# Committer Jan Beulich <jbeulich@suse.com>
VT-d: PCI segment numbers are up to 16 bits wide
We shouldn't silently truncate respective values.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1536,7 +1536,8 @@ static int domain_context_mapping(struct
{
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 )
@@ -1739,7 +1740,8 @@ static int domain_context_unmap(struct d
struct acpi_drhd_unit *drhd;
struct 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);