From patchwork Fri Mar 7 18:03:24 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 871230 Delivered-To: patch@linaro.org Received: by 2002:a5d:64c8:0:b0:38f:210b:807b with SMTP id f8csp895864wri; Fri, 7 Mar 2025 10:07:59 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUz+fpyMhb+sbQzqdr1IZrW8lfMlnPvapr96RJ8OD5zTgsNUQKYOV+9x/tvKdJK9pHVP0hJ0Q==@linaro.org X-Google-Smtp-Source: AGHT+IFjU8WCjrDnLIw4R23hE2w4eP0nr0zZuyoB9/3yydErJQ3QrtDkRKuFGISGOTX7+9UzxSZt X-Received: by 2002:a05:6214:1d26:b0:6e8:ec18:a1be with SMTP id 6a1803df08f44-6e907cb9187mr6259046d6.7.1741370879471; Fri, 07 Mar 2025 10:07:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1741370879; cv=none; d=google.com; s=arc-20240605; b=c4MNyXj0kEVzr5ZbKRxEN0Es0hoctR9UgbkKhX3+KTC8xbCixmAw0PBf4Vj+wOELKq 49Bo9rw5g3mT3TCYO1vUMGpGb5LZIY4jukQtKCjp64kLy59M6fz5G6nA5v9WNspBCjXC 66DhZCnt1HIzlL7vRVjMJ+6d3fzDYO563oo7DQCrzQeGf06t3jjCBDPuzVbt4G7zpTFv R99RXEeDR1JfjdLZFv/yXY9rqRoJX3EbUEvVw7u/1E0u/u/ury3s30QUBTJLmv/E289C fuUG1lxhbPggOsoKluztyjexV8uFti/et2QKLLPNbx8nvOplvKi63BrJoeFumN7VrqD7 O9zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=J4WceDIEs6qy2mz0/CkEqDnKb2HdT3DG3c81fgnQQN8=; fh=ZyzqLhNGJAXkYZjVqygzIY1NON/Kumlz+Vm/jUj6bQE=; b=Efuxni3VGzn41i9yefwXIeHoKNFv+LZY42VaFcNYYJ4b4Rdgk7Z4RAL9f0YGJkPsVo rJ1BZ46Sd8ljcxfcX1OlEaJDnH3t5a8yYRHIhju0DJ3elvm2HStQkxcamhblHkZbjCdA 1mGN9OCfpX0GCy+fFtm6iC5bO2m9YlLqQoCxlyAlq18BMn3wZKdoBP4K5bzyD7WOqSos sFyhgVH3tsQYCKl0wpPVwjz5pvCSBVX9o1D9DKb0AohH7Yxhtg0skAKQyOI1h4IVc9Wr 3yNH73yRfN3pbUzw+whdV5rVNvXK0cddal6n++EVQbmelNsCqg7BBe128khG4+FGTxUl zNUA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nu+oST6C; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6e8f746702dsi37972156d6.412.2025.03.07.10.07.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Mar 2025 10:07:59 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nu+oST6C; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tqc37-0003Nc-12; Fri, 07 Mar 2025 13:03:53 -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 1tqc32-0003Kh-UB for qemu-devel@nongnu.org; Fri, 07 Mar 2025 13:03:48 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tqc31-0000us-Ai for qemu-devel@nongnu.org; Fri, 07 Mar 2025 13:03:48 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-43bdf0cbb6bso12560225e9.1 for ; Fri, 07 Mar 2025 10:03:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741370625; x=1741975425; 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=J4WceDIEs6qy2mz0/CkEqDnKb2HdT3DG3c81fgnQQN8=; b=nu+oST6CY/1HHPYB2qr/OpLT9l67uG44MEr/DdVib5/XcvgE4FMcEahcoWGGeJIG1H WkmBNYx45LIh58MxNiRoSeOAvqMTeDNC8Sk49fmiMmU61VucTW7JEROgG8YviG7s3k1r jtMz4ttqdbJQ997xf0E4vKpgkL5jeZshh0LpIUX4vQ+bH/ZUdaU1aN5611iMzcwnQ/Lo gsjie8RCiPkzf0W/xgnVYVBnaYznlIQavgFEX5RCZbWQUaNeynnBgOThEVCutSJVLc5u hJYe5JTc2h1swIAFE+HaIqog8nHaUYGpdmvk9tSh4Hx8tAXa/BG773iAQcm9NHng/XOV Bh0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741370625; x=1741975425; 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=J4WceDIEs6qy2mz0/CkEqDnKb2HdT3DG3c81fgnQQN8=; b=CxoVad/FCoj8RFafshprBPXC0Enb8A3p2FLPC1279nyPZ6mpYHW38SrZZcDMErdmNY 64fiaJ1eZ0Elt6Kv4tT06sM9jeu7tpkn078xcIQqiwNfmgtxWprUPlJZEkV6J7B/28v+ lI7SwT9PW3+552PDpIHqf5r5szKbeDeRyZ6dmTHjc0l5KLSC7SYpg01exMEf+CIN5fmN kPfB3i2VjU8+S/HWIa0WKz4a0N6VmhD74TFUwZ5A3Dt3Um+1+WVttoc6ZraxiYQS+VJe fDBzyBw6TBzZ1fIpbqFFNas+F28XOO5JF3eq53NK9uOVglrlWA+4JVIPUGs2RcoG/q6r Vqeg== X-Gm-Message-State: AOJu0YxKa0SMACsWN0igZW130yvaDTXCCSQZ2egDHUxbLlEk6+ODwpn2 ud4zMuyXgJg+jXfkegag9fBe2f4iB5kiTJcuATjs/WMQY2PAJp/yvPLT3C2S5yIEn3rASSO8mnf Tjq0= X-Gm-Gg: ASbGncugNw6RbnRnD/OIEJCNhcQvARt4PCQPmJN52Ymkb0CBW3BuTzCpPo50kKBOxQN VObe+fyuYY25o16Fa1KDzFuMPCRx3lR09zDD4L9cR/B+sjOBREhnk3gA6GIHlcVWSOukJA/VMxR 8w7CqeuBlJ+m8VkoEZdSKGx/5C5jTiZIZ56xTfzsLc2KGmShnsbBBjQbUU/TGbp7wWR9ZsHPDhi dxOvSc6H+j1VtzVWxtawM0vUE/yzieBl0JBRv7QfH1F7RgTz5HFxipRaQRhFoWwkwRetpUh7I50 qIdFUDwKt/NjdHsMpl4gisfJQZNFqnpLPLgBOcUdHvsi1IUpTjWIgDRhzyPCHZ9um1jlAvPGGNc JWSyPBomEOwBTkzJXkng= X-Received: by 2002:a05:600c:4447:b0:43b:d0fe:b8be with SMTP id 5b1f17b1804b1-43c68718900mr35580865e9.30.1741370625106; Fri, 07 Mar 2025 10:03:45 -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-43bdd831719sm61522465e9.0.2025.03.07.10.03.43 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 07 Mar 2025 10:03:44 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Alex Williamson , Igor Mammedov , qemu-ppc@nongnu.org, Thomas Huth , Richard Henderson , Tony Krowiak , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , kvm@vger.kernel.org, Yi Liu , Paolo Bonzini , Zhenzhong Duan , Matthew Rosato , Eric Farman , Peter Xu , Pierrick Bouvier , Daniel Henrique Barboza , Eric Auger , qemu-s390x@nongnu.org, Jason Herne , =?utf-8?q?C=C3=A9dric_Le_Goater?= , David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Harsh Prateek Bora , Nicholas Piggin , Halil Pasic , Christian Borntraeger Subject: [PATCH 01/14] hw/vfio/common: Include missing 'system/tcg.h' header Date: Fri, 7 Mar 2025 19:03:24 +0100 Message-ID: <20250307180337.14811-2-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250307180337.14811-1-philmd@linaro.org> References: <20250307180337.14811-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.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=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Always include necessary headers explicitly, to avoid when refactoring unrelated ones: hw/vfio/common.c:1176:45: error: implicit declaration of function ‘tcg_enabled’; 1176 | tcg_enabled() ? DIRTY_CLIENTS_ALL : | ^~~~~~~~~~~ Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Richard Henderson Reviewed-by: Cédric Le Goater --- hw/vfio/common.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/vfio/common.c b/hw/vfio/common.c index 7a4010ef4ee..b1596b6bf64 100644 --- a/hw/vfio/common.c +++ b/hw/vfio/common.c @@ -42,6 +42,7 @@ #include "migration/misc.h" #include "migration/blocker.h" #include "migration/qemu-file.h" +#include "system/tcg.h" #include "system/tpm.h" VFIODeviceList vfio_device_list = From patchwork Fri Mar 7 18:03:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 871217 Delivered-To: patch@linaro.org Received: by 2002:a5d:64c8:0:b0:38f:210b:807b with SMTP id f8csp893937wri; Fri, 7 Mar 2025 10:04:42 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU0bH1kT1drEQ7ITs882Xh52M0Suqu/hBQ8ZkhPSpX68v7JNefirX2Ax9U2JxZetLKCwf6UMQ==@linaro.org X-Google-Smtp-Source: AGHT+IEZ4GJ18SfQsQxVJmggHInMh8nxopjPR16TpwN4SDCZmzZrNje8gZy8p2nh9tvWbeCeTmzw X-Received: by 2002:ac8:5891:0:b0:475:1734:296f with SMTP id d75a77b69052e-476109beed1mr63784731cf.28.1741370682594; Fri, 07 Mar 2025 10:04:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1741370682; cv=none; d=google.com; s=arc-20240605; b=V51n3gcVyZ9JXyc+hVv/Ao8a785poOXiK+FpMJDheBYf6w4Jp+5XM4pCSHsEKfIplf wvV3csqV23v020khiThLQGPMkLih0On0WXv2y+ebRrwvQhWAeaV7dbbFTXTFcmvcSH4y J6+29u/YuuDuZ5AaGSf3Uec0OvX1KXorYFUgsIFvG0W7XLhK+UexRxp92Y7mYQxviTk7 rkew9Jr2Qweub8rNjaPrpYgY7P5R4fHSLRP5yDWx3w0A0YPYZRoPtNyIZY/qlLQqxRdC 8bPn3MTPt8mCvGpTQCQP1la9VARl8cTH40wUTiUTluDGEB5VJs0dhp5OE75DFuEY388M cGSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=k75P2fUqxCLcSZyEfoYQ2NgIkqW5yPRPNiO+LCjfzGI=; fh=ZyzqLhNGJAXkYZjVqygzIY1NON/Kumlz+Vm/jUj6bQE=; b=SauNUmMr+fm9t+hrYoC37Hl47sivvQvN6ceDpG3XGfNeBRHGRV4opLBMP0pMP2QDDI PT5NNvUoBIkf0UbpKewKIRKbEU8i6bFHdR73Oaf1NFQEMJxP7oqB2DKadNbDiPaloXtC ztOvH1vbLvrXO3edQ/eyCpyrS2mnKmZL9xiiA6D7WETVkLUk6FXDe1He17UJfrvFY30n qqp2WtPoht+NiLMS3NcUBt5PUWwoIL5c4WFX+KTR71/Q0YEvHV+Gl4cDCmtPobxYE/hx H1o8YJrqj33QKwIaKIj/HdFlx+4bXU72tQQKwaTCCGhj3KDaauvGQfPBm8Bwh27JM/b7 6xXA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Oy9MGvdk; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-4751d985a44si37412831cf.56.2025.03.07.10.04.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Mar 2025 10:04:42 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Oy9MGvdk; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tqc3D-0003Qu-P0; Fri, 07 Mar 2025 13:03:59 -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 1tqc3A-0003Pu-8g for qemu-devel@nongnu.org; Fri, 07 Mar 2025 13:03:56 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tqc37-0001M5-HH for qemu-devel@nongnu.org; Fri, 07 Mar 2025 13:03:55 -0500 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-39127512371so1309824f8f.0 for ; Fri, 07 Mar 2025 10:03:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741370631; x=1741975431; 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=k75P2fUqxCLcSZyEfoYQ2NgIkqW5yPRPNiO+LCjfzGI=; b=Oy9MGvdkiS4xtarc8151CKlH1mmy9cMDrMwKx5BB31Wh3UMUEfQ6/ZRyD+Tb9wtrPH 2pFiLRl+uvN2xL8i2dqbWb7HBsseUe8qxME7978Et1bclHHjcMg4lyZ98gc80p3Tdx8m 3CEzhMQ16D50wSxhKnLLmYc7jBE1uiBNktIVZIdYH45P5YWbCnRn1SRhIoewIsg7ICD+ cY/TpqBjAoA4yEaWulhN3hmKXqmriXRDrwMgDMpHqWHB5jNKqN0egyrh36mcXikoWxuA DRtq9HiwOICh5N6VKeDRDsaSCjLfHfQkw2hCzsJm0SLHK0seKEQmbkTyG1cB9JCXPjzZ 0JUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741370631; x=1741975431; 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=k75P2fUqxCLcSZyEfoYQ2NgIkqW5yPRPNiO+LCjfzGI=; b=LBbzTl2jZR3f6AzAx7A6BIZZxs46HChELWifwnBMFXZTJXIS3zilEBcbeYWAvvV6T5 EshnztT0gI9e1W9MN6IphzUOQ6PbZN6GUjngt+3Yox7zuQc2D9SgsBtMS8SmnYP9FrQ1 /kkQ7fnEl9OsPW7IZQ0fXaWOEoAumYcH+2MhNWST+3fjXXlrbhEMKMTGOjwpE4GKqYq1 CbFTWYU4gk+oZ9EbzuX6ktzcuMvLP0mwzd1DG3MWAS+qz5QKTbhToxynWsEUfb2dRNqB 5yApLVWnrSWOorNzpSpaF3bxhJ8y6YxXqBan//ZwWQx6JNuCizdP8boXxL+UIRiqG1ZR Tmrg== X-Gm-Message-State: AOJu0YzbeDJMCXIeoEljzQHi6Fvs49MEoRHkT05u0Lcp9+YaSXNCBlYs nDvqJDRELqsGEnDjcP2lyS3ycXn70BbDiGIiKweq1l1juHm8ZFpjCceydjXHA3GTwAm+ElE7i24 lx5w= X-Gm-Gg: ASbGncsbBFyNywpLx5Plc1TKxCwgrkfPGHKqpBPBdIpqVmoQz6rAhyHFuOG2iYnWQQT kOgkHAum2TrFmTvAz/xqCm3ZN2zWijUXsJr1EaSAdqs3WbDaqiS9n9Y4HFw86ima1opY9LN+u8X dUAOwjZKmvqBSUjvK08bh2FmbAZMjOSOsxYTdd6+jKj2xw2JOklPwWAo67H66HPSyqNZXDvSWgq BRDgsrCemcqz8Ga9vyBRZ3qdIjvMW09mPAq1IsQg4ZJal+R5LjzaDo+dy97IAoirEVmRt8bVR18 4tEPHr/CRWi+lc23prVKabg8NLU1p7DrdRwJCWIskcFdgjsppGKQg5SxYTe5tJTf7EMCUYfD6M6 Q0u4tGwaNC1v8ZQDjlpI= X-Received: by 2002:a05:6000:178d:b0:390:df02:47f0 with SMTP id ffacd0b85a97d-39132dd6b75mr2573700f8f.42.1741370630655; Fri, 07 Mar 2025 10:03:50 -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-43bd435c836sm87577545e9.37.2025.03.07.10.03.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 07 Mar 2025 10:03:50 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Alex Williamson , Igor Mammedov , qemu-ppc@nongnu.org, Thomas Huth , Richard Henderson , Tony Krowiak , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , kvm@vger.kernel.org, Yi Liu , Paolo Bonzini , Zhenzhong Duan , Matthew Rosato , Eric Farman , Peter Xu , Pierrick Bouvier , Daniel Henrique Barboza , Eric Auger , qemu-s390x@nongnu.org, Jason Herne , =?utf-8?q?C=C3=A9dric_Le_Goater?= , David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Harsh Prateek Bora , Nicholas Piggin , Halil Pasic , Christian Borntraeger Subject: [PATCH 02/14] hw/vfio/spapr: Do not include Date: Fri, 7 Mar 2025 19:03:25 +0100 Message-ID: <20250307180337.14811-3-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250307180337.14811-1-philmd@linaro.org> References: <20250307180337.14811-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org is already include by "system/kvm.h" in the next line. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Richard Henderson Reviewed-by: Cédric Le Goater --- hw/vfio/spapr.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/hw/vfio/spapr.c b/hw/vfio/spapr.c index ad4c499eafe..9b5ad05bb1c 100644 --- a/hw/vfio/spapr.c +++ b/hw/vfio/spapr.c @@ -11,9 +11,6 @@ #include "qemu/osdep.h" #include #include -#ifdef CONFIG_KVM -#include -#endif #include "system/kvm.h" #include "exec/address-spaces.h" From patchwork Fri Mar 7 18:03:26 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 871222 Delivered-To: patch@linaro.org Received: by 2002:a5d:64c8:0:b0:38f:210b:807b with SMTP id f8csp894992wri; Fri, 7 Mar 2025 10:06:24 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU5ugZM3teLJ1UKIjYlgtb55ZnebFbw+7H5OUqPNkcVKdRdNOUCvXrEHfAhQjZGW/+vkGz0+Q==@linaro.org X-Google-Smtp-Source: AGHT+IE5EV6s3QLTrCH0N+eRPhjv2egLxy/42VVY6Jo1cuTipuXQ0u1lVlb/xuHyEDdLuh6V6O9r X-Received: by 2002:ac8:5a8b:0:b0:475:85f:820c with SMTP id d75a77b69052e-47610950ac5mr66372671cf.2.1741370783828; Fri, 07 Mar 2025 10:06:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1741370783; cv=none; d=google.com; s=arc-20240605; b=IqwtPnpHT7+RMhGRSIBBWMK1ilQbsZliJnGe08vs0TtuF7FVlnaEQ5SNA5I1kcHeVg xTSsKlrQKVt/EAjAcxceo1iKGchskziYI6I6YSdIWpDeHWxXcXqJXVVYhDDXQd882Oa8 asaEI4sHo433nWx8Fm7VGa32pujjryhZI0ooqJSB2foA1o0lo3XPI6X05CGPj5u7AS8I mTC6QzYUcXqk5r28K2IHG/7JdJ21u+iaJwcWqLStBNyTrs5bS3xOlA7uh01CwF4dQbK0 XT1Ixyno787uGBJKV8pn4C0YX2hVI6Y9f4K+/WdFbwMbT0egNegeZtSskLZ5cdB5tVGj fkxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=krlUeIQnTGSREObLa/ECb/a6wxL5+gnrd7UhE7/j7Y4=; fh=ZyzqLhNGJAXkYZjVqygzIY1NON/Kumlz+Vm/jUj6bQE=; b=kPp7Vc8YKyTIwyqjGLjz45zKDPLK1BJgv6HVw33EbRw1u98/EU7nPbzf+hK4r7eRFI cFi0NqMJr3zLVBBXtiQUKoIJssjXkqnex7YrjmWNUkhpM6ssQp9GAvBUocHQSbJ6OtQW LLhj+swXZRCM5DnYhzU34KYvAWtOC/qIdH3SUusFqC3vfcJ8z419eVXvtgnCTikifoRl dk4ulCZW7ZVD/JsmOcOHXjCxu8LxEJMqvHxLwshFHNdMCjGbvWYngRHjo3zblldgW8dp 9AWPFb5C/z3YnAaN6tzT0FcRaPhXJOr7dRueK30gmjVGY6jpvQ8pG+/6OyxXoEk6QhGQ b5+Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=N9hfvTst; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-4751db17197si37322741cf.338.2025.03.07.10.06.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Mar 2025 10:06:23 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=N9hfvTst; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tqc3L-0003eu-B6; Fri, 07 Mar 2025 13:04:07 -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 1tqc3F-0003Ut-Lr for qemu-devel@nongnu.org; Fri, 07 Mar 2025 13:04:02 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tqc3E-0001ce-1m for qemu-devel@nongnu.org; Fri, 07 Mar 2025 13:04:01 -0500 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-43bcbdf79cdso13615455e9.2 for ; Fri, 07 Mar 2025 10:03:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741370637; x=1741975437; 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=krlUeIQnTGSREObLa/ECb/a6wxL5+gnrd7UhE7/j7Y4=; b=N9hfvTsttsE6ramriuYgHTndOhTPHPuNGtt1ZOakn00CSZckTIhHAYHx3nLvtLFZRV SKi4hLyXSY+7aLtB2+s4BW3GkRNnGtBbywQYqmWGKQdVWiDBMsGrpB9FMKOR4VZ9dSEs 0ezrPc6+zRomgMlrhFBL2s3LYxgWA3EX877GSlua1pv+T5FCL/yqID2zApCsFUDA+9Ar F1UhIMcrqESVVxXS/U3auZMiwUmrHVsCLzzcojmOsDhiD5alkMiSybGvBJ+gHgqcITBk +RWXsY2Zs6JFvqEObT/R+7Nf5Tu0z6+nJYOPDVBZ+b+4iZlWHCwjRCl0XBScmRjkosZl tvhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741370637; x=1741975437; 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=krlUeIQnTGSREObLa/ECb/a6wxL5+gnrd7UhE7/j7Y4=; b=PGcTePmK2tRaA5zeUZLqfwakQwuWawKy9zJzZjkH86PftVf8sU3uZO08v4adAen2ck nKUtHO5ib1DACpIjgxSEbDxKZ1mqjToqMdiLElT3eoUGrF9TGL3JiFBZqZVXPwyUq0W5 w8SGnjAzuElj6iRwWx7Jr5pLuKOKTa9xty5Zd6FgKLhD8thfLxQIti0uK968CfTmClnw SzKkReJXB6lX244la4lJAjYxnITgYNBkFnGGDfHkQhNEfYDeexrl2NaZtmJUPt14i4oO 7EFWrFio+CKxAcDdyHSLvt8IzywfselZ/rhbnQovb9kh8VHgxPct8+8nBtgBhcI51Jt2 f7mw== X-Gm-Message-State: AOJu0YyIld2DpY/PTchgyQQAjsaOTih+TLKnvrwCE/OM8eYHq4BJe6Pt TwlT+hE7fq36eKb0M1S4xNSvbw+pjq5pguZi1huQz3aOWM25QLviBkt4T3iVeQOAfSs2pYXT/IO sWbI= X-Gm-Gg: ASbGnctpdkAbIWgMLKOZyQYsHSOiVLrBqyFCOVfc7/2uJaVsl9UvY1oGjxLO+GxNhjn pCDSC2dzqOpL3ce1x4ywDJ9XPjri+0ZEb7bTQRLHTpqmAhYJmREOEg/UCvo/Lde4K8s3dh4C//B ZmBB2i+aGbXy1NOO1Nh9GDrE5ou8dqHQlTPUg+SRdrWSvayX7HI7piLktUMNQ3+VucGlDZK/Fw1 N8dWxsNCoP0Wb/65hpQeg/Bv6Yyg9+2mDC25DUe03W36IDGABjwsPUyZfKgX5XG04v0co6Ccxsu hOh08KBGfAyftKOULBHyiVOgCQMGOeI40QlMotSppL/mcMls/DlvLwm7HVm2gY2SvMtlnPZplZc WO+B20rtxrD5ar1LMKac= X-Received: by 2002:a05:600c:26cc:b0:43b:c390:b77f with SMTP id 5b1f17b1804b1-43cb91c5affmr23555105e9.26.1741370636721; Fri, 07 Mar 2025 10:03:56 -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-43bd4352e29sm87392995e9.32.2025.03.07.10.03.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 07 Mar 2025 10:03:56 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Alex Williamson , Igor Mammedov , qemu-ppc@nongnu.org, Thomas Huth , Richard Henderson , Tony Krowiak , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , kvm@vger.kernel.org, Yi Liu , Paolo Bonzini , Zhenzhong Duan , Matthew Rosato , Eric Farman , Peter Xu , Pierrick Bouvier , Daniel Henrique Barboza , Eric Auger , qemu-s390x@nongnu.org, Jason Herne , =?utf-8?q?C=C3=A9dric_Le_Goater?= , David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Harsh Prateek Bora , Nicholas Piggin , Halil Pasic , Christian Borntraeger Subject: [PATCH 03/14] hw/vfio: Compile some common objects once Date: Fri, 7 Mar 2025 19:03:26 +0100 Message-ID: <20250307180337.14811-4-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250307180337.14811-1-philmd@linaro.org> References: <20250307180337.14811-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Some files don't rely on any target-specific knowledge and can be compiled once: - helpers.c - container-base.c - migration.c (removing unnecessary "exec/ram_addr.h") - migration-multifd.c - cpr.c Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Richard Henderson Reviewed-by: Cédric Le Goater --- hw/vfio/migration.c | 1 - hw/vfio/meson.build | 13 ++++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c index 416643ddd69..fbff46cfc35 100644 --- a/hw/vfio/migration.c +++ b/hw/vfio/migration.c @@ -27,7 +27,6 @@ #include "qapi/error.h" #include "qapi/qapi-events-vfio.h" #include "exec/ramlist.h" -#include "exec/ram_addr.h" #include "pci.h" #include "trace.h" #include "hw/hw.h" diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build index 260d65febd6..8e376cfcbf8 100644 --- a/hw/vfio/meson.build +++ b/hw/vfio/meson.build @@ -1,12 +1,7 @@ vfio_ss = ss.source_set() vfio_ss.add(files( - 'helpers.c', 'common.c', - 'container-base.c', 'container.c', - 'migration.c', - 'migration-multifd.c', - 'cpr.c', )) vfio_ss.add(when: 'CONFIG_PSERIES', if_true: files('spapr.c')) vfio_ss.add(when: 'CONFIG_IOMMUFD', if_true: files( @@ -25,3 +20,11 @@ vfio_ss.add(when: 'CONFIG_VFIO_AP', if_true: files('ap.c')) vfio_ss.add(when: 'CONFIG_VFIO_IGD', if_true: files('igd.c')) specific_ss.add_all(when: 'CONFIG_VFIO', if_true: vfio_ss) + +system_ss.add(when: 'CONFIG_VFIO', if_true: files( + 'helpers.c', + 'container-base.c', + 'migration.c', + 'migration-multifd.c', + 'cpr.c', +)) From patchwork Fri Mar 7 18:03:27 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 871218 Delivered-To: patch@linaro.org Received: by 2002:a5d:64c8:0:b0:38f:210b:807b with SMTP id f8csp893958wri; Fri, 7 Mar 2025 10:04:45 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXpxKvQGGgSefNdss8bIK0btN6k0Qg9Sn/kNFI2rrsfm6Qf5/gHUq6mKAnQllH4FPrYQz+o0A==@linaro.org X-Google-Smtp-Source: AGHT+IH2KxjSF0JQ+7SrXUOlx/Y00CDFudY2IGPd6ProZ+v1GoFbFiwWZX3qFEdBrSD7h9+LRzId X-Received: by 2002:ad4:5f85:0:b0:6e8:f2aa:a8b0 with SMTP id 6a1803df08f44-6e900609684mr55547216d6.18.1741370685618; Fri, 07 Mar 2025 10:04:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1741370685; cv=none; d=google.com; s=arc-20240605; b=P3CvHR2gjaqLaGm9RxFP8OrOe5UYWFXaKFXpsOk+65nsSWEubSNn2gLQSKHmyDZ+Dp vnmD91w96n3lP00UB3RmNCUeYy90+uZy0q/1ycAK9drgYFMicuFHWHuWeJvrcTEwcqvZ jDfRLMALOyVVLtLBsMFcokut5KivY+zldwvZy6Ou6QlOWUa1RmOJiE21DuLO2uLuA3H/ xL0k1PDpX0czIz7tCTjy4NwgNIjZGApdqxwX6nijuWqb5B2YXbDkkg+ffXMu/qp4FNOO Tatq+/Yp/g+w2VN+TVghK6yvvMmFYM5hgnuTer3e2xSMjYFABJO4UtzZVfe3/PBUoo5M DzYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XjnP6suRKIDIvCyvQUHjHOPyIvdZR5e5AjhnJZaY/H8=; fh=ZyzqLhNGJAXkYZjVqygzIY1NON/Kumlz+Vm/jUj6bQE=; b=Us9nWrGfnAODwSYCFN5WWqYSmDqoxPXAc7zepu7UWjcXv+VZFbIHwBaq6RYP4gWr57 D0j6GRbhCopc8UWkuERIaROOQuR4kEjoh/cuYxNUGFjYRC2HEMT2055kVOobL5SBaG0n xOwZ7AropBUv0IFOFEeLZcEdZWlhYEEtcM6nM/zpJuwi4iHij9YeSEwRbD90nmyHCzSQ Ug1NgLtc73Po3C7hMA+kUZcsGHXkl9KP/HCbzTdWRHMSQEtvQ0M/SYIzLJXy5WkppbEw o518477QNiuv5E+xrQbLDNffVtwiG2HYPyiuOyz4PZPP8qUY5Ktesfqi8ub5f5oWd0yL ywNg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ADQqm29y; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6e8f707cc51si37406486d6.51.2025.03.07.10.04.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Mar 2025 10:04:45 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ADQqm29y; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tqc3S-0003iD-8T; Fri, 07 Mar 2025 13:04:16 -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 1tqc3K-0003cW-FY for qemu-devel@nongnu.org; Fri, 07 Mar 2025 13:04:06 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tqc3I-0001v3-3A for qemu-devel@nongnu.org; Fri, 07 Mar 2025 13:04:06 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-438a39e659cso12784405e9.2 for ; Fri, 07 Mar 2025 10:04:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741370642; x=1741975442; 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=XjnP6suRKIDIvCyvQUHjHOPyIvdZR5e5AjhnJZaY/H8=; b=ADQqm29yKQCszVkFXGO4CXbkM13hzo02mvojcPZ3OVPbTyTJVG9TZJrm+MaBXz6tqU 7dAXnijShDffsBscQRCRpX3X1VR9o2GnT3JU0J9KlU7ceBYb+rGMIT9Xm41Jrbx/CYQ+ pRNbP3uksmNHjMB72SXbF9W31mLdwO97dW7A7qYYsSD686NSlztD/P6iNGSEn96u3qqK OyGQG3Q2D2gOnDGaov1scoM6GyO6Ybbvvjx9hIbzPspyRzRSfQ8yIGRdyZVbmFPFc/8f Lc3Rf2jsVO49Rodq8WRkAxnwLEaBbTU49DKZfbtR3WXlFNR2JO9LmQvTsIIB880tlsTg HN4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741370642; x=1741975442; 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=XjnP6suRKIDIvCyvQUHjHOPyIvdZR5e5AjhnJZaY/H8=; b=dQYAp17Spmy/7275zbBjnnDqGvZvdHSrrE7lsSjYo0KgLjFuHDI0CGyUJCMPcCxaT3 AkgitiIAR8Hozcv+6pS8dWRPwM1uN6wnCC/LS8L7Pyr1/ffASOrn4KaJsIqScBujNjzy FDskTMBYlUi++AHMyhpvhg6dR+mw1yz2aeXn9i0STDXVnM9gAyoeikGQbthxeR0SngUa D1FL9XoLPanJMvuvgoaSMmjRHS+bOeZsbtuSKUFpYGA1OusYI0WeSaI/Aeir8bRl6vXX rJwYmSYhv7FBFeBTCsADwQW9yf3LQG/FA4XqjPHIK2rxZV0gS7YjGWusXrk7RtoZj+kn MrcA== X-Gm-Message-State: AOJu0YxNSBj9PU1o8xB+9+xdWYulcIzmstRnL2VxqkSvy8s1Mx69jYPb bIaEJgG2YDKwwcNXa9d3g3xd/tSzfBn4XFAqVtzDzFFgx3ZfW2s0EjZi7dBJXZkrZwp1g0j/0Eg pzPE= X-Gm-Gg: ASbGncue1uLM6NOCAASsFIm9FOAS+ynvDdYKox7OGBONdMnQKsQ1IVfMJxFFkYr2oWV K/8q4P9SXHcGVmYGjWg1Mql1/4UalnoeSrjiqpBOYg8NHiFBaEp2Hxqv4MAOZp4OnSKkNHU21lD xCxqlq8KJCBBVkUQb9hRB7gCxHd1eD9tTkX7e3G2kWR5mF/p+IbvxCAbMgdUfUT9/vYHYi9SbK9 PPTFHHuSFWmfs8EFwRMEi5sEZkyKoGFwsOsyg7k7YSm0Gq8zB/xqRxqy61qU1QEvEP0NXpCyp87 L1LEOrEkADpqAjf7XkQWusrJyHnIn643Qe9ieZEkr0eb00PqbosaqqX82bvyM2xfUjyHjbesWH1 dWwmKkaHKx+pedHpbceA= X-Received: by 2002:a05:600c:4683:b0:439:9f42:8652 with SMTP id 5b1f17b1804b1-43c601e1201mr33989135e9.17.1741370642093; Fri, 07 Mar 2025 10:04:02 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3912bfba679sm6002314f8f.8.2025.03.07.10.04.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 07 Mar 2025 10:04:01 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Alex Williamson , Igor Mammedov , qemu-ppc@nongnu.org, Thomas Huth , Richard Henderson , Tony Krowiak , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , kvm@vger.kernel.org, Yi Liu , Paolo Bonzini , Zhenzhong Duan , Matthew Rosato , Eric Farman , Peter Xu , Pierrick Bouvier , Daniel Henrique Barboza , Eric Auger , qemu-s390x@nongnu.org, Jason Herne , =?utf-8?q?C=C3=A9dric_Le_Goater?= , David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Harsh Prateek Bora , Nicholas Piggin , Halil Pasic , Christian Borntraeger Subject: [PATCH 04/14] hw/vfio: Compile more objects once Date: Fri, 7 Mar 2025 19:03:27 +0100 Message-ID: <20250307180337.14811-5-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250307180337.14811-1-philmd@linaro.org> References: <20250307180337.14811-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org These files depend on the VFIO symbol in their Kconfig definition. They don't rely on target specific definitions, move them to system_ss[] to build them once. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Richard Henderson Reviewed-by: Cédric Le Goater --- hw/vfio/meson.build | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build index 8e376cfcbf8..2972c6ff8de 100644 --- a/hw/vfio/meson.build +++ b/hw/vfio/meson.build @@ -14,13 +14,13 @@ vfio_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files( )) vfio_ss.add(when: 'CONFIG_VFIO_CCW', if_true: files('ccw.c')) vfio_ss.add(when: 'CONFIG_VFIO_PLATFORM', if_true: files('platform.c')) -vfio_ss.add(when: 'CONFIG_VFIO_XGMAC', if_true: files('calxeda-xgmac.c')) -vfio_ss.add(when: 'CONFIG_VFIO_AMD_XGBE', if_true: files('amd-xgbe.c')) vfio_ss.add(when: 'CONFIG_VFIO_AP', if_true: files('ap.c')) -vfio_ss.add(when: 'CONFIG_VFIO_IGD', if_true: files('igd.c')) specific_ss.add_all(when: 'CONFIG_VFIO', if_true: vfio_ss) +system_ss.add(when: 'CONFIG_VFIO_XGMAC', if_true: files('calxeda-xgmac.c')) +system_ss.add(when: 'CONFIG_VFIO_AMD_XGBE', if_true: files('amd-xgbe.c')) +system_ss.add(when: 'CONFIG_VFIO_IGD', if_true: files('igd.c')) system_ss.add(when: 'CONFIG_VFIO', if_true: files( 'helpers.c', 'container-base.c', From patchwork Fri Mar 7 18:03:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 871229 Delivered-To: patch@linaro.org Received: by 2002:a5d:64c8:0:b0:38f:210b:807b with SMTP id f8csp895765wri; Fri, 7 Mar 2025 10:07:45 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWWiSQb+yxewkZSEVWvUFMrbOaA739LruTHYlJ9cvjut7RDpppcKMBF+UJuEZhE3t3RAxAPGQ==@linaro.org X-Google-Smtp-Source: AGHT+IFzcLfJR6O7UTxR5UoOwDTVLZFeZpvwgHmfitkuUXLyucYnlmNCofixfjFqowImNKymeklR X-Received: by 2002:a05:6214:f62:b0:6e4:2198:12fe with SMTP id 6a1803df08f44-6e907d3ec3bmr7841486d6.18.1741370865792; Fri, 07 Mar 2025 10:07:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1741370865; cv=none; d=google.com; s=arc-20240605; b=D3Znfy7hX5AQQow/MSepEE18NIaKS7uwOoymGHo+sa0ryAPSqn+m+wGl2ombSD+pxe X3cS2iPnKW8rUn2v/fXUC8ZJmSsi2skqEwPvzEglownVEmaBsS4hh3kbpF7Mp7XGYycP UhqX8UP5v4/a7ZJASCDzFO4u9lIc4K7MGT4eEjgFdoQqviWGX4QQjC0VzQbCYVDvqMvL fbyWSyZYRgYs4NdiaxtJfL35LGq/LRVfOAkJ9oaTOKh4SI+jzddl27dbBe8vAJRozJ8M PFncEHzkQf6Hlhy++VL//kRWRFo0YOS2BmjO5ZJG/sG3CTj1MJUg4SlXNaFORwMFveni dGJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TEveCyP6FEOPe2OjJI8iFRo9o4gmTgwH3d2sFhPvDtA=; fh=ZyzqLhNGJAXkYZjVqygzIY1NON/Kumlz+Vm/jUj6bQE=; b=c7WFtiwaOkS6uAwSaVbiyZZ+qSt7kugbBzBvGggIO6xkX482yOOsMskc6D/XiBsN78 iAoD9zxfckvSqQNWwySoF/f0Qc30Sb6LpR+NX7NEVXYY4S5CVLp7v1NPwlqqOPAh9LMG i557taLg29ID/8klIGfjnqZvTO1z82wiZsaanZA5f4COB8XM/OwqYyB4mqihLfZSXhWb lkFF3Jj/ThW7dG+i1VfOSiP1SPGx56F+0FBMQ+H6DiJtZOaXeROaO/cjqZFo/v0mIGVN GMl6WvN76oOxfow/hVevYJSfGpWnwxjkTpKB2PeRMvRw0ccwkaRYs2pEa7DbvoTkyJ3U mJ8A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="lcGun/IU"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6e8f716291asi37313636d6.224.2025.03.07.10.07.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Mar 2025 10:07:45 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="lcGun/IU"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tqc3g-00042v-2W; Fri, 07 Mar 2025 13:04:28 -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 1tqc3Y-0003pE-Jg for qemu-devel@nongnu.org; Fri, 07 Mar 2025 13:04:22 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tqc3Q-0002BX-Ga for qemu-devel@nongnu.org; Fri, 07 Mar 2025 13:04:15 -0500 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-39129fc51f8so1881144f8f.0 for ; Fri, 07 Mar 2025 10:04:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741370647; x=1741975447; 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=TEveCyP6FEOPe2OjJI8iFRo9o4gmTgwH3d2sFhPvDtA=; b=lcGun/IUTR6VQs6MSI/befSpFGMUccPGOYgfkcp3BdMkkfAZdibD929fPJghSjNpqi xXzKjOUBEsCXa4nI8m6Kjz45zCYttEU3KavNhYVGVOhFoqMZj8ffDnzusShkT8YkWcmI yRVEpQVgjqB2jR5UlnAfY7Q5UfAFFQqL1FSXB2PB/rKIbrJqQ5r88SKh9ft8DD4LmPNZ uuJsOWefHcamkLdzqaMv9/gFdo0Xa7kjibXGRHw268IypX6M8ksDFHzH7WRIpNC8x7Xc MxcbaLGVNlMgIiGBR3r9JMrnD/Df4utMoc6Oh3Hpoz7R42sygmWR2Lt1l8lNP/4jjiZJ phsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741370647; x=1741975447; 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=TEveCyP6FEOPe2OjJI8iFRo9o4gmTgwH3d2sFhPvDtA=; b=oX1Azg8OZ6W788wcQLMCJU/tSNlz7EJSj/bBPyR1VSD9qGRBEbIcTBZolcL3KE4XBu RVKUc8tsRdBr/ZtHPS0AGkm/73Gym9KXEhXFDtEeQO6GWJBlRh0DyYsOktko0O1QKemn +3/OKvOzUt+NWDs4ywBWK3ZTbNx5KjNtws5jCbVmIsBuJNMYbcD5nkfIOHYVhwKEsFI7 LeimJESqKOn45Q7CuJKv/XKWa0C1jyFpMsJQD2jkfa4hZRwRzge2vitn5kiEDrXobdWs qnqzfxVEjoSbbIzlPRFiFg4kotIZMvy6i+xnz/ZYgUpV3zJiUupTFtfFtiyV76PZfsTD OQcw== X-Gm-Message-State: AOJu0Yx1dowq6krnk4rP14aDn0ZlFtT+/odMANaKubtYWipvdZNXJ3XV nu6RzF04qW7Hs7Lx+FxlcQDPK2zKyv5b418JzFg73tTwiE+5odR0Z+xb3MgWW6zHDHeJvyWl+f6 SbjM= X-Gm-Gg: ASbGncsEIK/NWf4Jrv+09OtjM6R8w+IKNz8KJGq1859PEy+7RQ52bdbgucAFoZyZYPh wv0BWWS1QGEIcypafryr6297ZBK5b/LVl4wgAMibRGy8yw9lPnxJrKt4kW6SbWRvmaSJnJy+jpZ 6kvqB+UZ7BbPaZc7oNCs7wd93eJr3e4s0utwqWZ+JoiEhpl23+9OJGxUWnt5fbC12z+6+WaSvKS y79qKwCbO0ORVw9P1ezMRcStvAVAd6BhPWtVYfMUk92Abz8HACou7OeDLVTQ7gYxAzVgMn3piyG bpZUwsUvLbTdq1VCiBDlfcCIQ6qPJcCZ1IxmPWDe2HzKnnW/iMoIjNew8zbAw3OjVxLvAzCaVDV mdMSJNYpiDRByyt1Pia4= X-Received: by 2002:a5d:64cd:0:b0:391:2995:5ef2 with SMTP id ffacd0b85a97d-39132dace0fmr2665116f8f.37.1741370647439; Fri, 07 Mar 2025 10:04:07 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3912c01d81csm6127965f8f.58.2025.03.07.10.04.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 07 Mar 2025 10:04:06 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Alex Williamson , Igor Mammedov , qemu-ppc@nongnu.org, Thomas Huth , Richard Henderson , Tony Krowiak , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , kvm@vger.kernel.org, Yi Liu , Paolo Bonzini , Zhenzhong Duan , Matthew Rosato , Eric Farman , Peter Xu , Pierrick Bouvier , Daniel Henrique Barboza , Eric Auger , qemu-s390x@nongnu.org, Jason Herne , =?utf-8?q?C=C3=A9dric_Le_Goater?= , David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Harsh Prateek Bora , Nicholas Piggin , Halil Pasic , Christian Borntraeger Subject: [PATCH 05/14] hw/vfio: Compile iommufd.c once Date: Fri, 7 Mar 2025 19:03:28 +0100 Message-ID: <20250307180337.14811-6-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250307180337.14811-1-philmd@linaro.org> References: <20250307180337.14811-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=philmd@linaro.org; helo=mail-wr1-x42e.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=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Removing unused "exec/ram_addr.h" header allow to compile iommufd.c once for all targets. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Richard Henderson Reviewed-by: Cédric Le Goater --- hw/vfio/iommufd.c | 1 - hw/vfio/meson.build | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/vfio/iommufd.c b/hw/vfio/iommufd.c index df61edffc08..42c8412bbf5 100644 --- a/hw/vfio/iommufd.c +++ b/hw/vfio/iommufd.c @@ -25,7 +25,6 @@ #include "qemu/cutils.h" #include "qemu/chardev_open.h" #include "pci.h" -#include "exec/ram_addr.h" static int iommufd_cdev_map(const VFIOContainerBase *bcontainer, hwaddr iova, ram_addr_t size, void *vaddr, bool readonly) diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build index 2972c6ff8de..fea6dbe88cd 100644 --- a/hw/vfio/meson.build +++ b/hw/vfio/meson.build @@ -4,9 +4,6 @@ vfio_ss.add(files( 'container.c', )) vfio_ss.add(when: 'CONFIG_PSERIES', if_true: files('spapr.c')) -vfio_ss.add(when: 'CONFIG_IOMMUFD', if_true: files( - 'iommufd.c', -)) vfio_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files( 'display.c', 'pci-quirks.c', @@ -28,3 +25,6 @@ system_ss.add(when: 'CONFIG_VFIO', if_true: files( 'migration-multifd.c', 'cpr.c', )) +system_ss.add(when: ['CONFIG_VFIO', 'CONFIG_IOMMUFD'], if_true: files( + 'iommufd.c', +)) From patchwork Fri Mar 7 18:03:29 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 871226 Delivered-To: patch@linaro.org Received: by 2002:a5d:64c8:0:b0:38f:210b:807b with SMTP id f8csp895635wri; Fri, 7 Mar 2025 10:07:30 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWw85eCHP98Xz6rIXBxl7x4tFLJ4iGjQKLj9lBEw9HmCUXmdIaCUEyix95czjdifYnw+IO19g==@linaro.org X-Google-Smtp-Source: AGHT+IEXTQr/S682l1a7N6RrHP5v8QSIc0HSB3QbPEN+DwwfunDmZaWyCcwfs5xtfjFDFDAi9Gge X-Received: by 2002:a05:600c:3b82:b0:43b:c3b0:56af with SMTP id 5b1f17b1804b1-43c601e1314mr35982235e9.14.1741370850628; Fri, 07 Mar 2025 10:07:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1741370850; cv=none; d=google.com; s=arc-20240605; b=Kps7LEC/pGcZbv11f9zy+5P0VkOzvCXhSYpOeUNZsYehdtQMkPHPTPTSvomtgeImIs sEgt7HnB/hGrDg/2gR6ekfrLFriGkeuHSQMNk3O+hSMOdLBR4DDZsO/4V8gJPZGXtiJA lRNgEci727+ca1BTDQH/ZLMAglG4yitwTkv10EghXEmkVMToZWs4oK9zjhPHJld0RFOY bxoFebp6pUzoTh16n1VViZtoXq8FrQG/tVZx80jU59uQjAkriR2O1Y3qFcBxBe205zVv A+b48Q+lp54JN5T/GsqbQ3Plgn+TBy6mjmAr3n4Xmr/pHRqTFGB6blqYg+oTF/grMhGj IQoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=MrW4KPeEMsJGAah1rF/LLgEoRbvBGZD/GNv5niDZ+2Y=; fh=ZyzqLhNGJAXkYZjVqygzIY1NON/Kumlz+Vm/jUj6bQE=; b=TXyMDWgCW6fk6nEz0GaGjHgGkJMDisRk+x0RLCX1ysJ0GOCaxvCjUIOxw8fzm/4kuy BU6i67bZ2J5YW0EsrezBwCHzrDvg1vnZCDzwZsAmox0XWrXCAVKBmAcU7n4nUJim3vgm uqtQqqoNrodBo4vPb9KWZii9+kohetIPelPNEcphHcx04cnrbsPqXQ2MDvxLWweI3Hql KFTV8gea4iVeK7pM1me81yX6SbcN6Qqd4QMMZSEg06Y0+FvTZ9TPltnb5gROUZlj/Og0 25+0HNtawAuHjQGVjpo2+3ggojo1tvjXmx1JjjAquvQ707Z+dVytprzktTnEPBHm67Rf iNDA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=slcup8AT; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 5b1f17b1804b1-43bd43484ccsi45129005e9.118.2025.03.07.10.07.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Mar 2025 10:07:30 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=slcup8AT; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tqc3g-000447-Jm; Fri, 07 Mar 2025 13:04:28 -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 1tqc3Y-0003pC-IG for qemu-devel@nongnu.org; Fri, 07 Mar 2025 13:04:22 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tqc3S-0002C5-Vp for qemu-devel@nongnu.org; Fri, 07 Mar 2025 13:04:16 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-43690d4605dso13550675e9.0 for ; Fri, 07 Mar 2025 10:04:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741370653; x=1741975453; 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=MrW4KPeEMsJGAah1rF/LLgEoRbvBGZD/GNv5niDZ+2Y=; b=slcup8ATBtXMjaMZKZunoCV9PcZRR83l4OITejKb0GtynPUukaY9c0DaWS/Gpk0fRc TAUG2EUSHzRzoij/DCSkBqGyjqwdv31FXaLBGjBXm5nROjrKf3dvVaz4/TcSWBAkVbNo lGBuBrzFz2k8dqEZTTMGjlJU93njeprZ9MXDP035DteSHUGD2EAfxUMw5P8ypubEhEic hRbvbaMoxUUljSa/HPjNQiOOUFdqyoHhdaINmfNQj+0TLduVJX7SpH6YTfQyK0PVIhqE tINgySvpxMXbMlT8Gs4cAFDnJzL36tqIpgkl6QJJvGwsBRFX+q5BECNjDak33UEvBlb5 TJ5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741370653; x=1741975453; 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=MrW4KPeEMsJGAah1rF/LLgEoRbvBGZD/GNv5niDZ+2Y=; b=nAIvov7HYmuau4gUgEzJKiaXOQQYL1iHyDvw5R30b6J5ItiraSUEXw/FdegC2YWCXA UNTuFTezAIJVIPoX6elV2Fn7gUHH3fArBeUXouTRRLkHGuqwfxMVHfmzwd9sQ77IKeDy 7Y9CrseiEkQO5dR0hIbKFlYoKQOnuDcFXk4mJlfJNQqc6pa3zAVPXL62Bq7oL3bf6NNs hY3QwDADkpb4+LrryUcFX8dbHthz2ep/L2Su7aKpRC65dyfyPP76WPTECFVHffAXwPZW 8aeyMfKJiADsCYWPeU4pUQlqbJLSrR3ztUD/qFXGEUsqNcwsH36suzTNlNUBVBUyQp2X 2U7w== X-Gm-Message-State: AOJu0YyeYjiZ5EtVR+ON+8n+imHcV+RZwwuQOW/KsTFKxFgvQmE3hnEj QEjgAtLo4DxdJdeylJAdzYtFLUsm3PVXBj6/VzW3ZfE8y6IdExFETNH4LpIfx4rOVe0515p4FLh TDSY= X-Gm-Gg: ASbGncvuBsBiJKA/mBX+9I7Ypo+KjwIm4q+eoZv38iRHjQo2NApINwHLq9pbsrHg0J2 vMK35HsttVwHLdw0sIUAceAY4kUncI642OaThsFuFP0CJf4Xpkfkp/fWzp6fe7xow8XXH6XdLQV ErgF3p1gcJuH/vHFvvT1yEMReFOfkTFNtRjQarO/CQkSAF1fKexnkxYWbRB9a843aUMwZRNP/pZ rpYAA9RHzFHHaOMpbfOg8tOIW+OxBWKYQO64+665YW3Wg5OTBhwo7c0Pxu9UsVsPUqf5Ei+RUhS jhkPkpP4eLBUwjI/s9yY/LBz1+j2zFTxICVqtWNarR+QcPdcgwgkb5oWTcqD2JXNj+gqkrTNlPz 5QHUW8cxTz2JURXqY1QY= X-Received: by 2002:a05:600c:4f87:b0:439:9828:c425 with SMTP id 5b1f17b1804b1-43c601d9508mr32710975e9.7.1741370652735; Fri, 07 Mar 2025 10:04:12 -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-43bdd8b046dsm58400885e9.5.2025.03.07.10.04.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 07 Mar 2025 10:04:12 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Alex Williamson , Igor Mammedov , qemu-ppc@nongnu.org, Thomas Huth , Richard Henderson , Tony Krowiak , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , kvm@vger.kernel.org, Yi Liu , Paolo Bonzini , Zhenzhong Duan , Matthew Rosato , Eric Farman , Peter Xu , Pierrick Bouvier , Daniel Henrique Barboza , Eric Auger , qemu-s390x@nongnu.org, Jason Herne , =?utf-8?q?C=C3=A9dric_Le_Goater?= , David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Harsh Prateek Bora , Nicholas Piggin , Halil Pasic , Christian Borntraeger Subject: [PATCH 06/14] system: Declare qemu_[min/max]rampagesize() in 'system/hostmem.h' Date: Fri, 7 Mar 2025 19:03:29 +0100 Message-ID: <20250307180337.14811-7-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250307180337.14811-1-philmd@linaro.org> References: <20250307180337.14811-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Both qemu_minrampagesize() and qemu_maxrampagesize() are related to host memory backends. Move their prototype declaration to "system/hostmem.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier --- include/exec/ram_addr.h | 3 --- include/system/hostmem.h | 3 +++ hw/ppc/spapr_caps.c | 1 + hw/s390x/s390-virtio-ccw.c | 1 + hw/vfio/spapr.c | 1 + 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h index 94bb3ccbe42..ccc8df561af 100644 --- a/include/exec/ram_addr.h +++ b/include/exec/ram_addr.h @@ -101,9 +101,6 @@ static inline unsigned long int ramblock_recv_bitmap_offset(void *host_addr, bool ramblock_is_pmem(RAMBlock *rb); -long qemu_minrampagesize(void); -long qemu_maxrampagesize(void); - /** * qemu_ram_alloc_from_file, * qemu_ram_alloc_from_fd: Allocate a ram block from the specified backing diff --git a/include/system/hostmem.h b/include/system/hostmem.h index 5c21ca55c01..62642e602ca 100644 --- a/include/system/hostmem.h +++ b/include/system/hostmem.h @@ -93,4 +93,7 @@ bool host_memory_backend_is_mapped(HostMemoryBackend *backend); size_t host_memory_backend_pagesize(HostMemoryBackend *memdev); char *host_memory_backend_get_name(HostMemoryBackend *backend); +long qemu_minrampagesize(void); +long qemu_maxrampagesize(void); + #endif diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c index 904bff87ce1..9e53d0c1fd1 100644 --- a/hw/ppc/spapr_caps.c +++ b/hw/ppc/spapr_caps.c @@ -34,6 +34,7 @@ #include "kvm_ppc.h" #include "migration/vmstate.h" #include "system/tcg.h" +#include "system/hostmem.h" #include "hw/ppc/spapr.h" diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 51ae0c133d8..1261d93b7ce 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -41,6 +41,7 @@ #include "hw/s390x/tod.h" #include "system/system.h" #include "system/cpus.h" +#include "system/hostmem.h" #include "target/s390x/kvm/pv.h" #include "migration/blocker.h" #include "qapi/visitor.h" diff --git a/hw/vfio/spapr.c b/hw/vfio/spapr.c index 9b5ad05bb1c..1a5d1611f2c 100644 --- a/hw/vfio/spapr.c +++ b/hw/vfio/spapr.c @@ -12,6 +12,7 @@ #include #include #include "system/kvm.h" +#include "system/hostmem.h" #include "exec/address-spaces.h" #include "hw/vfio/vfio-common.h" From patchwork Fri Mar 7 18:03:30 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 871219 Delivered-To: patch@linaro.org Received: by 2002:a5d:64c8:0:b0:38f:210b:807b with SMTP id f8csp894063wri; Fri, 7 Mar 2025 10:04:54 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWSOWVtilY8SCyJKsvXRzKKkIquSN+IY+z5rfu4ehJTIptRpgoJgeylVeSUJPmsFHSaa6frZQ==@linaro.org X-Google-Smtp-Source: AGHT+IH+mZarAQClB0KPF2dqskvDW9sce1pfNLZAYVCJgUG3Eta/bSj81ujCoyEwK9Os+ZLMiBvQ X-Received: by 2002:a05:6102:cd3:b0:4bb:eb4a:f9f0 with SMTP id ada2fe7eead31-4c30a76a09dmr3065967137.24.1741370694303; Fri, 07 Mar 2025 10:04:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1741370694; cv=none; d=google.com; s=arc-20240605; b=Wy9wUDRZJh9eeXEavZ7vfQQMf9IWkIy4xm146A+7rMu9gNP1eAKl9Vu8QXR2JbErdg 3OB17P7q+IDICQkrZCoED60pdJNvg/T6MUNb45emPeKYN+ZS4UW/AFzx4Za5Nc+ksG6R ab7a/26snYE1pIYPerGvCnsv9e/ll0KaLVgxVeXX1sgJc628PANBnnGYks1YYrn/5iTi sBBA5Q2kKJP0kOFxWjk5sYHhrqbe6SLZXKwfHUeGe9R+sgvJRt4Rn9lEoDPdq+uOJCmT yMr9i6zWKGM8Mk4SRAEbgIuFng1gPl4PYkkOGBKPs8n02BvleIWkp/MaeF16Lnhyx/S9 OwUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qbL4jYEWkDOTQMFiCDljIBBdBkk1lhILqkIilS+kSdQ=; fh=ZyzqLhNGJAXkYZjVqygzIY1NON/Kumlz+Vm/jUj6bQE=; b=FFFZ6d5laRO7GRMfnQjUO1ruMuihQibzQBucvLoO814L7kPznNKk4UqE9mBWhXIrkH 4rwoXiDNN6qsdatymA3FMqtxZ/qyE2DhUJJ8CxIF3W5wiHWqZaPWXppFoLjtbbT6h99E 1T3FxRWD6OzgPEWBehpxUdVmZb9vbkwCRsy8Fr3RITXJdzNaaBy7Mzn0FoAdbB8d7i/n vngS1SQWQP0g8OaV4gbAfcF6jddZHtlVmc1rpnirmuh/g3tbq7Wdx9VgdPljqN8RIgzg lu00VilH2YtL1SUSideBiH8AIoT6YKys4KZ16Nu1Xjp3tntTV9nM73L6qMNSYkhLrjRK hw2Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HKVoIiIo; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ada2fe7eead31-4c2fbc71744si1027790137.313.2025.03.07.10.04.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Mar 2025 10:04:54 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HKVoIiIo; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tqc3c-0003tz-W9; Fri, 07 Mar 2025 13:04:25 -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 1tqc3a-0003pU-0a for qemu-devel@nongnu.org; Fri, 07 Mar 2025 13:04:22 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tqc3Y-0002Cw-A3 for qemu-devel@nongnu.org; Fri, 07 Mar 2025 13:04:21 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-43bb6b0b898so18299055e9.1 for ; Fri, 07 Mar 2025 10:04:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741370658; x=1741975458; 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=qbL4jYEWkDOTQMFiCDljIBBdBkk1lhILqkIilS+kSdQ=; b=HKVoIiIoAJ1gDmGpff2w+WFjxf+iITnwQ6amPSOGbkNwnCInuvmE8kA+zGQyxTuOOx f9XjHxD/eSoFEliyozU9urdyM8BMxlSJTjsI/eh4cXYPQGcj/S6fI2jDcCXU3UrHJgMy GIepAVnNmOnawNJXawQNLLCywj49zcyJdYipyQVfR63eUvPZs6GTjp1CzxdFINh4RcGa srcQK3+qOaRUEBZLNrFU4syMfJYiRM3eqeShGovwM84QaK0oA96ZlRlQPiYVeHeiqEiF xQP7BY2skNNlfQoC8xETef61Jm7OwCeUgPiqt0lUVkcoQdbO3fVTWNB3t7L8lgRtHfgy TX3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741370658; x=1741975458; 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=qbL4jYEWkDOTQMFiCDljIBBdBkk1lhILqkIilS+kSdQ=; b=gEOy3aQRdR7hN2wdbFZUEV0USvHhjva5Ycu6vzSs0sp5Uzvn5W7l83aa4joaAvTbKf K72H97SBJgPqfx8yacc7wcHl6QohF3wMCKvr6dfr7479Ge9B/7tebgom7Hemv3yW2DQX OT2pADo8LANhz+fY7sfBVevvom31oeRNqYF5IW5z98lRoQYi0/DKQkUiS4bnrZhOw67s B6pgJ0UMwJx8SUflym/TeicePtF2jW/RF1GlQcZpHqcw0eGS0/t071dXg6iLzfMB9fpV pBHtLQ8P1WbggB5yyA3MZWPGjDrojh4ZI9FmP+z0i0cDvqKcCLPx0juuUvoA7rP1c643 GdFw== X-Gm-Message-State: AOJu0Yzi00PW87sb08D9u0JyprutBOFLveb5kito8YDLwfJIUMqdlk+F WzRama4ZJN/vbtKLSXrAXHL7DSYOpthWLf9G7kUoQrb+lNRizZm7DzDpRHfUoPM6ltPf+ZwoUmk TKSs= X-Gm-Gg: ASbGncubgERqsF3iRe3H0iaX6dAjloXhJUeaVsc9cV7evMUyiEqK5uwpcgDBCIRqC8p 7Drl70k6Za5898weMtOQjk7Yyzq23KRGr3flaQI4mgG4f/DGpuwmnjnn565F3zzW/R2x24ABlIj Ic4cY2uNspXGli7kg8WFlkvnLnw391xJOzL+fZXzNOfGR3XV6xJM4Ne2Z87m8lpXQT/sp+0MTeV UPvR3hCZvLmUN+7e5eLEP7H4xMIMH+V6td0q7p0jesmTYw9iHgOOobubtJRRQAExvgj+R8/vzFh VT4PlBqZs5GAOf6y7p34melhghTcXYJ7WKr1d0iN5vIMn3KFjHSz/3ulS5UCsdfu9yibA9xW+Ap In0CC02t5a762QnPNTSo= X-Received: by 2002:a05:600c:5117:b0:43b:d12a:40e4 with SMTP id 5b1f17b1804b1-43c601cfd31mr33628725e9.17.1741370658139; Fri, 07 Mar 2025 10:04:18 -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-43ce3d5a0e2sm5945365e9.12.2025.03.07.10.04.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 07 Mar 2025 10:04:17 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Alex Williamson , Igor Mammedov , qemu-ppc@nongnu.org, Thomas Huth , Richard Henderson , Tony Krowiak , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , kvm@vger.kernel.org, Yi Liu , Paolo Bonzini , Zhenzhong Duan , Matthew Rosato , Eric Farman , Peter Xu , Pierrick Bouvier , Daniel Henrique Barboza , Eric Auger , qemu-s390x@nongnu.org, Jason Herne , =?utf-8?q?C=C3=A9dric_Le_Goater?= , David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Harsh Prateek Bora , Nicholas Piggin , Halil Pasic , Christian Borntraeger Subject: [PATCH 07/14] hw/vfio: Compile display.c once Date: Fri, 7 Mar 2025 19:03:30 +0100 Message-ID: <20250307180337.14811-8-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250307180337.14811-1-philmd@linaro.org> References: <20250307180337.14811-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org display.c doesn't rely on target specific definitions, move it to system_ss[] to build it once. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Richard Henderson Reviewed-by: Cédric Le Goater --- hw/vfio/meson.build | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build index fea6dbe88cd..96e342aa8cb 100644 --- a/hw/vfio/meson.build +++ b/hw/vfio/meson.build @@ -5,7 +5,6 @@ vfio_ss.add(files( )) vfio_ss.add(when: 'CONFIG_PSERIES', if_true: files('spapr.c')) vfio_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files( - 'display.c', 'pci-quirks.c', 'pci.c', )) @@ -28,3 +27,6 @@ system_ss.add(when: 'CONFIG_VFIO', if_true: files( system_ss.add(when: ['CONFIG_VFIO', 'CONFIG_IOMMUFD'], if_true: files( 'iommufd.c', )) +system_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files( + 'display.c', +)) From patchwork Fri Mar 7 18:03:31 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 871228 Delivered-To: patch@linaro.org Received: by 2002:a5d:64c8:0:b0:38f:210b:807b with SMTP id f8csp895761wri; Fri, 7 Mar 2025 10:07:45 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVY/9TcVuAwobHXQxIXnRdKJASG8GZ353SaGGRzFPEhtN21tewEA60NGUH7OVMRu1XsM3/ofg==@linaro.org X-Google-Smtp-Source: AGHT+IHa62gAGepUDPR6GaP66+sidb9IwMkuHspz6j5m8vf7O38GDZUMBUOs940zOtFcTP+wwJCt X-Received: by 2002:a05:620a:601c:b0:7c3:d17b:cce1 with SMTP id af79cd13be357-7c4e619fab9mr679785685a.45.1741370865512; Fri, 07 Mar 2025 10:07:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1741370865; cv=none; d=google.com; s=arc-20240605; b=O+qglm1tr4pqrPz8IjB4xzoM3XyupJxywZkX8LSVT9xq5lNIPVEbN8+oEW5qdiXOwT sYcawOxyyOQK/q0fRD5J296gTjbFRPIJrFRzim4xJvVOMJJGIMcqj43Imxlk98joR3Fc PxdI5CJ3zGkvC/EI7zVj64EC6T624797Y06GecKY/mHxWWpy2o36CVID9s9T1OszqOfU 0F9TV1SliNcn/tQwaXhe1L/7EB7fMVviixejrRvw5TSG/W5CtUxUpUIpzImo3mMFAJUD cI3QcT+NtgTYnLvcXBmgUQJpohdaOPL/lzbXQ+mXPdeMJunweaujB2hjkYIi9y7f5OvD uV5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Zein7nNBqGkN3Vk6l0GAK1eJKKbYG2EwAlAfLaPQUy0=; fh=ZyzqLhNGJAXkYZjVqygzIY1NON/Kumlz+Vm/jUj6bQE=; b=C8jdvaQMRUMvmKnUCHWalQAERXgR+OCndEnP8Pp6M2Uh/0b2wdEcse4/FXMlp52S3k 6BbLTJXHRi6PJFK1aggEqfnHIldprm9eCPwBZxH4cCghWlBuTnztJEaMQgfgT6//kBPc Q4aOaHBFKNyXyNSwPSXsjLpdHZHOd+IKLuKyccvsmRkI9wM1Hb7ampfsMi8nhTQHJFAQ fbg0lWBDt7Jb1mYHA4uAaQBbogLuGSxHrfHJ0EgW3u6/NSO5rAahuPcQHmVmFX5z7WmS wzspJ+BCaXY9APDiSKamzljeCBlQKvppokpVMnnbO87Mwi5rSq1Z/NYz+V3e1oqjYZWJ AT9w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=LS922t0g; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=fail header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7c3e536f503si385903685a.193.2025.03.07.10.07.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Mar 2025 10:07:45 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=LS922t0g; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=fail header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tqc3i-00046f-G0; Fri, 07 Mar 2025 13:04:30 -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 1tqc3g-00044U-Q0 for qemu-devel@nongnu.org; Fri, 07 Mar 2025 13:04:28 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tqc3e-0002EX-71 for qemu-devel@nongnu.org; Fri, 07 Mar 2025 13:04:28 -0500 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-43bc31227ecso12605835e9.1 for ; Fri, 07 Mar 2025 10:04:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741370664; x=1741975464; 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=Zein7nNBqGkN3Vk6l0GAK1eJKKbYG2EwAlAfLaPQUy0=; b=LS922t0gmmWjeFetMZ/iHRNHCQhkAsBj3pHY0BSTtFhXbpQH4LsMEljxskNVtCiYmx NZANlVemkIIA/kUoqjwHl8jF+/jHQSDdFo7QTlTh1Pi73BH2WRgSCqy04yz9S51w0VPN AuSn7Eb+oMues7cqMl+VuyqXUN5rqjBZ4LlrU0kYjJP2PAkXBA4j8OHiyL/Vm2I6BzOe 3aWWvbUctrWUM6a6zjNZSsCyp4rF+ya/WE2McL+wKDkt3fwkhkZaSsrTwA3MM7dm+5ZE A6Ju+pnQkUzcDybALlenSAxf0FbGESIzTCbnudNNzVnZa5OTHo3eIz7egONcyFh9h//A mJ0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741370664; x=1741975464; 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=Zein7nNBqGkN3Vk6l0GAK1eJKKbYG2EwAlAfLaPQUy0=; b=VEasGRbWCpI8ocllOiNOs17pGIaRkAhObY0qp1XQA8uD+xQ/JrwdBcMYgMb6f8XTwM rEdKO5dsvn838dNXB/idfcgdmrzX141K8aaq0vCVVBxJHG1kgz8dU8Jz3ph9Yqa1mMR5 PnjFbcdRCBZWioy/phrhKwINsL5rfCjSIyZijjNd+f9cuEu/67LINgRPxGNJIxcmM/sb iH4rOcf/f0RurSpJRj9iO9IWRYDzmvohp8muK8jxvYPPjDUvwEASoobOriHFKWeLYmJB NmrDWjdAExD7WIrCiwElNX8d/4b+UHeYGDKAUHI0ly2zIfZ435nDDbRGV0blTQafAU4u VCcg== X-Gm-Message-State: AOJu0YxvuqW1IFaAnIBWxaviF8O/qas/KIYRxUAkk2YMP3MTOry8luQa hMQXjnCO+ClkU4SU2Dn1eqydNKlbAUsqezLHBWRBtBOVXI/kciKzaQ6DEnkva+ELlVq1DCz23it CnxU= X-Gm-Gg: ASbGnctdZK9E+YmKnQ4rGOfZ5w1zuAFQgxnv7SmvKu8kqCzXi+T7HhoOtYqnRYVyRgl 7eohGp+SzURLfqZu6NRnCzAALKeOESHF36m3IxSyJP2IPORV0LNW09VhShyNbxUHDlxAr9qD7WJ juadj1rAy3cusPpB7PX862gnGByIy2Vwr2LqSMF8m8W5yRWsnyYTgDua75Hee/kyKbSt9g4vWBk /sYv7PT4K7sth7sT2y5lhx4FXbUrsXTiwJoGkiKfWjmNu4gneY6eUyJmoIJemuqbraNDSekZMDC TuzipLNnj4uoTAI5wu0qz2BGN+2YvAY3uMaW5QguVwvmUCrsATbfr4MTRgCKkahOkJU/dY+iLr2 LTvTTMRak4d1jPUJCNBo= X-Received: by 2002:a05:600c:6d8e:b0:43b:cc3c:60ca with SMTP id 5b1f17b1804b1-43c5a631736mr27612245e9.21.1741370663562; Fri, 07 Mar 2025 10:04:23 -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-43bdd8da097sm60151705e9.17.2025.03.07.10.04.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 07 Mar 2025 10:04:23 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Alex Williamson , Igor Mammedov , qemu-ppc@nongnu.org, Thomas Huth , Richard Henderson , Tony Krowiak , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , kvm@vger.kernel.org, Yi Liu , Paolo Bonzini , Zhenzhong Duan , Matthew Rosato , Eric Farman , Peter Xu , Pierrick Bouvier , Daniel Henrique Barboza , Eric Auger , qemu-s390x@nongnu.org, Jason Herne , =?utf-8?q?C=C3=A9dric_Le_Goater?= , David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Harsh Prateek Bora , Nicholas Piggin , Halil Pasic , Christian Borntraeger Subject: [PATCH 08/14] system/kvm: Expose kvm_irqchip_[add, remove]_change_notifier() Date: Fri, 7 Mar 2025 19:03:31 +0100 Message-ID: <20250307180337.14811-9-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250307180337.14811-1-philmd@linaro.org> References: <20250307180337.14811-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Currently kvm_irqchip_add_irqfd_notifier() and kvm_irqchip_remove_irqfd_notifier() are only declared on target specific code. There is not particular reason to, as their prototypes don't use anything target related. Move their declaration with common prototypes, and implement their stub. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier --- include/system/kvm.h | 8 ++++---- accel/stubs/kvm-stub.c | 12 ++++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/include/system/kvm.h b/include/system/kvm.h index ab17c09a551..75673fb794e 100644 --- a/include/system/kvm.h +++ b/include/system/kvm.h @@ -412,10 +412,6 @@ int kvm_irqchip_send_msi(KVMState *s, MSIMessage msg); void kvm_irqchip_add_irq_route(KVMState *s, int gsi, int irqchip, int pin); -void kvm_irqchip_add_change_notifier(Notifier *n); -void kvm_irqchip_remove_change_notifier(Notifier *n); -void kvm_irqchip_change_notify(void); - struct kvm_guest_debug; struct kvm_debug_exit_arch; @@ -517,6 +513,10 @@ void kvm_irqchip_release_virq(KVMState *s, int virq); void kvm_add_routing_entry(KVMState *s, struct kvm_irq_routing_entry *entry); +void kvm_irqchip_add_change_notifier(Notifier *n); +void kvm_irqchip_remove_change_notifier(Notifier *n); +void kvm_irqchip_change_notify(void); + int kvm_irqchip_add_irqfd_notifier_gsi(KVMState *s, EventNotifier *n, EventNotifier *rn, int virq); int kvm_irqchip_remove_irqfd_notifier_gsi(KVMState *s, EventNotifier *n, diff --git a/accel/stubs/kvm-stub.c b/accel/stubs/kvm-stub.c index ecfd7636f5f..a305b33d84d 100644 --- a/accel/stubs/kvm-stub.c +++ b/accel/stubs/kvm-stub.c @@ -83,6 +83,18 @@ void kvm_irqchip_change_notify(void) { } +int kvm_irqchip_add_irqfd_notifier(KVMState *s, EventNotifier *n, + EventNotifier *rn, qemu_irq irq) +{ + return -ENOSYS; +} + +int kvm_irqchip_remove_irqfd_notifier(KVMState *s, EventNotifier *n, + qemu_irq irq) +{ + return -ENOSYS; +} + int kvm_irqchip_add_irqfd_notifier_gsi(KVMState *s, EventNotifier *n, EventNotifier *rn, int virq) { From patchwork Fri Mar 7 18:03:32 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 871221 Delivered-To: patch@linaro.org Received: by 2002:a5d:64c8:0:b0:38f:210b:807b with SMTP id f8csp894974wri; Fri, 7 Mar 2025 10:06:21 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVmH8H/uDgEEQJ/MVfwauB6xJuRo8WEHmnhlrO9y7FXfFDm5h8FdGbPfkXboyqTbc6hGKXYRw==@linaro.org X-Google-Smtp-Source: AGHT+IEsE6k5t70aAPX8Pw/XAy0ns6MGOx3v66tCfaxRMmmaidgfbSSKcSH7XGciZOKrYEilU0N6 X-Received: by 2002:a05:6102:d8f:b0:4bb:e6bc:e16d with SMTP id ada2fe7eead31-4c30a6b1f28mr2828414137.20.1741370781682; Fri, 07 Mar 2025 10:06:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1741370781; cv=none; d=google.com; s=arc-20240605; b=VA8IMWt8axbgz7mvIqfM3JXdirZRtO3275tZNObwDcL/S/6M1ae4lS+x+ord9SO3Fx xTiV+7OAOHbPZQf4pr1miOYN2VFvt6Itr+GHmwCCsPldbyNlKK34t+RNCawKdpd/6UKV ZvWY/mAF18ZU+E147ER+Kum4mQbSgr09gERO45b8uyr/oEFvjrIb1fqlaoAXcZb85cVQ daIHKawYdYY5ZBQ9q1gjWb5UotJSfeRtfpWRZyNbI3q8BXnLmKGdXGd+YeiwX8aufE3c jWKT66h5hNy04ETAty1iVW0HtygF6we9fP8VLKiCZFwTH7kReKQTOyCwBUF+0NAIcnDD GPXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qgqJlQXPaNCurtKb37o64LFzMpOza3vmaLhco3Sgch0=; fh=ZyzqLhNGJAXkYZjVqygzIY1NON/Kumlz+Vm/jUj6bQE=; b=f6+J1sf8Nb4EzTC9LcS7bz/Dt89uPjsDfMdAC1T+bs1DDuZ/c0gNahmND+gIEAuoMF 2hgp5JeVz+GQREF3kItB3x2RXHMGAa+iQJXKt8+Xk0zl87K/7ZnlOscHz5ktFwk7pjfC 7v6aSWIYz1WFqbJ2bSNP6hbsez5r+poqTlEVrm3mk9kPVUFLH4PWJ+/XTz/UygOaWOTz th9eFEOiFjcKJeCtzfONDGMdtw81cPO7jRE85KNQkdOxbEbmwxwnH3CdXx7ZEAg8KpF4 v4dLBctvVXp/H1BouHkNVfr5ZDz/X3/hIbH6ylWC4/TwKJKX+S9+Vob5JLICO8MjG3yQ Vj2Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rPeIhdYT; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ada2fe7eead31-4c2fbc72050si995818137.248.2025.03.07.10.06.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Mar 2025 10:06:21 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rPeIhdYT; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tqc3u-0004Ft-HE; Fri, 07 Mar 2025 13:04:44 -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 1tqc3m-00047k-4G for qemu-devel@nongnu.org; Fri, 07 Mar 2025 13:04:34 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tqc3j-0002FR-QJ for qemu-devel@nongnu.org; Fri, 07 Mar 2025 13:04:33 -0500 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-390f69f8083so1829250f8f.0 for ; Fri, 07 Mar 2025 10:04:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741370670; x=1741975470; 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=qgqJlQXPaNCurtKb37o64LFzMpOza3vmaLhco3Sgch0=; b=rPeIhdYTUtupcpshUxhysVrJVQ+V76TMO64qM7dZw4WaOEGyx5Wn8QYsAHx+g1ovwV nYFKm/8/3NdnLLKC1gi3aA5uh6+dO0S2o3bv6yPVYa32HnMDTm0EeddIiu3LPvRUJsJz k4qkg4kVrjA8KMCGkxi+5k30mk09MUhfXPxRnaXNo0xGXQKCNAEpaxc1eYSkX3kEmKwS qfjXpkpEX1JdatQorUFbBkl+eeOa490WmsvhSWGaIcJNxF376/Uqq+HP64dkDJ75+eO+ se0G/IlUjPVHElz3vbXvo34hiQYSB8xlFz6aBZh7iSLGDFh4AY6dPjmkH1j+J+01YC+1 jKMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741370670; x=1741975470; 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=qgqJlQXPaNCurtKb37o64LFzMpOza3vmaLhco3Sgch0=; b=L3Ksdrg4b0hRPERZzrjrkeep3jPwyrfR1yoHvh0sNn63kpJqoNyOjsX738yreRxDwf NM4BOxqIDjqv5DU7qsNdlfIc/BwK5GRDsKB/t+ycOR36GuSzwqp0DGoBYJ87P50j9h6H VGrYGyYrwzcM4u1Nlv8D3UUKuUh//MujARmyIaxDR6TBrVcMd7zx/p+/wFZK6urX+43y rKwdqyPSuzLdF8qX4+PleDuyn2YSuxGl5sS9/EXrPN/OgCFizk1XqkzG/7j5WznFnVzy IyCDOqLZ3A14X2cUsCiwHW0WNVE1BA94yKZdvBRUP1xlfBoZ5Hl3yhvl+Ku0gqHb7AaV Ue8Q== X-Gm-Message-State: AOJu0Yw78qelfpRdkZfjki19jpMX9G1ChMClXXJrmtSQa8XIPOrp3+X6 Wxu9xo/1F8zG7jk8APFcF4n0f9acMKzcsG6dTuhCMYv9ArSFNWzS/fsIcq88ocVbgFCM0OmcCWn GUeM= X-Gm-Gg: ASbGncvDMJlgSpwHJ2WTz3y+mCBl/A8Jgv+Jv9DUzvAcrcmZhhQmZoJOAE+wMk6NTZz yOQfTMM/4KkU857atGXbF96p/9RzPVSbkrnls88sBMsHnpGFGp0v3a0blihWUY0Nbwu/LqRRDKI JzsHMwXVNdDpPDUTuiUJ9wymfG6/V9hEs1UNjWQXxk2dIw5E0TN/t1X6pmWfNYEiR+jucE8GSTW Z6NyfLpIb0oYAKzQQ/KGjfWhvd0IBv0edWlXcY9wLnr6vdE953ExDEMxp2RGdh8qB4kHUJWbkvw 3ejAM2bL1kvgETZ+1dhnd728bqyt8EcLvlAJRzdM8fpu4BHgA3WqTCg/GUnwBJ5do0Pif1F3IO0 Bde7Po23Xe68Qpd21DrE= X-Received: by 2002:a5d:64a4:0:b0:390:fbdd:994d with SMTP id ffacd0b85a97d-39132d45d52mr2858940f8f.27.1741370669687; Fri, 07 Mar 2025 10:04:29 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3912c015a29sm5961965f8f.42.2025.03.07.10.04.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 07 Mar 2025 10:04:29 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Alex Williamson , Igor Mammedov , qemu-ppc@nongnu.org, Thomas Huth , Richard Henderson , Tony Krowiak , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , kvm@vger.kernel.org, Yi Liu , Paolo Bonzini , Zhenzhong Duan , Matthew Rosato , Eric Farman , Peter Xu , Pierrick Bouvier , Daniel Henrique Barboza , Eric Auger , qemu-s390x@nongnu.org, Jason Herne , =?utf-8?q?C=C3=A9dric_Le_Goater?= , David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Harsh Prateek Bora , Nicholas Piggin , Halil Pasic , Christian Borntraeger Subject: [PATCH 09/14] hw/vfio/pci: Convert CONFIG_KVM check to runtime one Date: Fri, 7 Mar 2025 19:03:32 +0100 Message-ID: <20250307180337.14811-10-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250307180337.14811-1-philmd@linaro.org> References: <20250307180337.14811-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Use the runtime kvm_enabled() helper to check whether KVM is available or not. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Richard Henderson Reviewed-by: Cédric Le Goater --- hw/vfio/pci.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index fdbc15885d4..9872884ff8a 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -118,8 +118,13 @@ static void vfio_intx_eoi(VFIODevice *vbasedev) static bool vfio_intx_enable_kvm(VFIOPCIDevice *vdev, Error **errp) { -#ifdef CONFIG_KVM - int irq_fd = event_notifier_get_fd(&vdev->intx.interrupt); + int irq_fd; + + if (!kvm_enabled()) { + return true; + } + + irq_fd = event_notifier_get_fd(&vdev->intx.interrupt); if (vdev->no_kvm_intx || !kvm_irqfds_enabled() || vdev->intx.route.mode != PCI_INTX_ENABLED || @@ -171,16 +176,13 @@ fail_irqfd: fail: qemu_set_fd_handler(irq_fd, vfio_intx_interrupt, NULL, vdev); vfio_unmask_single_irqindex(&vdev->vbasedev, VFIO_PCI_INTX_IRQ_INDEX); + return false; -#else - return true; -#endif } static void vfio_intx_disable_kvm(VFIOPCIDevice *vdev) { -#ifdef CONFIG_KVM - if (!vdev->intx.kvm_accel) { + if (!kvm_enabled() || !vdev->intx.kvm_accel) { return; } @@ -211,7 +213,6 @@ static void vfio_intx_disable_kvm(VFIOPCIDevice *vdev) vfio_unmask_single_irqindex(&vdev->vbasedev, VFIO_PCI_INTX_IRQ_INDEX); trace_vfio_intx_disable_kvm(vdev->vbasedev.name); -#endif } static void vfio_intx_update(VFIOPCIDevice *vdev, PCIINTxRoute *route) @@ -278,7 +279,6 @@ static bool vfio_intx_enable(VFIOPCIDevice *vdev, Error **errp) vdev->intx.pin = pin - 1; /* Pin A (1) -> irq[0] */ pci_config_set_interrupt_pin(vdev->pdev.config, pin); -#ifdef CONFIG_KVM /* * Only conditional to avoid generating error messages on platforms * where we won't actually use the result anyway. @@ -287,7 +287,6 @@ static bool vfio_intx_enable(VFIOPCIDevice *vdev, Error **errp) vdev->intx.route = pci_device_route_intx_to_irq(&vdev->pdev, vdev->intx.pin); } -#endif ret = event_notifier_init(&vdev->intx.interrupt, 0); if (ret) { From patchwork Fri Mar 7 18:03:33 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 871220 Delivered-To: patch@linaro.org Received: by 2002:a5d:64c8:0:b0:38f:210b:807b with SMTP id f8csp894632wri; Fri, 7 Mar 2025 10:05:50 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW9LZvin6vVcRCZI8gHihUOngHE+wJ+uRAY6zcLlbpPBeC+3h0ULDeCpBGNM3Pmtj4V5MP4oQ==@linaro.org X-Google-Smtp-Source: AGHT+IGhoyyhJrB0+7Vd+Q/l++xKtCdkxrfSCbFPZXVT+QL5rWiVMIoY567XUC3YEOIc3yoPVFuX X-Received: by 2002:a05:620a:8908:b0:7c3:ceeb:7d4f with SMTP id af79cd13be357-7c4e6199c12mr687025485a.51.1741370749895; Fri, 07 Mar 2025 10:05:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1741370749; cv=none; d=google.com; s=arc-20240605; b=UhXEmTKITR5ToFwXFyjBq5EmbMPGcLwniBUQJXHz2e/HLV484swbDdWlSOSava9Rhy qJuTTCVcgUGJ/xcfO/cRUbGai6GjHzTig58goN0mq7TFqctq/VdylyaUmb5H+2prTb5B vhY7viCtjPI3upgxlViaalwD4j3jT/2iWUwNPBJMAInYwJHQrDqTD4Dr3aiOO77tIMna WAC1MyTJczsCj+3T9E8Url3HSa0wsSwO3EfPc38XMR6RHGb1xvk7WcwrLkSiN2Xh8LQN 8yG2N4oxNFE5U7UUdn0d1EiBsdz202Dn/ftnzogl8p81osYODaYKQTKYslfzHlGoAmwO 0tDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=jwX1K0+iQl31BRmPX8xi9KD5c4T56nkQjSQYXLzdF0A=; fh=ZyzqLhNGJAXkYZjVqygzIY1NON/Kumlz+Vm/jUj6bQE=; b=Ya/6Q4Zrq0MpKbnL5AFHK69mg/N9wWEsqvDNaCGzLHStzN5GOvnOVaC/JLNRP2Tbmm K2C+AYiBSiSH4MumyZdLldElYL1xRzN2hxjrQ6rq0ELcBglaF71RfsaHwh0ylcZ9cLSV ZsMgZYyNmZ72ypO6jD+1qXzC/LPJK2u5lwiKYzFcIUK96Bhp3a39Xy5xGpKMtGC+8MX9 anFgRUeX9FTFtx+F94+cdvmZxpTdbGgF4uMbgZje7VKhczTKJerrcmmccR3e8aot5Pk1 nZQzwVCqqrXo4dRoDRo6TpjdTc5ReiN28WsSYxapf5EIqVNi0c+riMsI4xVY7Og6eRNE Ww0A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FsaGK+bY; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7c3e533b6e0si397904185a.121.2025.03.07.10.05.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Mar 2025 10:05:49 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FsaGK+bY; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tqc4f-00052v-9h; Fri, 07 Mar 2025 13:05:35 -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 1tqc3s-0004FE-83 for qemu-devel@nongnu.org; Fri, 07 Mar 2025 13:04:40 -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 1tqc3p-0002GQ-7h for qemu-devel@nongnu.org; Fri, 07 Mar 2025 13:04:39 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4394a823036so18351005e9.0 for ; Fri, 07 Mar 2025 10:04:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741370675; x=1741975475; 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=jwX1K0+iQl31BRmPX8xi9KD5c4T56nkQjSQYXLzdF0A=; b=FsaGK+bYWMrrh1VO/iXLetGyjlNAB0rEFx8h9NyObQsRr6MS2DfTywFCRUkVvOIcGt +DIs3wJQTNioNiisTopZ+5iyTWkIoRsUZ+ALNIVb8Ec20ZD5W1vRxz850koLIAoYd4y6 o1Z58s/32fdXayGgmPpS4np3kTxQiRlAY5AvkulUGiEx+aSaiHAserAAlqo1BAI/UpL7 4vvZVnG9k2Ik0QVWLvBbnhJ7GTx75sjSiHm0xGdW1jTYeO5/I+lkLBgVjOiH7H/WXEKC +lgPvcxwERvxAH4GPZpprbgP7WThhj9+pJ4g4GR8QyTafwzDDz7pfQzEIl9MKqbBVdJn AKyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741370675; x=1741975475; 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=jwX1K0+iQl31BRmPX8xi9KD5c4T56nkQjSQYXLzdF0A=; b=sSR/rFklsuREpW9wiTEsfEgX46fFQunSiGXJUZK5RoD44OT+DVXmQh2Jgk4RIkgtjC 8OOGElHrG9q+KAV6lc8vsURlkyIviuIlpJEJ7OAfG82a+idsyCovkXBm6HmRwtrGXVqS G89VzbYzeRm44yVavP59msIE4Io5G4Wyk/DnmLEBsEITXZuyPec6fuezB+d0nByOCNx5 U+AOMVQBOY768QqhIAqgI3e5ponWOBX7wYkNojPMRq0I8PV2qvg85CzQIXC8M+6KqExx BoKW1Hz/B6Juy2/PDt22gLsJu7nIO4ca1+kUcz4hzvvAH9adpgI+/JQUUpF1jHh/Z+f+ YlMg== X-Gm-Message-State: AOJu0YzgQFDehffAtH4O1+wOksbWmkXTxq6iIM38qtxwQcDfpVFyxURY lg7SMwqHLtp+icyErwgKVpifhs4+vKSASTc4ZEeJjVCqyTl/uuD7jSx7uepRBPXwNTNUtReCED3 iAe0= X-Gm-Gg: ASbGncsEXp3Ypc6kfrm/kYA2vOFm6HMvyM3ys9zL/j9Ld24ZO5Lq0X5Ejoc2zlPBGr4 Al1NaQm5zvNhcJbK4CFZ4yu9GClv2cC9lLqCo4KRNGAG+9Qgjs+uk2gZ8n3JT811udcwHegipxI +Au08cB2vkuJbYWAdOKPXWMOGGlYhQdJSMC+CGKWYBVpBVp5bH8pAo/iAxNiiqxJ/c6QpEwv3xB ZfC+H4RNoHLgnqHEyQxkOY+7NDXaSkEn5urncb6LyWu9buJagvngIPejNbhJNmAqTDV8yqTBW7j Y/5fuWL1PIHabNBynka6D9mC+o3Gbrzdv22pveKw52ON2u5IRDx7eick+Bs4NDshOFxsGaoFrxZ KsZKieqO5dVG4v9iwXBY= X-Received: by 2002:a05:600c:350a:b0:439:86fb:7326 with SMTP id 5b1f17b1804b1-43c602082a0mr29865065e9.22.1741370675155; Fri, 07 Mar 2025 10:04:35 -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-43bdd8db6c7sm58089865e9.22.2025.03.07.10.04.33 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 07 Mar 2025 10:04:34 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Alex Williamson , Igor Mammedov , qemu-ppc@nongnu.org, Thomas Huth , Richard Henderson , Tony Krowiak , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , kvm@vger.kernel.org, Yi Liu , Paolo Bonzini , Zhenzhong Duan , Matthew Rosato , Eric Farman , Peter Xu , Pierrick Bouvier , Daniel Henrique Barboza , Eric Auger , qemu-s390x@nongnu.org, Jason Herne , =?utf-8?q?C=C3=A9dric_Le_Goater?= , David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Harsh Prateek Bora , Nicholas Piggin , Halil Pasic , Christian Borntraeger Subject: [PATCH 10/14] system/iommufd: Introduce iommufd_builtin() helper Date: Fri, 7 Mar 2025 19:03:33 +0100 Message-ID: <20250307180337.14811-11-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250307180337.14811-1-philmd@linaro.org> References: <20250307180337.14811-1-philmd@linaro.org> MIME-Version: 1.0 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org iommufd_builtin() can be used to check at runtime whether the IOMMUFD feature is built in a qemu-system binary. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Richard Henderson --- docs/devel/vfio-iommufd.rst | 2 +- include/system/iommufd.h | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/devel/vfio-iommufd.rst b/docs/devel/vfio-iommufd.rst index 3d1c11f175e..08882094eee 100644 --- a/docs/devel/vfio-iommufd.rst +++ b/docs/devel/vfio-iommufd.rst @@ -88,7 +88,7 @@ Step 2: configure QEMU ---------------------- Interactions with the ``/dev/iommu`` are abstracted by a new iommufd -object (compiled in with the ``CONFIG_IOMMUFD`` option). +object (which availability can be checked at runtime using ``iommufd_builtin()``). Any QEMU device (e.g. VFIO device) wishing to use ``/dev/iommu`` must be linked with an iommufd object. It gets a new optional property diff --git a/include/system/iommufd.h b/include/system/iommufd.h index cbab75bfbf6..ce459254025 100644 --- a/include/system/iommufd.h +++ b/include/system/iommufd.h @@ -63,4 +63,12 @@ bool iommufd_backend_get_dirty_bitmap(IOMMUFDBackend *be, uint32_t hwpt_id, Error **errp); #define TYPE_HOST_IOMMU_DEVICE_IOMMUFD TYPE_HOST_IOMMU_DEVICE "-iommufd" + +static inline bool iommufd_builtin(void) +{ + bool ambig = false; + + return object_resolve_path_type("", TYPE_IOMMUFD_BACKEND, &ambig) || ambig; +} + #endif From patchwork Fri Mar 7 18:03:34 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 871225 Delivered-To: patch@linaro.org Received: by 2002:a5d:64c8:0:b0:38f:210b:807b with SMTP id f8csp895597wri; Fri, 7 Mar 2025 10:07:27 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVAVB2PToNFvJppWK9E1xHPOPqHeRQsHubD32CGN1rBAhqbea3NFFGgB0iXEbYvyHADUeomhw==@linaro.org X-Google-Smtp-Source: AGHT+IFRv+08GRxXD/QYLTYApAXl7+mqEfAAXfaULg+7epdLSJnRlKKmlzhVGbR4KkQU2cT15n2V X-Received: by 2002:a05:620a:8719:b0:7c3:d6b7:cfa6 with SMTP id af79cd13be357-7c4e6194697mr623564285a.51.1741370846951; Fri, 07 Mar 2025 10:07:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1741370846; cv=none; d=google.com; s=arc-20240605; b=AQ21IZKr4OtbXkQ5n6qfgWTGlXambLraTEjaPQ17AV1qBfEf09bKmXm0/ZfyOttq90 cfRMu4PoU+0woZBjPbe6p4pGL7sxKsaBvyBQpY2SKmAMuaLoTyLyIZPpYQiNU2ovM7kl 8vlCXW/T52Zb5vbnE9Vwq535VyrYLmiUkn/vi85TUHbEoqchqSWAnwR80mtdrsIngPhC UnUP6vHUll67TIUYo5bLu5GVCwXI9vuC3q8hv/b/1tJk9yqWGRXqrKV9/WU549lfkQro 9f03QTQ3cHV2R310zYo5yeCR2rQBp8JGyXAmJZD+Tjmm+1WQtLltbW1zSt2t2OqSFcGQ 0yUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=otdB0Dz5nRAMnlnyGAk6/GxyQibbHb9x6DFoSBTI7l0=; fh=ZyzqLhNGJAXkYZjVqygzIY1NON/Kumlz+Vm/jUj6bQE=; b=XWgwQZCbY+YK6cTYkBd6/hfFwnbQm3bL7PJXgNF3qNFKo7V3UfqtiGd6JMwVljUAfr +JVNAQDMtPNYOwnSwjf/qhYZ/56WZlAQ7f0KgVZ6KPUriMUqmBzk6qibqFPiLzsl9Zfd yslN/AviqtC0m/5OdhdSiZ5Rlt5z9IBOoHLyZBBJvqD1+xTrNoPxBOhI/bs6Qlq2zglj VVrRHHwDVwRGuEMxPi8LI/W3DfSqUmDbd2TNPrkW6/ei1KBXKjwoU0JnjARIPYSBFTZg CZaslaKqaL7CFW64sA5QKcijobU3sZZGcL5l8fat6y6cTT00vO7fKojPxIe9aRZyfRbr c1OA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Tvs8+1q8; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7c3e55439b7si391085785a.505.2025.03.07.10.07.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Mar 2025 10:07:26 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Tvs8+1q8; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tqc5f-0006YY-Vc; Fri, 07 Mar 2025 13:06: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 1tqc3x-0004LL-Kc for qemu-devel@nongnu.org; Fri, 07 Mar 2025 13:04:46 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tqc3u-0002Ia-K4 for qemu-devel@nongnu.org; Fri, 07 Mar 2025 13:04:45 -0500 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-390e702d481so1168656f8f.1 for ; Fri, 07 Mar 2025 10:04:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741370681; x=1741975481; 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=otdB0Dz5nRAMnlnyGAk6/GxyQibbHb9x6DFoSBTI7l0=; b=Tvs8+1q8i7N+avAe1w9JySLJKId9LqyaNg12JeYnWit2UTki8AozYf19g/FM1rGHCC HQCn2yPAoC1uRqFzZrXKCMyhuRWM8Cu+dj7XuOlV5h+4xDP3eOYTHAWCoypeSu+Lgijr 0AHZdPZmW6uTZm/1HLK4siNrv9KwUoIGmrc774WrPoJnYekReo0EYi/jJ3WE6q3xaScK hNveDEfe5bWJ9xK7UsQ1pW3aimm6PKl92Aah2q85wUZd3QO/VkxHJjps2kfCP/lmx3oG JcZb2l4GH1OSLeFUZRkkwWU1u7crDpETYUg4dYOvZTEvqjcnpkeebjx17JxCCj4FnAWM ymgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741370681; x=1741975481; 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=otdB0Dz5nRAMnlnyGAk6/GxyQibbHb9x6DFoSBTI7l0=; b=Mcl8zjK/bt7V3q6QtMjPtM61zgl1J2tZ2cC0mcxBshMm+zBKg/To8fpHCjH2U7IzcN r/SvFoz6T6KbAB/qxtV+OhPhq1o/5Rs9Us7zqMA/rYwCnzMzYY0/2z3CMBjsBBuFrHsX 5o8JulGp8Ri/mLpLqlPPdBrvnmFaLwaoCJYVmz+hGHQMbeGAMDQZhJzg8q6gxQRLPsR+ xEBrHmI8IWnCCghKmj93H1AHs9xmP4vjww/fPI7PxqsNsVZfPov62qZug4TxV0TY8XND /3Vbqk22AUOtthrx89SsXMXqK7kDxoOJ+XlNLrcBHD13Cgyj0PD2Vt017wgyyojilGtx dmVQ== X-Gm-Message-State: AOJu0YwCBY7tiIOB52/HL9OWmw+P1SrpJCFUDsRy3YfqwDhZtm8GOtwE sM9cpB7Nk6ekmIZOKIRabtyn5AyyInrlLsETrLUM4PA+TIs99fhQkZ8e3uXiOpTZBhDLLP8dCbt /xtM= X-Gm-Gg: ASbGncs7CSLUZ80WXwl3djVYxsJIYF2x8aVVnHxFaUEEKaa1Ysw3AcWN7rwOThJ8GPb Qzb+v9uA6X5E3eiqOGebuigPUScnCKK+2ptMEifQNsPjpH/Dr8SlKDuspCvUg7vxI3Nc+ZYKXEh pYLrNw5AkPAeeSQap/lug7MTOLwy4veEbqj6FuIVf6WwUHrZmQ9bWMRnwWA6ryiERUPCq6C09sX bDd+EW6FeujlfQQYHDbWEMyGS46tIITIGXYtQQOc/LU60xTrl6zSF87ppC4hwIe9uhbMDir3kuM zWzbBmahRLHNmqRR4I8E3OmYnSCiMtwm4vmro8i2keN6HGwqqka35LTeTD0b4o7bUge1H5IQzdW nOQHsj8a+vF4WlzQqWIM= X-Received: by 2002:a05:6000:4112:b0:391:d52:d042 with SMTP id ffacd0b85a97d-39132d883f3mr2410120f8f.32.1741370680523; Fri, 07 Mar 2025 10:04:40 -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-43bdd8b0425sm58830765e9.3.2025.03.07.10.04.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 07 Mar 2025 10:04:39 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Alex Williamson , Igor Mammedov , qemu-ppc@nongnu.org, Thomas Huth , Richard Henderson , Tony Krowiak , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , kvm@vger.kernel.org, Yi Liu , Paolo Bonzini , Zhenzhong Duan , Matthew Rosato , Eric Farman , Peter Xu , Pierrick Bouvier , Daniel Henrique Barboza , Eric Auger , qemu-s390x@nongnu.org, Jason Herne , =?utf-8?q?C=C3=A9dric_Le_Goater?= , David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Harsh Prateek Bora , Nicholas Piggin , Halil Pasic , Christian Borntraeger Subject: [PATCH 11/14] hw/vfio/pci: Check CONFIG_IOMMUFD at runtime using iommufd_builtin() Date: Fri, 7 Mar 2025 19:03:34 +0100 Message-ID: <20250307180337.14811-12-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250307180337.14811-1-philmd@linaro.org> References: <20250307180337.14811-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Convert the compile time check on the CONFIG_IOMMUFD definition by a runtime one by calling iommufd_builtin(). Since the file doesn't use any target-specific knowledge anymore, move it to system_ss[] to build it once. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Richard Henderson --- hw/vfio/pci.c | 38 ++++++++++++++++++-------------------- hw/vfio/meson.build | 2 +- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 9872884ff8a..e83252766d1 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -19,7 +19,6 @@ */ #include "qemu/osdep.h" -#include CONFIG_DEVICES /* CONFIG_IOMMUFD */ #include #include @@ -2973,11 +2972,10 @@ static void vfio_realize(PCIDevice *pdev, Error **errp) if (!(~vdev->host.domain || ~vdev->host.bus || ~vdev->host.slot || ~vdev->host.function)) { error_setg(errp, "No provided host device"); - error_append_hint(errp, "Use -device vfio-pci,host=DDDD:BB:DD.F " -#ifdef CONFIG_IOMMUFD - "or -device vfio-pci,fd=DEVICE_FD " -#endif - "or -device vfio-pci,sysfsdev=PATH_TO_DEVICE\n"); + error_append_hint(errp, "Use -device vfio-pci,host=DDDD:BB:DD.F %s" + "or -device vfio-pci,sysfsdev=PATH_TO_DEVICE\n", + iommufd_builtin() + ? "or -device vfio-pci,fd=DEVICE_FD " : ""); return; } vbasedev->sysfsdev = @@ -3412,19 +3410,18 @@ static const Property vfio_pci_dev_properties[] = { qdev_prop_nv_gpudirect_clique, uint8_t), DEFINE_PROP_OFF_AUTO_PCIBAR("x-msix-relocation", VFIOPCIDevice, msix_relo, OFF_AUTO_PCIBAR_OFF), -#ifdef CONFIG_IOMMUFD - DEFINE_PROP_LINK("iommufd", VFIOPCIDevice, vbasedev.iommufd, - TYPE_IOMMUFD_BACKEND, IOMMUFDBackend *), -#endif DEFINE_PROP_BOOL("skip-vsc-check", VFIOPCIDevice, skip_vsc_check, true), }; -#ifdef CONFIG_IOMMUFD +static const Property vfio_pci_dev_iommufd_properties[] = { + DEFINE_PROP_LINK("iommufd", VFIOPCIDevice, vbasedev.iommufd, + TYPE_IOMMUFD_BACKEND, IOMMUFDBackend *), +}; + static void vfio_pci_set_fd(Object *obj, const char *str, Error **errp) { vfio_device_set_fd(&VFIO_PCI(obj)->vbasedev, str, errp); } -#endif static void vfio_pci_dev_class_init(ObjectClass *klass, void *data) { @@ -3433,9 +3430,10 @@ static void vfio_pci_dev_class_init(ObjectClass *klass, void *data) device_class_set_legacy_reset(dc, vfio_pci_reset); device_class_set_props(dc, vfio_pci_dev_properties); -#ifdef CONFIG_IOMMUFD - object_class_property_add_str(klass, "fd", NULL, vfio_pci_set_fd); -#endif + if (iommufd_builtin()) { + device_class_set_props(dc, vfio_pci_dev_iommufd_properties); + object_class_property_add_str(klass, "fd", NULL, vfio_pci_set_fd); + } dc->desc = "VFIO-based PCI device assignment"; set_bit(DEVICE_CATEGORY_MISC, dc->categories); pdc->realize = vfio_realize; @@ -3540,11 +3538,11 @@ static void vfio_pci_dev_class_init(ObjectClass *klass, void *data) "vf-token", "Specify UUID VF token. Required for VF when PF is owned " "by another VFIO driver"); -#ifdef CONFIG_IOMMUFD - object_class_property_set_description(klass, /* 9.0 */ - "iommufd", - "Set host IOMMUFD backend device"); -#endif + if (iommufd_builtin()) { + object_class_property_set_description(klass, /* 9.0 */ + "iommufd", + "Set host IOMMUFD backend device"); + } object_class_property_set_description(klass, /* 9.1 */ "x-device-dirty-page-tracking", "Disable device dirty page tracking and use " diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build index 96e342aa8cb..9a004992c11 100644 --- a/hw/vfio/meson.build +++ b/hw/vfio/meson.build @@ -6,7 +6,6 @@ vfio_ss.add(files( vfio_ss.add(when: 'CONFIG_PSERIES', if_true: files('spapr.c')) vfio_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files( 'pci-quirks.c', - 'pci.c', )) vfio_ss.add(when: 'CONFIG_VFIO_CCW', if_true: files('ccw.c')) vfio_ss.add(when: 'CONFIG_VFIO_PLATFORM', if_true: files('platform.c')) @@ -29,4 +28,5 @@ system_ss.add(when: ['CONFIG_VFIO', 'CONFIG_IOMMUFD'], if_true: files( )) system_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files( 'display.c', + 'pci.c', )) From patchwork Fri Mar 7 18:03:35 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 871224 Delivered-To: patch@linaro.org Received: by 2002:a5d:64c8:0:b0:38f:210b:807b with SMTP id f8csp895419wri; Fri, 7 Mar 2025 10:07:07 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXxLCwdHE3HLjbqkfTMKigDLvOkjGkU31AGoOWjD6T6EwjnEOwHypKqoVwRg8604OwQRwDAFA==@linaro.org X-Google-Smtp-Source: AGHT+IFiX7pkSbkzLvZH8wl6UjwlVOE6DpMD3J4+Obp4dJGiVfIVmpXKeWhnI34s+tDi/Yiv4NqJ X-Received: by 2002:a05:6102:a54:b0:4c1:b001:b53 with SMTP id ada2fe7eead31-4c30a65e00bmr2955887137.18.1741370827238; Fri, 07 Mar 2025 10:07:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1741370827; cv=none; d=google.com; s=arc-20240605; b=AXRJHinihfoc4GZm3kV4OeWjjeUElVofnnMsUl5lBJMKF9HnB5nSMUcaDMY8DL82Pd 2cNHlhfyrax3Rf3dcuJdC+4+AnTa6qpaHY1FvjqOPGnLmk6xO9hRpBUUK1Sqlp/UUPZ9 4w6+gsqtkJlzr5Z5D+F6ClQVvujuibSKTAm347eJG8waK00sthwJEs/ZtCwh3aZeUio+ epIHCe7O4a26KTt6YFZq3+tvIlvFYrEYk0Jlgjd19DgOQ5USdvDT+q1tXWmlxod6jMkD eJlvwLc2DfqJhcyvMlxMSx+v5WVDsDwv0xw7nGVDV4MuvcX22VBHe1y/Jf6d5/GRdbjg pONQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=g0+sj+5fZPDlRh8EKfyzOVB2Z+MoNxqNRQg5EoTr07c=; fh=ZyzqLhNGJAXkYZjVqygzIY1NON/Kumlz+Vm/jUj6bQE=; b=jY/vh6bONwbZiFOhn/P7jm5Se6T7z+L7XX0p36Tp1NUga+aSo9WnwhxyAiOerj7zl/ iX+A6Zhz+yDfLyFxsuu7z9fgaxWSojGssCQZWsgt3KcyTcEcWUKvskg5ww4k6rLVXZ8m nU4uk6TwiGYZAywgNSEJBgLX98Ly29/Q9j/0/IRtRYY1rho7veWDAVInSnkGCHoeXbGS vh+v60iPrCxxHJ0UQLZXjGA8Nr5jJLZJbvbEKtgJzpIksPBpVAjVr45GoNmx+Sv+QFbs CqTykcCPsJxwwek+jgvNtD5Hg7FtVYHYzQFBzdLPA2cBJM9si/3YEjPuZWYzdw2HPiQf D3dA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Llj4NGZ4; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ada2fe7eead31-4c2fb427803si1189155137.112.2025.03.07.10.07.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Mar 2025 10:07:07 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Llj4NGZ4; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tqc5l-0007Hg-So; Fri, 07 Mar 2025 13:06:38 -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 1tqc43-0004Sp-AM for qemu-devel@nongnu.org; Fri, 07 Mar 2025 13:04:51 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tqc40-0002JZ-7H for qemu-devel@nongnu.org; Fri, 07 Mar 2025 13:04:51 -0500 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-388cae9eb9fso1055505f8f.3 for ; Fri, 07 Mar 2025 10:04:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741370686; x=1741975486; 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=g0+sj+5fZPDlRh8EKfyzOVB2Z+MoNxqNRQg5EoTr07c=; b=Llj4NGZ4VxZ79idn6xySoUfWGFUAx777jbCT6IOHvS4DnubMwLbSD7DSzqtNbKyQbR YlHYxI5ejMMLW2rqkPQ+gfiLT8E5C2CWP7jBCBb/uWAEYVh3YA67jYN/BnM/TLnj6KRI x8hgXqt4p0cQnNOT6OcLtf3bHbm6x2dqocOHGqsciXlcWDjGE/DpuLYZ19KpTnkd16d0 qrZfyDx4PKKwzsP86zCSYYJjYIhwJTHYmI+R490cjzmG81jf2/rhmHpc3xuVDMXZZvZY VpWK0ugAqZpbeRUy31caz2QKmgnJSZaiwzpMxLOOVnton3lJthPAEpAck5ycn/8ufg2u h3Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741370686; x=1741975486; 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=g0+sj+5fZPDlRh8EKfyzOVB2Z+MoNxqNRQg5EoTr07c=; b=Lb/Wca4OKi7h4Y5+tw1hIsVQYAG+uPrZTaUM4Xx4U8ip1vFZuCrItvWAkrRI31RmEN OotW4usibuXgdrSjRuuUNpGh3YKSgODAAroIw77Kyz+ATnVyvd14zawDJl5Mwetg5zf1 7irgQM2wIGmQ2WccFXzPQOFw/PUehSe3Al0+3vPcrS/79Do35uJ5UefppHgpUBoCG/w3 gu+3N3HMXyi7P8Zt+fFEG6sdZIPZV2af10Bwec4Iwx36X4JFPfaFRXOeImJtHcwjSyu2 2n7uLEDQ0K8tMWXgiLiv91iyf2JpQzTUj0+pLlrRPvhU5/Ut0229daKATRVUHPAK7/W9 +cVw== X-Gm-Message-State: AOJu0YwuvsvG6XBtUsx/coE8pzEx51KeY4YiomTHeWGatHl9OGWW60k9 7MyZwMqmehnY25pUBiEhw81lmQmTYyivJkCCG5WECG131r0k3IvTYuVI6Vk6ZVWx8XvnbYz1hF1 yqEA= X-Gm-Gg: ASbGncv54w82dNwdpatgcnhzH+Emf+wg3EQEyK5cMcB2J6qWR7i0FrcBKMK3kW6pVg9 VkAMML3+1cyS49ClA/qIUK8vwlQA6lio+7KoAefluR/bZNWHeKkr6zBQZelcUP7aRZHDnWXGHL4 sZh/NkCQlnnpioh8JuIibHjd2c1HbIM17dZwXq/P/Cg6HuNPLJigVPPfIIgEOFPkftODQ7pSHj6 HrQoUKrfzHfLoMCGC33WCxyxTzuz1Iu2sHztXu8KZlXq5TqViWVlli72Fc/1VoprR0bnk9XfazZ NISGODsnvX5k5333O952yZ+kNLjqt5khEJY7XIEKnKGMH0ssDu65KvQdhCM17YOCOmNY1IOyLR4 en7GGLhRJiZyW+ZKr0ys= X-Received: by 2002:a05:6000:402b:b0:38d:e401:fd61 with SMTP id ffacd0b85a97d-39132db746amr2784656f8f.49.1741370686062; Fri, 07 Mar 2025 10:04:46 -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-43bdd8b046dsm58414135e9.5.2025.03.07.10.04.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 07 Mar 2025 10:04:45 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Alex Williamson , Igor Mammedov , qemu-ppc@nongnu.org, Thomas Huth , Richard Henderson , Tony Krowiak , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , kvm@vger.kernel.org, Yi Liu , Paolo Bonzini , Zhenzhong Duan , Matthew Rosato , Eric Farman , Peter Xu , Pierrick Bouvier , Daniel Henrique Barboza , Eric Auger , qemu-s390x@nongnu.org, Jason Herne , =?utf-8?q?C=C3=A9dric_Le_Goater?= , David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Harsh Prateek Bora , Nicholas Piggin , Halil Pasic , Christian Borntraeger Subject: [PATCH 12/14] hw/vfio/ap: Check CONFIG_IOMMUFD at runtime using iommufd_builtin() Date: Fri, 7 Mar 2025 19:03:35 +0100 Message-ID: <20250307180337.14811-13-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250307180337.14811-1-philmd@linaro.org> References: <20250307180337.14811-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Convert the compile time check on the CONFIG_IOMMUFD definition by a runtime one by calling iommufd_builtin(). Since the file doesn't use any target-specific knowledge anymore, move it to system_ss[] to build it once. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier --- target/s390x/kvm/kvm_s390x.h | 2 +- hw/vfio/ap.c | 27 +++++++++++++-------------- hw/vfio/meson.build | 2 +- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/target/s390x/kvm/kvm_s390x.h b/target/s390x/kvm/kvm_s390x.h index 649dae5948a..7b1cce3e60d 100644 --- a/target/s390x/kvm/kvm_s390x.h +++ b/target/s390x/kvm/kvm_s390x.h @@ -10,7 +10,7 @@ #ifndef KVM_S390X_H #define KVM_S390X_H -#include "cpu-qom.h" +#include "target/s390x/cpu-qom.h" struct kvm_s390_irq; diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c index c7ab4ff57ad..832b98532ea 100644 --- a/hw/vfio/ap.c +++ b/hw/vfio/ap.c @@ -11,7 +11,6 @@ */ #include "qemu/osdep.h" -#include CONFIG_DEVICES /* CONFIG_IOMMUFD */ #include #include #include "qapi/error.h" @@ -24,7 +23,7 @@ #include "qemu/module.h" #include "qemu/option.h" #include "qemu/config-file.h" -#include "kvm/kvm_s390x.h" +#include "target/s390x/kvm/kvm_s390x.h" #include "migration/vmstate.h" #include "hw/qdev-properties.h" #include "hw/s390x/ap-bridge.h" @@ -193,10 +192,11 @@ static void vfio_ap_unrealize(DeviceState *dev) static const Property vfio_ap_properties[] = { DEFINE_PROP_STRING("sysfsdev", VFIOAPDevice, vdev.sysfsdev), -#ifdef CONFIG_IOMMUFD +}; + +static const Property vfio_ap_iommufd_properties[] = { DEFINE_PROP_LINK("iommufd", VFIOAPDevice, vdev.iommufd, TYPE_IOMMUFD_BACKEND, IOMMUFDBackend *), -#endif }; static void vfio_ap_reset(DeviceState *dev) @@ -234,21 +234,20 @@ static void vfio_ap_instance_init(Object *obj) vbasedev->mdev = true; } -#ifdef CONFIG_IOMMUFD static void vfio_ap_set_fd(Object *obj, const char *str, Error **errp) { vfio_device_set_fd(&VFIO_AP_DEVICE(obj)->vdev, str, errp); } -#endif static void vfio_ap_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); device_class_set_props(dc, vfio_ap_properties); -#ifdef CONFIG_IOMMUFD - object_class_property_add_str(klass, "fd", NULL, vfio_ap_set_fd); -#endif + if (iommufd_builtin()) { + device_class_set_props(dc, vfio_ap_iommufd_properties); + object_class_property_add_str(klass, "fd", NULL, vfio_ap_set_fd); + } dc->vmsd = &vfio_ap_vmstate; dc->desc = "VFIO-based AP device assignment"; set_bit(DEVICE_CATEGORY_MISC, dc->categories); @@ -261,11 +260,11 @@ static void vfio_ap_class_init(ObjectClass *klass, void *data) object_class_property_set_description(klass, /* 3.1 */ "sysfsdev", "Host sysfs path of assigned device"); -#ifdef CONFIG_IOMMUFD - object_class_property_set_description(klass, /* 9.0 */ - "iommufd", - "Set host IOMMUFD backend device"); -#endif + if (iommufd_builtin()) { + object_class_property_set_description(klass, /* 9.0 */ + "iommufd", + "Set host IOMMUFD backend device"); + } } static const TypeInfo vfio_ap_info = { diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build index 9a004992c11..510ebe6d720 100644 --- a/hw/vfio/meson.build +++ b/hw/vfio/meson.build @@ -9,7 +9,6 @@ vfio_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files( )) vfio_ss.add(when: 'CONFIG_VFIO_CCW', if_true: files('ccw.c')) vfio_ss.add(when: 'CONFIG_VFIO_PLATFORM', if_true: files('platform.c')) -vfio_ss.add(when: 'CONFIG_VFIO_AP', if_true: files('ap.c')) specific_ss.add_all(when: 'CONFIG_VFIO', if_true: vfio_ss) @@ -26,6 +25,7 @@ system_ss.add(when: 'CONFIG_VFIO', if_true: files( system_ss.add(when: ['CONFIG_VFIO', 'CONFIG_IOMMUFD'], if_true: files( 'iommufd.c', )) +system_ss.add(when: 'CONFIG_VFIO_AP', if_true: files('ap.c')) system_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files( 'display.c', 'pci.c', From patchwork Fri Mar 7 18:03:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 871223 Delivered-To: patch@linaro.org Received: by 2002:a5d:64c8:0:b0:38f:210b:807b with SMTP id f8csp895222wri; Fri, 7 Mar 2025 10:06:46 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVemvNScfk6ZkZOA2gI1jpZXjpPVAtFoMA+DaAd+2tPGPT07q+HQzTucXBZ2H1Q1EG4i38KQw==@linaro.org X-Google-Smtp-Source: AGHT+IHwpcxLXD/F1QB2YoyXDu+WSUCO+M6gi7FP9fzw/6KHEyNoXH9aGKPWtomYf2mbqNJwuw4/ X-Received: by 2002:a05:6122:2005:b0:520:60c2:3f3 with SMTP id 71dfb90a1353d-523e403a626mr4029475e0c.4.1741370805928; Fri, 07 Mar 2025 10:06:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1741370805; cv=none; d=google.com; s=arc-20240605; b=IyNMSBGTUg9k0z7T9g+E6H7LuS7h5Dhv89qqRNDZlMf/ydBAFO7/WDxQIecOeyK/nk +XUiwHQrjgFccFbn5AWTGbZmqh87U63dHnRnisepk66G3XTOXstGdfpB3oXgx4VKsaqf Yp3nK6wfxB3hMKmMqw7yJ/YuIfTP2LdZezjVI3tojtl5W2gKEg3ygM0Z8g2Yps0HO0/I 1xtZAADP0Of5+F31f+VubZNokxH2xtNjaFy4p9Ltk6xHGg4NCzHF0yXF4ck67K8DC+yP d5mTPviBosQ5q9T/Mxov63+lixkQGf9eLM6pvDlAkJLhNgtaDHmF8SMcixrgQSIyXogv cKrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9PjjtPvH9M8tF9GLUHgsFKP3TRPxe4Etbg8NvJxAgPo=; fh=ZyzqLhNGJAXkYZjVqygzIY1NON/Kumlz+Vm/jUj6bQE=; b=BNCozq/CHEszlcq9Z44B3acdgrOJbKm+WSFIg+AVNzkZV5BMtZgoWLlEh4xhRxXhjH GAwIZ5xcWCCNb0regzP7ItYop2PUIPtJLQATlbLKuqsBOKydqReUyBM15uEKX1Kmm65f 4W9dsFU53/aKEb36J8/+lOgZHTapgqDQhahLrIKSisGrmeq7M08Rh9erulqHK1VSb9dU ddXkjiR1US0yzVos8yXTxDNMdo1WZv7wnpo4a9Fbyk16+vsLcTX/tVC1g4hmJTgJ1bhM B2B2xLtirbaANoPCVy2L67pMhZ/9j0BX9DfmKRQy3o7mP1QoVBNJLdA3EdCzLRTTmsXs ScjQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J8QyfalZ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 71dfb90a1353d-523f3978b5esi20179e0c.71.2025.03.07.10.06.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Mar 2025 10:06:45 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J8QyfalZ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tqc5o-0007WE-8S; Fri, 07 Mar 2025 13:06:40 -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 1tqc49-0004iH-Vs for qemu-devel@nongnu.org; Fri, 07 Mar 2025 13:04:58 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tqc46-0002KO-So for qemu-devel@nongnu.org; Fri, 07 Mar 2025 13:04:57 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4393dc02b78so13617285e9.3 for ; Fri, 07 Mar 2025 10:04:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741370692; x=1741975492; 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=9PjjtPvH9M8tF9GLUHgsFKP3TRPxe4Etbg8NvJxAgPo=; b=J8QyfalZzrLmWso8CvYXmUuTHHmG3WavuB8GVw2/mvgZfSqsk0ARrt/S79RFV6Tqm7 wgo2Pih6F0AE6Kf6rfyRowDHObU8jbXB+3fK9LMhgMCFVC+utwpILP6ktsf/m6/bOD3N JTyce3xIxoTsbds18IUHeiXB63OJ/GJx985lc3I093rqLi+nKWNFnW6GkcmddKVTTXHP hyPaEqNanJVbsrWDnnfqLFGT0T+xRwffp+xAhi0V87/jqG8aMoiH/q+jVu1fguuciniI JcmS0kiYTVb/nNzRWBK6f58rubAUQISCmJ0kmJH+W1SzSgjh4kAe8EduB6MpQbCGJEPV Qnow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741370692; x=1741975492; 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=9PjjtPvH9M8tF9GLUHgsFKP3TRPxe4Etbg8NvJxAgPo=; b=dRFEAzoSb5vVwKoL8N3MYJ+fm/kzvQ2p50GPa77Cg9+KQuMu1MKBEzec1Hxzs8UiCT T/m/OXZrslBsriJyyuZysquzRYOvd8CLvqQRDdJogDau7R6a64SFYtaMb+OFO6eSLa75 PVMqps3I0+60foZLsPBSoYRbNCQqpwjZ6Pz9/3hypG7i8lnI1uH3j0hGsY7+6hQMWuK8 n3QBTIWZ8vCMERHj94HQF8RRVaEAwTq85xp6nwvd1cAIuGJQS60SS7IuPGEwcXYIQ2NN voViQw5D6+69B/lAv0gxD0mGDLGRWfMXBe2CK7G18ae2Ystg2bHUYudXhGad3esJYA7m OxwA== X-Gm-Message-State: AOJu0YzJYXwTJD08z5teTm2Lqmpmk3EqygA1fmVorSh4X5C/zMWzeLNq tOwR6UiT9DbIl8fA/OM8CnVkps9QFxLRTuwxQyKLRSA8iFJ9dSmtuqhbw4SZF6DJJ92e5yfxzLH E+xk= X-Gm-Gg: ASbGncvHEo1fEN8Ql2ztob4OfT0zlq+WMMW2mm013wFub556jPc0erv492IKsSY2Tqa KQ2YfnNwNHtZ6xWnRxjXZwroNFGo+T+0gVpjs44Mb/fBIEbp7BzTQD5cWaNVARXMNT8lptTtCi7 Hf/u2KltPeSk4s4qQuqfDwhaz78+diyGg3OA58tQmyuqYcnbFfPmRFsioxA5m9jEDO4lN/eUbpn 7coueN6yS/1llHg3faV8zbZo9PTsvYKnwicDMrwEhJ/p82cmcckM5irdtvau7xom/ti3RDIogq4 /l/1ejU8LH6vcSDPHZqQFC+SdhVxt7sDooTjBtvbUDtJkM5KAIEFdilpUxTkuvYk5sy6SMoXffN icsYdmyInzq25okiCNrs= X-Received: by 2002:a05:600c:5108:b0:43b:c0fa:f9dd with SMTP id 5b1f17b1804b1-43c5c6a4137mr27636815e9.25.1741370692182; Fri, 07 Mar 2025 10:04:52 -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-43bd435c9c7sm86670675e9.38.2025.03.07.10.04.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 07 Mar 2025 10:04:50 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Alex Williamson , Igor Mammedov , qemu-ppc@nongnu.org, Thomas Huth , Richard Henderson , Tony Krowiak , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , kvm@vger.kernel.org, Yi Liu , Paolo Bonzini , Zhenzhong Duan , Matthew Rosato , Eric Farman , Peter Xu , Pierrick Bouvier , Daniel Henrique Barboza , Eric Auger , qemu-s390x@nongnu.org, Jason Herne , =?utf-8?q?C=C3=A9dric_Le_Goater?= , David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Harsh Prateek Bora , Nicholas Piggin , Halil Pasic , Christian Borntraeger Subject: [PATCH 13/14] hw/vfio/ccw: Check CONFIG_IOMMUFD at runtime using iommufd_builtin() Date: Fri, 7 Mar 2025 19:03:36 +0100 Message-ID: <20250307180337.14811-14-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250307180337.14811-1-philmd@linaro.org> References: <20250307180337.14811-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Convert the compile time check on the CONFIG_IOMMUFD definition by a runtime one by calling iommufd_builtin(). Since the file doesn't use any target-specific knowledge anymore, move it to system_ss[] to build it once. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier --- hw/vfio/ccw.c | 27 +++++++++++++-------------- hw/vfio/meson.build | 2 +- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c index e5e0d9e3e7e..84d1437a568 100644 --- a/hw/vfio/ccw.c +++ b/hw/vfio/ccw.c @@ -15,7 +15,6 @@ */ #include "qemu/osdep.h" -#include CONFIG_DEVICES /* CONFIG_IOMMUFD */ #include #include #include @@ -650,11 +649,12 @@ static void vfio_ccw_unrealize(DeviceState *dev) static const Property vfio_ccw_properties[] = { DEFINE_PROP_STRING("sysfsdev", VFIOCCWDevice, vdev.sysfsdev), DEFINE_PROP_BOOL("force-orb-pfch", VFIOCCWDevice, force_orb_pfch, false), -#ifdef CONFIG_IOMMUFD + DEFINE_PROP_CCW_LOADPARM("loadparm", CcwDevice, loadparm), +}; + +static const Property vfio_ccw_iommufd_properties[] = { DEFINE_PROP_LINK("iommufd", VFIOCCWDevice, vdev.iommufd, TYPE_IOMMUFD_BACKEND, IOMMUFDBackend *), -#endif - DEFINE_PROP_CCW_LOADPARM("loadparm", CcwDevice, loadparm), }; static const VMStateDescription vfio_ccw_vmstate = { @@ -682,12 +682,10 @@ static void vfio_ccw_instance_init(Object *obj) DEVICE(vcdev), true); } -#ifdef CONFIG_IOMMUFD static void vfio_ccw_set_fd(Object *obj, const char *str, Error **errp) { vfio_device_set_fd(&VFIO_CCW(obj)->vdev, str, errp); } -#endif static void vfio_ccw_class_init(ObjectClass *klass, void *data) { @@ -695,9 +693,10 @@ static void vfio_ccw_class_init(ObjectClass *klass, void *data) S390CCWDeviceClass *cdc = S390_CCW_DEVICE_CLASS(klass); device_class_set_props(dc, vfio_ccw_properties); -#ifdef CONFIG_IOMMUFD - object_class_property_add_str(klass, "fd", NULL, vfio_ccw_set_fd); -#endif + if (iommufd_builtin()) { + device_class_set_props(dc, vfio_ccw_iommufd_properties); + object_class_property_add_str(klass, "fd", NULL, vfio_ccw_set_fd); + } dc->vmsd = &vfio_ccw_vmstate; dc->desc = "VFIO-based subchannel assignment"; set_bit(DEVICE_CATEGORY_MISC, dc->categories); @@ -716,11 +715,11 @@ static void vfio_ccw_class_init(ObjectClass *klass, void *data) object_class_property_set_description(klass, /* 3.0 */ "force-orb-pfch", "Force unlimited prefetch"); -#ifdef CONFIG_IOMMUFD - object_class_property_set_description(klass, /* 9.0 */ - "iommufd", - "Set host IOMMUFD backend device"); -#endif + if (iommufd_builtin()) { + object_class_property_set_description(klass, /* 9.0 */ + "iommufd", + "Set host IOMMUFD backend device"); + } object_class_property_set_description(klass, /* 9.2 */ "loadparm", "Define which devices that can be used for booting"); diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build index 510ebe6d720..bd6e1d999e4 100644 --- a/hw/vfio/meson.build +++ b/hw/vfio/meson.build @@ -7,7 +7,6 @@ vfio_ss.add(when: 'CONFIG_PSERIES', if_true: files('spapr.c')) vfio_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files( 'pci-quirks.c', )) -vfio_ss.add(when: 'CONFIG_VFIO_CCW', if_true: files('ccw.c')) vfio_ss.add(when: 'CONFIG_VFIO_PLATFORM', if_true: files('platform.c')) specific_ss.add_all(when: 'CONFIG_VFIO', if_true: vfio_ss) @@ -26,6 +25,7 @@ system_ss.add(when: ['CONFIG_VFIO', 'CONFIG_IOMMUFD'], if_true: files( 'iommufd.c', )) system_ss.add(when: 'CONFIG_VFIO_AP', if_true: files('ap.c')) +system_ss.add(when: 'CONFIG_VFIO_CCW', if_true: files('ccw.c')) system_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files( 'display.c', 'pci.c', From patchwork Fri Mar 7 18:03:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 871227 Delivered-To: patch@linaro.org Received: by 2002:a5d:64c8:0:b0:38f:210b:807b with SMTP id f8csp895733wri; Fri, 7 Mar 2025 10:07:41 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWgwUEVXon7QXMMBWmqyzrQOk24OwHERDmGsHSwn8qeymmhKkMTeNzVIGaI9n88/hnLHA6ZgA==@linaro.org X-Google-Smtp-Source: AGHT+IFHLSc+83nStMUK0uMUW98+CQeE6ZaXNBHbA2+zFy2ATl0hyPQ2fczaetT8Mgyuusk2l7Zg X-Received: by 2002:ac8:7dca:0:b0:475:21e:dcfa with SMTP id d75a77b69052e-476109a379emr62749711cf.27.1741370861356; Fri, 07 Mar 2025 10:07:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1741370861; cv=none; d=google.com; s=arc-20240605; b=Wd6te7o9z8d5LcQHOP5/7SFRphR3oiASiDJflUmUG0MNhWuF3eXuOZjq1y1mAsxS+6 Fv+9RQ1DyELrAA5QGvu5CXLG9Xy3e+apdSRy2m9Lcrh101+J1xoqps091GETYNM/yq1a uQvCPjK/O1e+myHfhqHDFQxN0RrSR+znYIM8m+CLWDXh/8kzg/WDGQVdwLdNEAX9td32 xUIw2pBj7sGRigjCQmlukhrcxhfEVJGO+eaFJuwc9w/dLFel+KsBPe8ckJCAJOhg7V+o nuzBPn5OsShD6nt488Kc7E8Do1E0902RoB7rVJfGs27b5JbBT4psQj8/SBCQwd57VPvH SgOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=agcsT+LijTsdk7Aq19MciJhNx25N7TH6CXZbFxHQbqw=; fh=ZyzqLhNGJAXkYZjVqygzIY1NON/Kumlz+Vm/jUj6bQE=; b=kflu6GH1thpLzelLMJowHtIXcQI/zKkDmcr6jAsnQQ57xkfJQqOe8loC0r6lmZlZdH 8g1+AMGRCazweztiesXlnhie2GZFKv3yfk8nqZwQBF3Y0aj0nI4PNpowe7L9LjEaqBe1 kCvdpq1/C0vDygxCowqQ5jrJv+AnGXdLwOE+zf9lTStjd4gi7jXjhBdi5JgsP3ZdGbVA MoaDbYJGZuTE/fI7knGjiYcpxMZCTkhWnEePliQF8FT1yT1/VKWp1E7+lAwAf/4JmHOn X9jVA9NtX2cCDD3UyevDd41bNpDvmlWWe7SN8BP9QZfyBtymBV62j0LMyD0skbOi8Aze RpYA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="YFE/+6V1"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-4751daf92b2si37928771cf.231.2025.03.07.10.07.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Mar 2025 10:07:41 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="YFE/+6V1"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tqc5r-0007t0-Ps; Fri, 07 Mar 2025 13:06:43 -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 1tqc4E-0004p1-Dr for qemu-devel@nongnu.org; Fri, 07 Mar 2025 13:05:03 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tqc4B-0002L4-Gz for qemu-devel@nongnu.org; Fri, 07 Mar 2025 13:05:02 -0500 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-390eebcc331so1396744f8f.1 for ; Fri, 07 Mar 2025 10:04:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741370697; x=1741975497; 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=agcsT+LijTsdk7Aq19MciJhNx25N7TH6CXZbFxHQbqw=; b=YFE/+6V1ldaSLRuPkm2c8ZQBZwfWoeMAe+ziIljR3CxuU+4HzvXmZmu/s40yNEg8WF ZCtDCoTkOP0Kp2NoZHEA2t6JOC44RRaOAgKfdGR0LCN0tC+k0Gha0yamYwPGBl3j1Cr9 8desrD1zla6jADc82cPZ7KC5DhSis7tTFE0X3pSSEiyzh6bSC/LRZLnzBsx9R/MNhDmz /BeEHGnoOs76l8TjRR8pP7toPfI1Xvbfl88ZY/e+LyNLyXaLmIQewcj9Kc5/sLh0W04P Ih34e23CcsKn1LEY5gsMAfIRIgKMEkmWUmaPd+hDHZ+iswniEK4lA8GAnMZwivvdejDN dUrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741370697; x=1741975497; 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=agcsT+LijTsdk7Aq19MciJhNx25N7TH6CXZbFxHQbqw=; b=GWAC4IF1Vn7AH62vZq6+bw5S//Jiqg5KZVwtGxx8uktQ5nCKLa11kiCBpSzRn3hGzF kYcl7FL5vB9ZSUyVNmV8x/FmzqDAyQbGmwMFMhcmRwjAykWp8LcUuB1/ok3Q1yUYSfoT qUHfRTnIcjBz7v05LvtNponRQgoMyo10qGnDN/ZnG6gsAQYBWIhM+cA6ycIZABRitZly oYQ/0UzEb0vjrZjExpd7cCpX9VCTQSybnLoartUsX2h2vTDx7I9yJlnHD3lbPOpHuVSE mMYUA5io6e4FC2vN2aRtOJ6I+ijYoFEJ583YsgvJNd2Ufig7xSq9dWKO/db23BM/hGZE 7Pag== X-Gm-Message-State: AOJu0Yzg9WLR5sIsTa3Zaa7rULGmG/4+uJRBANgWvXJQxrg+ESf9IB41 FSesenHkRZ9Iw2GTIgGbkZKh7olrmBgtHeo4jXfIxhqoBg5hjieDarrxyTa/xfpwCM7zpxzWO6M HI3c= X-Gm-Gg: ASbGncvde0g3UvYOfPTf0vxr/w58FOZJweN/iLFETgEEg+NesyIYAg/NkJ3UXKf6BmF x1aGmPaPjMSZt9yOjF6VleW5eMjPqQizBhIpdNbg+F8oeqdna39wPMR5b2CeDAN29e+2cZR2WrT zEqtiHcrHdVW+2Ka/xDnN3VKXDiXFsaLP5RgT/NH6K4jgKT2ane+lo0uTs1NM+7oF04j2H2WzWH fgWI1+4fxZ+VL9ATRAcqMPyg9c2wpS/DpofvLsxJGoOO9w9l6VdjJnmNVFKVEnbaOFxkvlF2xac OXn/3s1dY89bc7Y2zb9cIaZLHNc+HSRgF/cuooGsiw05HJtnFwhcd1HuvNLeYQM9pnjSkzCyL0d EynJnypeZ+djZSvvoLkE= X-Received: by 2002:a05:6000:1f8f:b0:391:952:c74a with SMTP id ffacd0b85a97d-3913aeee2d7mr346949f8f.8.1741370697461; Fri, 07 Mar 2025 10:04:57 -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-43bd4352eb1sm86964935e9.31.2025.03.07.10.04.55 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 07 Mar 2025 10:04:57 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Alex Williamson , Igor Mammedov , qemu-ppc@nongnu.org, Thomas Huth , Richard Henderson , Tony Krowiak , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , kvm@vger.kernel.org, Yi Liu , Paolo Bonzini , Zhenzhong Duan , Matthew Rosato , Eric Farman , Peter Xu , Pierrick Bouvier , Daniel Henrique Barboza , Eric Auger , qemu-s390x@nongnu.org, Jason Herne , =?utf-8?q?C=C3=A9dric_Le_Goater?= , David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Harsh Prateek Bora , Nicholas Piggin , Halil Pasic , Christian Borntraeger Subject: [PATCH 14/14] hw/vfio/platform: Check CONFIG_IOMMUFD at runtime using iommufd_builtin Date: Fri, 7 Mar 2025 19:03:37 +0100 Message-ID: <20250307180337.14811-15-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250307180337.14811-1-philmd@linaro.org> References: <20250307180337.14811-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Convert the compile time check on the CONFIG_IOMMUFD definition by a runtime one by calling iommufd_builtin(). Since the file doesn't use any target-specific knowledge anymore, move it to system_ss[] to build it once. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Richard Henderson --- hw/vfio/platform.c | 25 ++++++++++++------------- hw/vfio/meson.build | 2 +- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c index 67bc57409c1..265c550b747 100644 --- a/hw/vfio/platform.c +++ b/hw/vfio/platform.c @@ -15,7 +15,6 @@ */ #include "qemu/osdep.h" -#include CONFIG_DEVICES /* CONFIG_IOMMUFD */ #include "qapi/error.h" #include #include @@ -637,10 +636,11 @@ static const Property vfio_platform_dev_properties[] = { DEFINE_PROP_UINT32("mmap-timeout-ms", VFIOPlatformDevice, mmap_timeout, 1100), DEFINE_PROP_BOOL("x-irqfd", VFIOPlatformDevice, irqfd_allowed, true), -#ifdef CONFIG_IOMMUFD +}; + +static const Property vfio_platform_dev_iommufd_properties[] = { DEFINE_PROP_LINK("iommufd", VFIOPlatformDevice, vbasedev.iommufd, TYPE_IOMMUFD_BACKEND, IOMMUFDBackend *), -#endif }; static void vfio_platform_instance_init(Object *obj) @@ -652,12 +652,10 @@ static void vfio_platform_instance_init(Object *obj) DEVICE(vdev), false); } -#ifdef CONFIG_IOMMUFD static void vfio_platform_set_fd(Object *obj, const char *str, Error **errp) { vfio_device_set_fd(&VFIO_PLATFORM_DEVICE(obj)->vbasedev, str, errp); } -#endif static void vfio_platform_class_init(ObjectClass *klass, void *data) { @@ -666,9 +664,10 @@ static void vfio_platform_class_init(ObjectClass *klass, void *data) dc->realize = vfio_platform_realize; device_class_set_props(dc, vfio_platform_dev_properties); -#ifdef CONFIG_IOMMUFD - object_class_property_add_str(klass, "fd", NULL, vfio_platform_set_fd); -#endif + if (iommufd_builtin()) { + device_class_set_props(dc, vfio_platform_dev_iommufd_properties); + object_class_property_add_str(klass, "fd", NULL, vfio_platform_set_fd); + } dc->vmsd = &vfio_platform_vmstate; dc->desc = "VFIO-based platform device assignment"; sbc->connect_irq_notifier = vfio_start_irqfd_injection; @@ -692,11 +691,11 @@ static void vfio_platform_class_init(ObjectClass *klass, void *data) object_class_property_set_description(klass, /* 2.6 */ "sysfsdev", "Host sysfs path of assigned device"); -#ifdef CONFIG_IOMMUFD - object_class_property_set_description(klass, /* 9.0 */ - "iommufd", - "Set host IOMMUFD backend device"); -#endif + if (iommufd_builtin()) { + object_class_property_set_description(klass, /* 9.0 */ + "iommufd", + "Set host IOMMUFD backend device"); + } } static const TypeInfo vfio_platform_dev_info = { diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build index bd6e1d999e4..e5010db2c71 100644 --- a/hw/vfio/meson.build +++ b/hw/vfio/meson.build @@ -7,7 +7,6 @@ vfio_ss.add(when: 'CONFIG_PSERIES', if_true: files('spapr.c')) vfio_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files( 'pci-quirks.c', )) -vfio_ss.add(when: 'CONFIG_VFIO_PLATFORM', if_true: files('platform.c')) specific_ss.add_all(when: 'CONFIG_VFIO', if_true: vfio_ss) @@ -26,6 +25,7 @@ system_ss.add(when: ['CONFIG_VFIO', 'CONFIG_IOMMUFD'], if_true: files( )) system_ss.add(when: 'CONFIG_VFIO_AP', if_true: files('ap.c')) system_ss.add(when: 'CONFIG_VFIO_CCW', if_true: files('ccw.c')) +system_ss.add(when: 'CONFIG_VFIO_PLATFORM', if_true: files('platform.c')) system_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files( 'display.c', 'pci.c',