From nobody Sun Apr 12 05:51:26 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1771989490; cv=none; d=zohomail.com; s=zohoarc; b=nKslZfVlqggPIvUmU/AWP7ari/87egGRskN7afQldy51l2JuCa98Y5Pbtt5mjBlW8ImAZvkc5nHolHr/oavzU8AeltWqtmvNEFfrGzmuuCDPnDIdUkbQ82MLAslEWPgsl3CRxBgbGIXLxRMy7P/KXM0Q46HGJh4LPW4vBoiiQIE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771989490; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=pBFSSzCow/tWOBWocPKfqkuVJO6XeuexcV7U+ifCqGw=; b=m7YhuK5a2vReqqB/8OhJzWVBGh947CIE4aiXHLBtf+xQf1fvTtT6OxVRXg0P0unKMHNP2XPknvwvuC5pClLbRu+ath80Qn/SyhWp1dDhfzs0k/2vVNesp0EXkR4W/rcc5426DpnAHQjyQPMPnw2vKc83CixNJGw/lUD1NywW01E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1771989490790554.7881951581281; Tue, 24 Feb 2026 19:18:10 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vv5Ol-0000l3-45; Tue, 24 Feb 2026 22:17:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vv5Oj-0000kc-QZ for qemu-devel@nongnu.org; Tue, 24 Feb 2026 22:17:13 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vv5Oh-00035g-5p for qemu-devel@nongnu.org; Tue, 24 Feb 2026 22:17:13 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-482f454be5bso3802975e9.0 for ; Tue, 24 Feb 2026 19:17:10 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483bd750701sm41216875e9.11.2026.02.24.19.17.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 24 Feb 2026 19:17:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1771989429; x=1772594229; darn=nongnu.org; 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=pBFSSzCow/tWOBWocPKfqkuVJO6XeuexcV7U+ifCqGw=; b=exVRjbYYPux1xLWe12hQmtV12cc53Zp1m9rXzc7xCSh1Zr+yLKj4dKurTiQlY0niNC YanAPvpwWft75+QonpBwVHyJKq3bxWDM8T2AKVTfA5HJzIoDkQ5qmQDa2vbuc6yQLlO+ mPUCmTfDvKwt2jF4w2egLgpH707lAUxUkqybich7pOL0DrH5XhW48bov/ndxV3mtHC3R mnFqLhK0S2+/lXJvylvR4ilIl3KOLUJOlTl84pzCxwDk+UZsLpxthFe7g/mEx6xD6A/9 vf8PiSPbjxRVP5kmXXGtxb+Tqz+JNjfKV86nwO1DYJyF2wSE6UrYqQM251Sfbxzhn4QB SN+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771989429; x=1772594229; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=pBFSSzCow/tWOBWocPKfqkuVJO6XeuexcV7U+ifCqGw=; b=v9XMpsq9ynvw7HJiBfUXaWETPWHGNeyvY3j3Wp+m7NEKr19M6h+++hwXq0aepLEGDS 3LL3/CYFN0RRfpliFNdCLHDYeHEuKnSJdaV0Nf2scAJC/Qi/cotkzWOlLgxindafvROs XvPnRNun/gdZpYjhII/8FUP+XCIvj/JDyCuUOiNUfTg3eB+ZLl24PoRLQ+nXbK/9uwRK qqxoh+66LIe1OZ3czEM//wjKegRttd78MrAZOKgz6kPxk4rVpZplz0a3RSaUs1/+il9p GLMYQxswVlVx8HR3cKaPEXzld74OJQAKkH4DCDQQBH6JGAvx80y3k8lEabM8jsBMxuCS fgfg== X-Gm-Message-State: AOJu0Yxbf2AtBxpC2rCu7PCfhniK27pOa3SlcgsWy8Hke6VjjOLgC6I/ mJ/DxHMocsi/rgmro9726z/AEAj6fBhthfxg6yamc7UBCkiJsIrwR+55MwuSURihMJaJr/INQA4 BGF5QwaA= X-Gm-Gg: ATEYQzznI/Nmur4R21YCN+oFwOTrSzK7dNSLIlq8cCUTQy9XpiBLShpAC9AzV/ASWTi FrssZKVXlNyPUETFq6sECnHq4LVPvAN8/9lIGmrehkOtVFZ9Lzj5z0ZmE6/169rWI87qbP9GBMk /MO54dQQmx7vu+yU3ekJ8DNqqYEQccE8GVR1lIfJfLRnhL79AMoTHkqW92sMnAESgZsgNfOQBLa jIAkpjToa05VCo9UZhlejitbZlmt/nnRIPDPH0uqZYGRBhCKPz83dZtArskN4m0jXcK31LYPMni VvJuDAqBuB+QZmie8eZ/Pfx36PrgyElD4WC2yQn/g7u5O9Cx0X8y/KYP/GvB+Z7Ajpw5r/NGx1F vuJZKGbpuQ7CXlLR9F35NDp5omMrBn+XaLUM8r7+/WSMvEEUuZScFCIR2u1cTkJwcH3/3Vghs0M nXimuGCgYWuB08n5GlF4OvhNsoNDawm5q07KdFS/8eA9eL4FUbqeouST7TUrDIMqyzLggdzsCL X-Received: by 2002:a05:600c:c045:b0:47a:8383:f2b2 with SMTP id 5b1f17b1804b1-483bd76fa19mr21308535e9.17.1771989429299; Tue, 24 Feb 2026 19:17:09 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Thomas Huth , qemu-s390x@nongnu.org, Pierrick Bouvier , Shameer Kolothum , qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell , Eric Auger Subject: [PATCH 1/3] hw/arm/smmuv3: Avoid including CONFIG_DEVICES in hw/ header Date: Wed, 25 Feb 2026 04:16:56 +0100 Message-ID: <20260225031658.32095-2-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260225031658.32095-1-philmd@linaro.org> References: <20260225031658.32095-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1771989492981158500 By inlinining the stubs we can avoid the use of target-specific CONFIG_DEVICES include in a hw/ header, allowing to build the source files including it as common objects. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth --- hw/arm/smmuv3-accel.h | 35 ----------------------------- hw/arm/smmuv3-accel-stubs.c | 44 +++++++++++++++++++++++++++++++++++++ hw/arm/meson.build | 5 +++-- 3 files changed, 47 insertions(+), 37 deletions(-) create mode 100644 hw/arm/smmuv3-accel-stubs.c diff --git a/hw/arm/smmuv3-accel.h b/hw/arm/smmuv3-accel.h index a8a64802eca..7e48d1555d3 100644 --- a/hw/arm/smmuv3-accel.h +++ b/hw/arm/smmuv3-accel.h @@ -14,7 +14,6 @@ #ifdef CONFIG_LINUX #include #endif -#include CONFIG_DEVICES =20 /* * Represents an accelerated SMMU instance backed by an iommufd vIOMMU obj= ect. @@ -40,7 +39,6 @@ typedef struct SMMUv3AccelDevice { SMMUv3AccelState *s_accel; } SMMUv3AccelDevice; =20 -#ifdef CONFIG_ARM_SMMUV3_ACCEL void smmuv3_accel_init(SMMUv3State *s); bool smmuv3_accel_install_ste(SMMUv3State *s, SMMUDevice *sdev, int sid, Error **errp); @@ -51,38 +49,5 @@ bool smmuv3_accel_issue_inv_cmd(SMMUv3State *s, void *cm= d, SMMUDevice *sdev, Error **errp); void smmuv3_accel_idr_override(SMMUv3State *s); void smmuv3_accel_reset(SMMUv3State *s); -#else -static inline void smmuv3_accel_init(SMMUv3State *s) -{ -} -static inline bool -smmuv3_accel_install_ste(SMMUv3State *s, SMMUDevice *sdev, int sid, - Error **errp) -{ - return true; -} -static inline bool -smmuv3_accel_install_ste_range(SMMUv3State *s, SMMUSIDRange *range, - Error **errp) -{ - return true; -} -static inline bool smmuv3_accel_attach_gbpa_hwpt(SMMUv3State *s, Error **e= rrp) -{ - return true; -} -static inline bool -smmuv3_accel_issue_inv_cmd(SMMUv3State *s, void *cmd, SMMUDevice *sdev, - Error **errp) -{ - return true; -} -static inline void smmuv3_accel_idr_override(SMMUv3State *s) -{ -} -static inline void smmuv3_accel_reset(SMMUv3State *s) -{ -} -#endif =20 #endif /* HW_ARM_SMMUV3_ACCEL_H */ diff --git a/hw/arm/smmuv3-accel-stubs.c b/hw/arm/smmuv3-accel-stubs.c new file mode 100644 index 00000000000..b64f1e4d93e --- /dev/null +++ b/hw/arm/smmuv3-accel-stubs.c @@ -0,0 +1,44 @@ +/* + * Stubs for accelerated SMMU instance backed by an iommufd vIOMMU object. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "hw/arm/smmuv3.h" +#include "hw/arm/smmuv3-accel.h" + +void smmuv3_accel_init(SMMUv3State *s) +{ +} + +bool smmuv3_accel_install_ste(SMMUv3State *s, SMMUDevice *sdev, int sid, + Error **errp) +{ + return true; +} + +bool smmuv3_accel_install_ste_range(SMMUv3State *s, SMMUSIDRange *range, + Error **errp) +{ + return true; +} + +bool smmuv3_accel_attach_gbpa_hwpt(SMMUv3State *s, Error **errp) +{ + return true; +} + +bool smmuv3_accel_issue_inv_cmd(SMMUv3State *s, void *cmd, SMMUDevice *sde= v, + Error **errp) +{ + return true; +} + +void smmuv3_accel_idr_override(SMMUv3State *s) +{ +} + +void smmuv3_accel_reset(SMMUv3State *s) +{ +} diff --git a/hw/arm/meson.build b/hw/arm/meson.build index 47cdc51d135..8f834c32b1f 100644 --- a/hw/arm/meson.build +++ b/hw/arm/meson.build @@ -85,8 +85,9 @@ arm_common_ss.add(when: 'CONFIG_ARMSSE', if_true: files('= armsse.c')) arm_common_ss.add(when: 'CONFIG_FSL_IMX7', if_true: files('fsl-imx7.c', 'm= cimx7d-sabre.c')) arm_common_ss.add(when: 'CONFIG_FSL_IMX8MP', if_true: files('fsl-imx8mp.c'= )) arm_common_ss.add(when: 'CONFIG_FSL_IMX8MP_EVK', if_true: files('imx8mp-ev= k.c')) -arm_ss.add(when: 'CONFIG_ARM_SMMUV3', if_true: files('smmuv3.c')) -arm_ss.add(when: 'CONFIG_ARM_SMMUV3_ACCEL', if_true: files('smmuv3-accel.c= ')) +arm_common_ss.add(when: 'CONFIG_ARM_SMMUV3', if_true: files('smmuv3.c')) +arm_common_ss.add(when: 'CONFIG_ARM_SMMUV3_ACCEL', if_true: files('smmuv3-= accel.c')) +stub_ss.add(files('smmuv3-accel-stubs.c')) arm_common_ss.add(when: 'CONFIG_FSL_IMX6UL', if_true: files('fsl-imx6ul.c'= , 'mcimx6ul-evk.c')) arm_common_ss.add(when: 'CONFIG_NRF51_SOC', if_true: files('nrf51_soc.c')) arm_common_ss.add(when: 'CONFIG_XEN', if_true: files( --=20 2.52.0 From nobody Sun Apr 12 05:51:26 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1771989487; cv=none; d=zohomail.com; s=zohoarc; b=V4kGR/ZutgbEXePTM+FyptUtYpN9frrm37RD0aku0r2HqqVR4pINsF3+kuExTq+0xtELSCbv1nmJTBVlgWQsVlOvTv8eXXtqGRtS17b2V429C+52ls90hsgrjI0B/+i+8kC3V14MWtrSrcIkxgymEEaK5UJ1BVGu6ag3oFFbtIA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771989487; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=DoPGvmndfJWB+ezVYLMKCPYZN0oN2JJ1YLQJ64HIOf0=; b=ABaDn0P/zruxsRxCsSZjK3vRmo40TnaAjLvNKsejClhPZCgAGlE1qNZmszZ/+FSBA6Bfa/WU+V57u+Q0y13xNYCYNM/+sZHIsR6jCMPun9QX57XTAAamgowZaufveR9JUHqY7ygJNGlDA+IdjGxMbEPjN0QzRXKCcTQraJ1dttw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1771989487354848.770781829219; Tue, 24 Feb 2026 19:18:07 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vv5Ot-0000mK-11; Tue, 24 Feb 2026 22:17:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vv5Or-0000li-W0 for qemu-devel@nongnu.org; Tue, 24 Feb 2026 22:17:22 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vv5Op-00036a-Hg for qemu-devel@nongnu.org; Tue, 24 Feb 2026 22:17:21 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4807068eacbso48231865e9.2 for ; Tue, 24 Feb 2026 19:17:19 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483bd7031f3sm37810325e9.6.2026.02.24.19.17.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 24 Feb 2026 19:17:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1771989438; x=1772594238; darn=nongnu.org; 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=DoPGvmndfJWB+ezVYLMKCPYZN0oN2JJ1YLQJ64HIOf0=; b=zufSqG8hNBHqRVhDrkBkJcqoYnTvtil14p9Lg6r5CpLMcUQRGOIsrWiJqm1+XOpbOZ t9zx6uJZdmkrWEff6V9PL+X6wlCuWN9nFwnku5/qLgMGEhRaPGE63TRixFVbaf6X/gcn bo4+e+03mP0JChXS+SankwAxrg+sgz8P3JxQNiJlb0HnbLQZpEzYk5K4k7IQzQ0UDGit 0z81SJO4RJx0WAk0P3BRnVjCxu1ggrdcLgd4F2Efh//vson4H5eDaYn9UqNivztPM0zc jrexfdUWSxZbrXB8AQrqenp4ywbi1pf2vrXQMX9danV+NQBpT0WVgmo/WJ2pJniiL4U2 Jdvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771989438; x=1772594238; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=DoPGvmndfJWB+ezVYLMKCPYZN0oN2JJ1YLQJ64HIOf0=; b=s+V8xyJtrmcVIycLwORv1PeivxRz2yM5+GU8oqT15VKbzlRmVSy+bMmnVcsgPNR/It UPW84Cf1Yraaibg194vviq2lg3hKA/vyF4xy3pDvzEcli9jHBnxd7QmmUYdqovHBnzkb J9XQi6aSZKLoi0bUAg4rb8laxMGl2cW2iaF76Yx4RvsdCgPxvHaZHNbNrF/9ps709Tii u+Rofi/GXwLO7w9CtBXQz9izHOPuLV6dJNY82XHO7xWXbsEPr1EBkiyP681ZZ2IkG40+ 7GpOI6CVcFJ25BaO+aQB+6pQEIiBrjdRJktNTfEJdgI7NDimMgHb41aYT2LF8qcuPdoA K+mw== X-Gm-Message-State: AOJu0YyYb5GLPyTAvb6HslaNJORAou2blR/DGvXfkVaRzBikidd7Ipzw EcJpaPCmYljIgN5XZzpMqRO/uKzr/8tCR73QDkFb8x4sm0KqRyHPqGuC/4a+J9zsb49KTambSx/ 0G7CrhzI= X-Gm-Gg: ATEYQzyDemn3ASITAHxEM3C4cl7oFw8j12w9RW6BHfYAPmBnICDdrwBHdod0ZklT5ZG v0N/BoLw0eEyVfKiZiCJHL2JSMczNTCYUYUL/zJFHqLqxEw4qNx61ogp4LKS/k2WgtEYhU68xtu tVTdy2I4ieNLSFjVvLQ5rkMAVsOPqo0kxKrdS0ZIkac1fgPfGmE77prEPcLrLeKiUgNUcv6JSX/ 5BGN3DzqVnG7azvnw+rx1ps0IQLKAP8PQoIVXy+L5JICOmAP4r7LcS5Q0lwlQ9ANdh9wOaWtIEZ 4bhMxBIoo8jacbetZzCyeGGg1eJ6Vj6oW5kKmcTnhjn5iS484IfqIN8VW5x9vOsHU4jyasKtqC+ ZlgekcCSrcJx64sNS9stToV7a/du+cb/Ja+VM1AxSs1xl+7yxSEXyTnXjz/kPZwHjq1Ruu3iLdH NVeElFY5oqnjneOh9hYaC7EP403dKqq54fmCNPwjCNUaIE0Pk+iVCwS0EEzdExBRvwCDAKZRT+ X-Received: by 2002:a05:600c:6990:b0:483:6a8d:b2f9 with SMTP id 5b1f17b1804b1-483a95aa328mr245873865e9.5.1771989437583; Tue, 24 Feb 2026 19:17:17 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Thomas Huth , qemu-s390x@nongnu.org, Pierrick Bouvier , Shameer Kolothum , qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Eduardo Habkost , "Michael S. Tsirkin" , Marcel Apfelbaum , Jason Wang , Yi Liu , =?UTF-8?q?Cl=C3=A9ment=20Mathieu--Drif?= Subject: [PATCH 2/3] hw/i386/intel_iommu: Avoid including CONFIG_DEVICES in hw/ header Date: Wed, 25 Feb 2026 04:16:57 +0100 Message-ID: <20260225031658.32095-3-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260225031658.32095-1-philmd@linaro.org> References: <20260225031658.32095-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1771989489365158500 By inlinining the stubs we can avoid the use of target-specific CONFIG_DEVICES include in a hw/ header, allowing to build the source files including it as common objects. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Clement Mathieu--Drif Reviewed-by: Richard Henderson --- hw/i386/intel_iommu_accel.h | 35 ++--------------------------- hw/i386/intel_iommu_accel-stubs.c | 37 +++++++++++++++++++++++++++++++ hw/i386/meson.build | 1 + 3 files changed, 40 insertions(+), 33 deletions(-) create mode 100644 hw/i386/intel_iommu_accel-stubs.c diff --git a/hw/i386/intel_iommu_accel.h b/hw/i386/intel_iommu_accel.h index e5f0b077b4b..d75d232c6d4 100644 --- a/hw/i386/intel_iommu_accel.h +++ b/hw/i386/intel_iommu_accel.h @@ -10,9 +10,9 @@ =20 #ifndef HW_I386_INTEL_IOMMU_ACCEL_H #define HW_I386_INTEL_IOMMU_ACCEL_H -#include CONFIG_DEVICES =20 -#ifdef CONFIG_VTD_ACCEL +#include "hw/i386/intel_iommu_internal.h" + bool vtd_check_hiod_accel(IntelIOMMUState *s, VTDHostIOMMUDevice *vtd_hiod, Error **errp); VTDHostIOMMUDevice *vtd_find_hiod_iommufd(VTDAddressSpace *as); @@ -21,36 +21,5 @@ void vtd_flush_host_piotlb_all_locked(IntelIOMMUState *s= , uint16_t domain_id, uint32_t pasid, hwaddr addr, uint64_t npages, bool ih); void vtd_iommu_ops_update_accel(PCIIOMMUOps *ops); -#else -static inline bool vtd_check_hiod_accel(IntelIOMMUState *s, - VTDHostIOMMUDevice *vtd_hiod, - Error **errp) -{ - error_setg(errp, "host IOMMU cannot be checked!"); - error_append_hint(errp, "CONFIG_VTD_ACCEL is not enabled"); - return false; -} =20 -static inline VTDHostIOMMUDevice *vtd_find_hiod_iommufd(VTDAddressSpace *a= s) -{ - return NULL; -} - -static inline bool vtd_propagate_guest_pasid(VTDAddressSpace *vtd_as, - Error **errp) -{ - return true; -} - -static inline void vtd_flush_host_piotlb_all_locked(IntelIOMMUState *s, - uint16_t domain_id, - uint32_t pasid, hwaddr= addr, - uint64_t npages, bool = ih) -{ -} - -static inline void vtd_iommu_ops_update_accel(PCIIOMMUOps *ops) -{ -} -#endif #endif diff --git a/hw/i386/intel_iommu_accel-stubs.c b/hw/i386/intel_iommu_accel-= stubs.c new file mode 100644 index 00000000000..6015e0df2a1 --- /dev/null +++ b/hw/i386/intel_iommu_accel-stubs.c @@ -0,0 +1,37 @@ +/* + * Intel IOMMU acceleration with nested translation (stubs) + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "qapi/error.h" +#include "hw/i386/intel_iommu_accel.h" + +bool vtd_check_hiod_accel(IntelIOMMUState *s, VTDHostIOMMUDevice *vtd_hiod, + Error **errp) +{ + error_setg(errp, "host IOMMU cannot be checked!"); + error_append_hint(errp, "CONFIG_VTD_ACCEL is not enabled"); + return false; +} + +VTDHostIOMMUDevice *vtd_find_hiod_iommufd(VTDAddressSpace *as) +{ + return NULL; +} + +bool vtd_propagate_guest_pasid(VTDAddressSpace *vtd_as, Error **errp) +{ + return true; +} + +void vtd_flush_host_piotlb_all_locked(IntelIOMMUState *s, uint16_t domain_= id, + uint32_t pasid, hwaddr addr, + uint64_t npages, bool ih) +{ +} + +void vtd_iommu_ops_update_accel(PCIIOMMUOps *ops) +{ +} diff --git a/hw/i386/meson.build b/hw/i386/meson.build index 63ae57baa51..0f058761b66 100644 --- a/hw/i386/meson.build +++ b/hw/i386/meson.build @@ -22,6 +22,7 @@ i386_ss.add(when: 'CONFIG_VMMOUSE', if_true: files('vmmou= se.c')) i386_ss.add(when: 'CONFIG_VMPORT', if_true: files('vmport.c')) i386_ss.add(when: 'CONFIG_VTD', if_true: files('intel_iommu.c')) i386_ss.add(when: 'CONFIG_VTD_ACCEL', if_true: files('intel_iommu_accel.c'= )) +stub_ss.add(files('intel_iommu_accel-stubs.c')) i386_ss.add(when: 'CONFIG_SGX', if_true: files('sgx-epc.c','sgx.c'), if_false: files('sgx-stub.c')) =20 --=20 2.52.0 From nobody Sun Apr 12 05:51:26 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1771989487; cv=none; d=zohomail.com; s=zohoarc; b=RRVIsBsTtOEVf9cUM7JYMKp2QPysOgvSM7HRSvm3dAKO6qLAAFrnP8dyew7jDvnAyvQANKAHh+tOBWq8Aw6RkW+b0/w7dTqqWj003ZV4eK8NWyJHwWNiVM3r+LF3eyhl/2g7kpvcnjLK1iId5MtlRL7PvbCBWW12hUduj9eOSNQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771989487; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ZyFoJ14S6oW3srTeQcVGkbUM0aXn2EkRu3cSSx5I2ts=; b=iiCd3D2KzIADN23O/nf/E+keEzhsgtYQHIoIv3OcWKTKznLE1fD3FigPU4ZouiRvm0NXFz6P9SJQ+3KiA44cHypljshZ21F2YxUZZfOf6NwKF/H9rIS0bZWeI0XcuPkU7anY9L0Y90m+kX4l1HaopRzey1LR0j3QxyyVJqIYsUk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1771989487723155.196406512811; Tue, 24 Feb 2026 19:18:07 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vv5P2-0000nn-2a; Tue, 24 Feb 2026 22:17:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vv5P1-0000nS-2P for qemu-devel@nongnu.org; Tue, 24 Feb 2026 22:17:31 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vv5Oy-00037z-MW for qemu-devel@nongnu.org; Tue, 24 Feb 2026 22:17:30 -0500 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-48370174e18so33616565e9.2 for ; Tue, 24 Feb 2026 19:17:28 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483bfb87067sm935425e9.12.2026.02.24.19.17.24 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 24 Feb 2026 19:17:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1771989447; x=1772594247; darn=nongnu.org; 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=ZyFoJ14S6oW3srTeQcVGkbUM0aXn2EkRu3cSSx5I2ts=; b=gc2zw4UNIC3fQcR+5wvNF4i/z4PJiPESvwLWuaNU7GzaYK7Lp2bfkkqIvQePgQdEuT 2qVByURNujs3Ugvqj9PB5HMNb/AXeGS+muvO7dJM4Km+vMU7pFypfI5px4B+KGg0aTgg 1gHmLARRQ7iSgeZxOVtlbbFbGszKii7q32taJcWG94fltos9NFOo6+ezPSLVvfOFIGw+ j9jAos93Je0VWSXgsBLQ5tQUyypQe9/RYVfmQj3gYukFKoQHkf63iPIUWOr7vAfxY3oZ GJ+s0DhP25zUBO6qC/gUb1TB6sY0PW8rI4GBhGkiF2EwqefD5Ji65i+SUsTzc0Sod0BN e+9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771989447; x=1772594247; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ZyFoJ14S6oW3srTeQcVGkbUM0aXn2EkRu3cSSx5I2ts=; b=uaEpRJi0aRQBZDQZOkrt4AkeLF9n8qQJDr8wzMDyHjpgnUNNYnFgkDtAksRG4ZjQcc bJd6No4LV/6t1FMqggajfXhZmDLwr8DlVtsoIdhu/eIA7PwVYn9CtXK7GxunjfpthgbK 6jyJ9tcVWhMleiIUEWzEkXzTvo272uKFBUCRbbAsjSo7ZBeK6kKSWEpDC4BH+LLp8ONo M+ygcWGQ0jwneIpRcISFTOr141bavPyqO4yh0YBMT+WWF4+01pmXqb2khICAVk9Y7ohb DwX1Ajp0k6K9idvvs9BJ7YM61MaFSHqJum1Mew00s41vdfRjma4ecgvSHOISBwBJRIoV ga9g== X-Gm-Message-State: AOJu0YzUBiWqFSyX7jTfdtn1vDMvQBwCq52pQhobAuKMsHYNt4JZNUYS PxtHG6iJTfXuUZoi1gzMn4iJzJB0h8MDqz2v8e/0xWeSojtvQ/JjGGJw43kBwu+AoL2bPeiDNPR jcPPpFJY= X-Gm-Gg: ATEYQzz9+bYE36pygoe5XRo2A9zQ1tRco4OuA0tpmHc49Mdhh+LTwrP4qmA3GTEXxIz MVymSlXZ8UehyDXwlVEErcjTGCc0dLz3HesFv08CrifFYvkch0z3NEsfg8BfSHsXR7gAJDnwL0X tOkM89O6CICcIVjZhM2NiocsHmeueN06RZK8uCNRvD1SlZkXdNymTu4kwG1tb7lSFL9ug79gdiA 7+LgYWG7S5MwXwq9ZwQlKCA7OFqPDf8WpXnweLwJXz68DyEihZl0/dHepVujeWOR+EbnXjoQS+R eP17scUs/D7+57ddsNR36TkPNPYjWOBJ7TOBnXnYQTPUeBeJ+qy8rVAZcoTCUdfpOiGcKfrcB8m JrpYPS7mK0lLv58zwDusIDZGm53X7YTVkkEXhsKPacFF5cBkwxrsOeuREYF0xn1AEb6Sp26XYWg 7JCaEQk1xwtQMXyLg2axTQrvdAwWCoW1Z81wIMZqtaD8gpA7evz3y/dmhjKmKu6ZO6iBTn1oFY X-Received: by 2002:a05:600c:1f93:b0:45c:4470:271c with SMTP id 5b1f17b1804b1-483bef53c8emr13729355e9.18.1771989446939; Tue, 24 Feb 2026 19:17:26 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Thomas Huth , qemu-s390x@nongnu.org, Pierrick Bouvier , Shameer Kolothum , qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Ilya Leoshkevich , David Hildenbrand , Halil Pasic , Christian Borntraeger , Eric Farman , Matthew Rosato , Farhan Ali Subject: [PATCH 3/3] hw/s390x/s390-pci-vfio: Avoid including CONFIG_DEVICES in hw/ header Date: Wed, 25 Feb 2026 04:16:58 +0100 Message-ID: <20260225031658.32095-4-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260225031658.32095-1-philmd@linaro.org> References: <20260225031658.32095-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1771989490981158500 By inlinining the stubs we can avoid the use of target-specific CONFIG_DEVICES include in a hw/ header, allowing to build the source files including it as common objects. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Farhan Ali Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth --- include/hw/s390x/s390-pci-vfio.h | 20 -------------------- hw/s390x/s390-pci-vfio-stubs.c | 32 ++++++++++++++++++++++++++++++++ hw/s390x/meson.build | 1 + 3 files changed, 33 insertions(+), 20 deletions(-) create mode 100644 hw/s390x/s390-pci-vfio-stubs.c diff --git a/include/hw/s390x/s390-pci-vfio.h b/include/hw/s390x/s390-pci-v= fio.h index ae1b126ff70..f7d6149daf6 100644 --- a/include/hw/s390x/s390-pci-vfio.h +++ b/include/hw/s390x/s390-pci-vfio.h @@ -13,32 +13,12 @@ #define HW_S390_PCI_VFIO_H =20 #include "hw/s390x/s390-pci-bus.h" -#include CONFIG_DEVICES =20 -#ifdef CONFIG_VFIO bool s390_pci_update_dma_avail(int fd, unsigned int *avail); S390PCIDMACount *s390_pci_start_dma_count(S390pciState *s, S390PCIBusDevice *pbdev); void s390_pci_end_dma_count(S390pciState *s, S390PCIDMACount *cnt); bool s390_pci_get_host_fh(S390PCIBusDevice *pbdev, uint32_t *fh); void s390_pci_get_clp_info(S390PCIBusDevice *pbdev); -#else -static inline bool s390_pci_update_dma_avail(int fd, unsigned int *avail) -{ - return false; -} -static inline S390PCIDMACount *s390_pci_start_dma_count(S390pciState *s, - S390PCIBusDevice *= pbdev) -{ - return NULL; -} -static inline void s390_pci_end_dma_count(S390pciState *s, - S390PCIDMACount *cnt) { } -static inline bool s390_pci_get_host_fh(S390PCIBusDevice *pbdev, uint32_t = *fh) -{ - return false; -} -static inline void s390_pci_get_clp_info(S390PCIBusDevice *pbdev) { } -#endif =20 #endif diff --git a/hw/s390x/s390-pci-vfio-stubs.c b/hw/s390x/s390-pci-vfio-stubs.c new file mode 100644 index 00000000000..d9882b7aad0 --- /dev/null +++ b/hw/s390x/s390-pci-vfio-stubs.c @@ -0,0 +1,32 @@ +/* + * s390 vfio-pci stubs + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "hw/s390x/s390-pci-vfio.h" + +bool s390_pci_update_dma_avail(int fd, unsigned int *avail) +{ + return false; +} + +S390PCIDMACount *s390_pci_start_dma_count(S390pciState *s, + S390PCIBusDevice *pbdev) +{ + return NULL; +} + +void s390_pci_end_dma_count(S390pciState *s, S390PCIDMACount *cnt) +{ +} + +bool s390_pci_get_host_fh(S390PCIBusDevice *pbdev, uint32_t *fh) +{ + return false; +} + +void s390_pci_get_clp_info(S390PCIBusDevice *pbdev) +{ +} diff --git a/hw/s390x/meson.build b/hw/s390x/meson.build index 1bc85837996..57cc2a6be3d 100644 --- a/hw/s390x/meson.build +++ b/hw/s390x/meson.build @@ -34,6 +34,7 @@ s390x_ss.add(when: 'CONFIG_S390_CCW_VIRTIO', if_true: fil= es( )) s390x_ss.add(when: 'CONFIG_TERMINAL3270', if_true: files('3270-ccw.c')) s390x_ss.add(when: 'CONFIG_VFIO', if_true: files('s390-pci-vfio.c')) +stub_ss.add(files('s390-pci-vfio-stubs.c')) s390x_ss.add(when: 'CONFIG_VFIO_AP', if_false: files('ap-stub.c')) =20 virtio_ss =3D ss.source_set() --=20 2.52.0