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

[PATCH] IOMMU/x86: fix build with old gcc after IO-APIC RTE changes


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 16 Aug 2023 11:51:41 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=6H3/85fsNAFw/guO2vvs++wKfCZQ297B6+Y0exOgXnU=; b=L8mwN05r3/Wty17XhiEtxlhHLkeRHUaRnmDeeWzbcQIY5HDNzL/a+GlcwDwAV7AQrfFmKHf206rq33qA9qW7bvs0kTBZJkVWOzBVKELOqXuTZ2Gv+GS9FfHccDQSxpL7T8YtDBa66QVxHfbz+1qIanD6Xv1qrf43YyQj4Xq1SZyGp7A2WzEUulS1KlFyZnqSW6cNtjOVkoGOku7BzVG152jFenqpAvdKBXE3muyEmtD4lfYQU/j6vRQl02fjRFaC3YQShmkEkKBuqXg+nrgEVembGAmNGp54DkZ3e/qda0CntbhBLnoipTTWsOcz5+1he03QFOe1q9kuf/KEV12vnw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mSdAW+HbWQtYEH7JU6CNBs6mItdDFTtQSLd7cchZm9djtfVgxbHUGqOdJzgxSZ9ryaUIBrdtuyE9/WCgYuEyzb5VAgpH4yMEwOVpW0m7fHQVe/TQsB2OBQzpR2XntvfMrFLn9QymF5LIIl5hfMuKEzfHmU4kLQyYsnT6vgnA+vhJAzRvg5FxQ+sPtZzAmypqxOwU9UrvqsYqVJkd68BoCN6TCrqiFMublJvkVQfd27c30LJhEbuMuGz9V0TaNl/IcuZFCKUg4nCDCxjGZvkt0ZlPkq+v21EVSV95B6yzPNHh3pU1xU+ikyTNGjWbro7JFOdwcCXTFbLPi6QD5KsAGA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Kevin Tian <kevin.tian@xxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Wed, 16 Aug 2023 09:51:49 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Old gcc won't cope with initializers involving unnamed struct/union
fields.

Fixes: 3e033172b025 ("x86/iommu: pass full IO-APIC RTE for remapping table 
update")
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/xen/drivers/passthrough/amd/iommu_intr.c
+++ b/xen/drivers/passthrough/amd/iommu_intr.c
@@ -321,8 +321,7 @@ static int update_intremap_entry_from_io
 void cf_check amd_iommu_ioapic_update_ire(
     unsigned int apic, unsigned int pin, uint64_t rte)
 {
-    struct IO_APIC_route_entry old_rte;
-    struct IO_APIC_route_entry new_rte = { .raw = rte };
+    struct IO_APIC_route_entry old_rte, new_rte;
     int seg, bdf, rc;
     struct amd_iommu *iommu;
     unsigned int idx;
@@ -331,6 +330,9 @@ void cf_check amd_iommu_ioapic_update_ir
     if ( idx == MAX_IO_APICS )
         return;
 
+    /* Not the initializer, for old gcc to cope. */
+    new_rte.raw = rte;
+
     /* get device id of ioapic devices */
     bdf = ioapic_sbdf[idx].bdf;
     seg = ioapic_sbdf[idx].seg;
--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -432,8 +432,7 @@ unsigned int cf_check io_apic_read_remap
 void cf_check io_apic_write_remap_rte(
     unsigned int apic, unsigned int pin, uint64_t rte)
 {
-    struct IO_xAPIC_route_entry new_rte = { .raw = rte };
-    struct IO_xAPIC_route_entry old_rte = { };
+    struct IO_xAPIC_route_entry old_rte = { }, new_rte;
     struct vtd_iommu *iommu = ioapic_to_iommu(IO_APIC_ID(apic));
     bool masked = true;
     int rc;
@@ -453,6 +452,9 @@ void cf_check io_apic_write_remap_rte(
         }
     }
 
+    /* Not the initializer, for old gcc to cope. */
+    new_rte.raw = rte;
+
     rc = ioapic_rte_to_remap_entry(iommu, apic, pin, &old_rte, new_rte);
     if ( rc )
     {



 


Rackspace

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