From patchwork Wed Jan 4 08:44:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xenia Ragiadakou X-Patchwork-Id: 13088292 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 D281BC5479D for ; Wed, 4 Jan 2023 08:45:23 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.470986.730697 (Exim 4.92) (envelope-from ) id 1pCzOd-000110-1w; Wed, 04 Jan 2023 08:45:15 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 470986.730697; Wed, 04 Jan 2023 08:45:15 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pCzOc-00010r-Uz; Wed, 04 Jan 2023 08:45:14 +0000 Received: by outflank-mailman (input) for mailman id 470986; Wed, 04 Jan 2023 08:45:14 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pCzOc-0008Pf-0S for xen-devel@lists.xenproject.org; Wed, 04 Jan 2023 08:45:14 +0000 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [2a00:1450:4864:20::62b]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 19fa257a-8c0c-11ed-b8d0-410ff93cb8f0; Wed, 04 Jan 2023 09:45:12 +0100 (CET) Received: by mail-ej1-x62b.google.com with SMTP id u19so80869654ejm.8 for ; Wed, 04 Jan 2023 00:45:12 -0800 (PST) Received: from uni.router.wind (adsl-57.109.242.233.tellas.gr. [109.242.233.57]) by smtp.googlemail.com with ESMTPSA id k22-20020a170906129600b007c10fe64c5dsm15016382ejb.86.2023.01.04.00.45.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Jan 2023 00:45:11 -0800 (PST) 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: 19fa257a-8c0c-11ed-b8d0-410ff93cb8f0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mdM0GT8K2NEubn6wx1wh2HmFlgRPGL3ox7yjkbP2cHM=; b=IlyAPSqkdHW7+9UwD5gXGVtDULbpYhhfd0Gx3yvhyrN1hcnLLYpk/M8pLuZh3YGQA5 RsVx5uaz+bOugElYhIBMhtGc3tqbn9YBkmVDrxuCMqWWX/W5oNuPk6DW0mfx8vmvL3HF ENubWWJaVNiyKeqpPIwwuejdwmsFxhgpxr1B0qOLb/mJ/yQinsTqM9N5w7duefO33xzh CxrIrX8vsDWj7A9Pvq8nOW5W7QBLF+SVPuTuHzx+86VaMLDiZtwdhK3Musr1DWA3roXi SaRmbzkQydU5DN5adQlyaJo10MX9fRjb3UDxkTH2wFOytbtjR6qE6Ebm4ZmQd2sZty00 eE/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mdM0GT8K2NEubn6wx1wh2HmFlgRPGL3ox7yjkbP2cHM=; b=ujVkcSyvyXqPUEzNnTKz9NEDyz6evmAWdfIEWrtANAzNhQa+VFsLYIoN81nofZI6hO J9yPis4/OgPsLufkJFyLb8MMX/WTpu4KZX6q6PqcvQBsPHS9G8ApWIu3bFNlNh9aBcMd fpD75xnB0RWP9aD43mDdwSopD5WtKV3ZmHYIV0M8AsCMYzj1EeM+bySilgzzN7SznPnK qFmtD3DAsPVBdvNn9Q28pdP6jYvVofAaBCc8FTsp66rShvPRnHBfgeHrPDc8q+F0mTQ1 mkWNhLyq0c/Ku47e60sy5pQHjEeAVaxuhwAflQrUH/5/94/ASkOcTrN4MPvxXW5kbWYm o7rA== X-Gm-Message-State: AFqh2krDHKuaSvEMjWKXTJOVpOfbxAE0OgnG+FAVj0A6RLn67shxDH7h Lr6frMdaxd8qZBJkYusiGnKOga9DAT8= X-Google-Smtp-Source: AMrXdXsZZgpByDZtDx+HjsyiTiwAs0G3noW3D/xTiatDsGRWMUyXQVuGvHA8kTWk4IDuO3qsJCn9ZA== X-Received: by 2002:a17:907:20b0:b0:7d3:8159:f361 with SMTP id pw16-20020a17090720b000b007d38159f361mr40554936ejb.36.1672821911636; Wed, 04 Jan 2023 00:45:11 -0800 (PST) From: Xenia Ragiadakou To: xen-devel@lists.xenproject.org Cc: Jan Beulich , Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Wei Liu , George Dunlap , Julien Grall , Stefano Stabellini Subject: [PATCH v2 4/8] x86/acpi: separate AMD-Vi and VT-d specific functions Date: Wed, 4 Jan 2023 10:44:58 +0200 Message-Id: <20230104084502.61734-5-burzalodowa@gmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230104084502.61734-1-burzalodowa@gmail.com> References: <20230104084502.61734-1-burzalodowa@gmail.com> MIME-Version: 1.0 The functions acpi_dmar_init() and acpi_dmar_zap/reinstate() are VT-d specific while the function acpi_ivrs_init() is AMD-Vi specific. To eliminate dead code, they need to be guarded under CONFIG_INTEL_IOMMU and CONFIG_AMD_IOMMU, respectively. Instead of adding #ifdef guards around the function calls, implement them as empty static inline functions. Take the opportunity to move the declarations of acpi_dmar_zap/reinstate() to the arch specific header. No functional change intended. Signed-off-by: Xenia Ragiadakou --- Changes in v2: - replace CONFIG_INTEL_VTD with CONFIG_INTEL_IOMMU xen/arch/x86/include/asm/acpi.h | 14 ++++++++++++++ xen/include/xen/acpi.h | 3 --- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/xen/arch/x86/include/asm/acpi.h b/xen/arch/x86/include/asm/acpi.h index c453450a74..ca8529a7c8 100644 --- a/xen/arch/x86/include/asm/acpi.h +++ b/xen/arch/x86/include/asm/acpi.h @@ -140,8 +140,22 @@ extern u32 pmtmr_ioport; extern unsigned int pmtmr_width; void acpi_iommu_init(void); + +#ifdef CONFIG_INTEL_IOMMU int acpi_dmar_init(void); +void acpi_dmar_zap(void); +void acpi_dmar_reinstate(void); +#else +static inline int acpi_dmar_init(void) { return -ENODEV; } +static inline void acpi_dmar_zap(void) {} +static inline void acpi_dmar_reinstate(void) {} +#endif + +#ifdef CONFIG_AMD_IOMMU int acpi_ivrs_init(void); +#else +static inline int acpi_ivrs_init(void) { return -ENODEV; } +#endif void acpi_mmcfg_init(void); diff --git a/xen/include/xen/acpi.h b/xen/include/xen/acpi.h index 1b9c75e68f..82b24a5ef0 100644 --- a/xen/include/xen/acpi.h +++ b/xen/include/xen/acpi.h @@ -206,9 +206,6 @@ static inline int acpi_get_pxm(acpi_handle handle) void acpi_reboot(void); -void acpi_dmar_zap(void); -void acpi_dmar_reinstate(void); - #endif /* __ASSEMBLY__ */ #endif /*_LINUX_ACPI_H*/