From patchwork Thu Nov 2 14:23:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13443803 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5C1F4C4332F for ; Thu, 2 Nov 2023 14:24:42 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.626925.977646 (Exim 4.92) (envelope-from ) id 1qyYcP-0008Sc-4z; Thu, 02 Nov 2023 14:24:21 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 626925.977646; Thu, 02 Nov 2023 14:24:21 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qyYcP-0008SV-27; Thu, 02 Nov 2023 14:24:21 +0000 Received: by outflank-mailman (input) for mailman id 626925; Thu, 02 Nov 2023 14:24:19 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qyYcN-0008SP-UR for xen-devel@lists.xenproject.org; Thu, 02 Nov 2023 14:24:19 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2070.outbound.protection.outlook.com [40.107.7.70]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 82332957-798b-11ee-98d6-6d05b1d4d9a1; Thu, 02 Nov 2023 15:24:18 +0100 (CET) Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23) by VI1PR04MB7007.eurprd04.prod.outlook.com (2603:10a6:803:13e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.16; Thu, 2 Nov 2023 14:23:48 +0000 Received: from DU2PR04MB8790.eurprd04.prod.outlook.com ([fe80::d924:b650:a2ad:7b25]) by DU2PR04MB8790.eurprd04.prod.outlook.com ([fe80::d924:b650:a2ad:7b25%3]) with mapi id 15.20.6954.019; Thu, 2 Nov 2023 14:23:44 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 82332957-798b-11ee-98d6-6d05b1d4d9a1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZAqF0W4YlxaXCs68tmNkYz0bAJU4z4PDHozCd5ICSyL0XcLyS2Gj0lkoOlEqq9EAEcGUoLCB0VEzElqtAcfK0l/FUAt1DvnO05BTCuMLnnUYjONadJKy09xqoaFD0zciG8Q+CK1JPrJ2Xzr7bxzr99KYoIXB/zcSqRydBK727lAkCh4keP0fZu+4ZRMeiAWjtaXX4BHYFnPvCDshLN+i4zkMUktSgWeNneaXl/AFwUqZHKZNsQCo9hZxHpVmynM9fs90Fw5ub7f5LtMefpXSX2v5mKfrmxxDQQjuHNsyjXG9IoFD65EKD3VTTHQn77ylR3xP9YpAMsHDegEa+v1EdQ== 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-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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=327YiGjoXN6nCav2A9E9WBoxK7xf1O/U0swjGWj2UwU=; b=33L57lrkoELQarVMd8IzdakwyumsHmr+lWGIIY9b1F9dACwTLcERKrOEMxG+tTxEggfR4T/dW2LkGqzq0f7LwW1hCKKZnaJZr21ZI2GxuuFmvHJg8Xg707R7WGizCFQD/Mq14hVH5vEBbebx9RCCn1zce4h5C5Hxbl9xrzlpeZ/HpBdkUzLIS/TMwTG4plS+Yl85UuGDObVvQcY2JjZtvVKHYChhjKaC5LClqBLP9iRkpujldYpJTgqKtywEsTV4vq6MlHln1W8aOpjMNtDNhGAO53KbxZ4Tie9ZZMy9Sn08oMC7J488clsvEi83fbFDDd5P+h+zo101Mx0nuf3vNg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Message-ID: <47711743-f6b6-130b-6be5-cfbb84ee5e2a@suse.com> Date: Thu, 2 Nov 2023 15:23:42 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Content-Language: en-US To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Federico Serafini From: Jan Beulich Subject: [PATCH] AMD/IOMMU: drop tasklet handler forward declaration X-ClientProxiedBy: FR2P281CA0020.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:14::7) To DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|VI1PR04MB7007:EE_ X-MS-Office365-Filtering-Correlation-Id: 50a5d5e2-1980-4dd2-4078-08dbdbaf51c7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: i586hxCy/YwQcGXtT4URZT9p1qJk2GGJBn/9G1QnV4AtBAELKpif/LUMoVHEx+RfCK8FOCj7TTk1lg8mFGdcXzFaDnLNUUgKS2Mip+6t67tHRSkB3mZqTpq6FBHWU/WhQHqBj5+eSUhAWmEt4r/bPumEXU0jaTlMf0ODd+oPlqlPFcEI9xJrn7WXkn/Z/xuxdetRNqBFH4nQjpBcvRDAUFtNUUOfeS+V0VQN5Q8PUn/EMN0duUSCjS4FX6rCj920rxA/i9eerl7nlvwD8J6lB3p5ocvpry31GLQAFI+XmjdE3/HMhcZ9/UGBFOw85rOTKEoRYZAkMGQp816om3jFMiSuvVcs0lrWNrOoK1ZdS2bkLDWdO5dE5RF2F3D/tHD9kTtuUlOn8e6dgIYI/oCd2u9ntTXidM3zBlM3ULAAuuwxxFrBiroi8BZWsujd/xHf0CYm88FMjI1uzN8DsJeoqncefqnVffryE4X6lkQNgWoMP3BNgB5g2d8YTztXNU9AU9WIhk6IGUAT1YoUMx1AUkCLPlrWUOTamLqiDhHy4sYq2kBpT7XBTGsU85/iXEAvzUWHW/227pJz9pQzx0wNktnfOMAiL8gtFuBrhPgEJewdm3oVVCtVhfzA1knwyxLgcx3L2PRvsfk5fDR2OG8X+w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(346002)(396003)(136003)(366004)(39860400002)(230922051799003)(64100799003)(186009)(1800799009)(451199024)(2906002)(31686004)(26005)(6512007)(38100700002)(2616005)(31696002)(86362001)(36756003)(8676002)(478600001)(6506007)(66476007)(54906003)(316002)(4326008)(66946007)(6486002)(6916009)(41300700001)(5660300002)(66556008)(8936002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?nO3oCcS2s9nIG7nb2Bn2L66pr2Zv?= =?utf-8?q?gn0eUtvSPxWC5B+qMoBitRCcnUX3Ma3ThrKyhcflHbdsXjBzQHehzuKm5r9H9OYrb?= =?utf-8?q?p/DpK2AwvRpTD+DPZziyM9TRHAp007zKLWr7iNy6CjnbsQXKZlQJUECUogihnypSH?= =?utf-8?q?ddU61qFwhnkB3DoYlFljtmqZo+Bc+gNhWcPsT1MQUuqS9Tp0tBW8cboTYgg7e3M32?= =?utf-8?q?ibsVxcaV7/k41/XHKWIO9s1n6l0WZorAgFUS1f7YPKffaURH1KDdcn+oTvzQ9DMs2?= =?utf-8?q?BWGNWOEO/clXII/yZcWrNt9YM0gRYAcmBhStvXHhCZ9nr0FLb//9kl2j8+HcGEAt+?= =?utf-8?q?D3BgiVOcdiVwyCaBG7a5DAC6Y65UUDhAl2REAnXBKLuvwWVU2o4pDyjHSd14cOvvt?= =?utf-8?q?jOLP9n+HzmtCcdWYnbCou50JSTWlVOei+YPhMCj9MdnT16TfICfqz+MZHzElFy96J?= =?utf-8?q?0p5w13iA1l+G66PNlNsxUeACuCIabP1ArGChBvE+kNpZO8Pp/a+GTxqUol+pR4rY5?= =?utf-8?q?lr6qD14KONS+wYQhXLMFIv0s7vBN+YS1gGPu817dMntTShs32dwLw/PN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N70tepGZooMD?= =?utf-8?q?DNXpoluODQizuqiWbX9LgUUvZ40RTqeMotc8T8++yKs146Jh9hcNuNrLqNlptyC/2?= =?utf-8?q?n2v45mykTS4n?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 50a5d5e2-1980-4dd2-4078-08dbdbaf51c7 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2023 14:23:44.2266 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Sro50XJ4GthE3Oohcf/S2aDSjgp0F+/12L+VJ0Gjt/fEiFMF8KBqqREtuJEDGaVWORT1ti4IoUMNUZOkOjXLtQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB7007 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 Acked-by: Andrew Cooper --- 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) {