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

[PATCH] AMD/IOMMU: drop tasklet handler forward declaration


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 2 Nov 2023 15:23:42 +0100
  • 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=327YiGjoXN6nCav2A9E9WBoxK7xf1O/U0swjGWj2UwU=; b=GGXtTFdc82qDPjXWPMn6nKvp5L1nS5/QSq7WKBgmHDgbE8dfqFBqDmK/L+Vr1LtJODCwGhg3nmlF2cDvz+vy4336G2fqbRiMZBAsnl9wGBUYJrimdC7UO5pyYNxNyUXc+eOsCwC36NViInKoDjEAeCVfpl0P2R2GtUwsSuwzSee5BC0hzl2ZAIoiGoQacu4dSzyaPDjVQpjo1wNOkwMfGtwrMk3vFgG1T9/UojKlyP0zLxexQFpL83EIea/O3Dco+nE9028NtLTjqK7qGSO3MTVzcWlm4ZpbSN3ZXJGfO4EJkdy9J/uSbV+dJ/zYp3vGj5wUi0bgwaIVfl2IPg96zg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZAqF0W4YlxaXCs68tmNkYz0bAJU4z4PDHozCd5ICSyL0XcLyS2Gj0lkoOlEqq9EAEcGUoLCB0VEzElqtAcfK0l/FUAt1DvnO05BTCuMLnnUYjONadJKy09xqoaFD0zciG8Q+CK1JPrJ2Xzr7bxzr99KYoIXB/zcSqRydBK727lAkCh4keP0fZu+4ZRMeiAWjtaXX4BHYFnPvCDshLN+i4zkMUktSgWeNneaXl/AFwUqZHKZNsQCo9hZxHpVmynM9fs90Fw5ub7f5LtMefpXSX2v5mKfrmxxDQQjuHNsyjXG9IoFD65EKD3VTTHQn77ylR3xP9YpAMsHDegEa+v1EdQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Federico Serafini <federico.serafini@xxxxxxxxxxx>
  • Delivery-date: Thu, 02 Nov 2023 14:24:31 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

do_amd_iommu_irq()'s forward declaration uses a parameter name different
from what the definition uses, thus vioating Misra C:2012 rule 8.3. We
can get away without such a forward declaration if instead we forward-
declare amd_iommu_irq_tasklet, putting its initialization past the
handler function's definition.

No functional change.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---
We could even get away without forward-declaring amd_iommu_irq_tasklet,
by using softirq_tasklet_init in e.g. amd_iomm_prepare() or
amd_iommu_init(), much like VT-d code does. Still that's code that can
be avoided, even if (in the final binary) that code ends up in
.init.text, and hence will be discarded when booting completes. IOW I'd
instead be inclined to make VT-d code match what is being switched to
here.

--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -26,8 +26,7 @@
 static int __initdata nr_amd_iommus;
 static bool __initdata pci_init;
 
-static void cf_check do_amd_iommu_irq(void *data);
-static DECLARE_SOFTIRQ_TASKLET(amd_iommu_irq_tasklet, do_amd_iommu_irq, NULL);
+static struct tasklet amd_iommu_irq_tasklet;
 
 unsigned int __read_mostly amd_iommu_acpi_info;
 unsigned int __read_mostly ivrs_bdf_entries;
@@ -715,6 +714,8 @@ static void cf_check do_amd_iommu_irq(vo
     }
 }
 
+static DECLARE_SOFTIRQ_TASKLET(amd_iommu_irq_tasklet, do_amd_iommu_irq, NULL);
+
 static void cf_check iommu_interrupt_handler(
     int irq, void *dev_id, struct cpu_user_regs *regs)
 {



 


Rackspace

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