From nobody Fri Mar 27 02:37:20 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1773558600; cv=none; d=zohomail.com; s=zohoarc; b=BHZ58gZrcREdYrZr2UjhHdXCr2yXUbCenW/VU8PefeU+9yemlh/VcASRmeI6mpCKPmTWcZcSr2+zc9adHjcDFpa5LC83JboHwDcZuNzPnnV6W2mXlGlRDxnR1Xsg5fA/q9JKAlM7VSTWQfiS4BtK2gsgUWVswaaZH4BW1NutQnc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773558600; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=UGp5LxAmYWTKuDMXym/h2A+YdJTwFfJW4kvCbf6qbNk=; b=LxuEhpRX8sjZsKYPQOkg761ty9VmuhRLrHD71+aAfVZ+Pu82Kaldk7GoaKO8NP4PuPDzq5bMRh7RMwvF3nPdL05Lyan3BHLyyyDGdtB+km6JeXEBHJmx8cJ/2zGJit4IhgWwSPEz0qSb4s/pd+uS2u5TeGE8/qF3DxtAV79h+P4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773558600593181.62453795676765; Sun, 15 Mar 2026 00:10:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w1fah-0001gm-Aw; Sun, 15 Mar 2026 03:08:47 -0400 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 1w1fag-0001fr-7X for qemu-devel@nongnu.org; Sun, 15 Mar 2026 03:08:46 -0400 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1w1fae-0000bb-Bc for qemu-devel@nongnu.org; Sun, 15 Mar 2026 03:08:45 -0400 Received: by mail-pj1-x102b.google.com with SMTP id 98e67ed59e1d1-35a08ce49dcso3328699a91.2 for ; Sun, 15 Mar 2026 00:08:43 -0700 (PDT) Received: from pc.taild8403c.ts.net (216-71-219-44.dyn.novuscom.net. [216.71.219.44]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-35a24acecadsm3468233a91.2.2026.03.15.00.08.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Mar 2026 00:08:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1773558523; x=1774163323; 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=UGp5LxAmYWTKuDMXym/h2A+YdJTwFfJW4kvCbf6qbNk=; b=F4GfW8ZbvSthL0RWRPj6rQzndR1Z+50+wIobHZhQYlfWYP1aKzKyMMIZr//9mn9kIo YGSw0Uukr+DAPDV6StivN2Wdv15j+fHczyPWtuNpINDtr3YzEVLPezE2BqNlbkUA499q LnVyjlQiRpqGrVIUVN9UQBx9qPFhnaSLJtJ0bAujmScv5TKiSfYnGaD5TZcoAQKvoKDB PfKgZVto3XZW010mWGWX2kmxGQDp/FIAnujztZwQCkkSvy+ksc6xcb0pPm9cyYB3hLnb z7R+SpTr8zEZGf/5GaI0P+rOZiDJjH72AfWZHmW4AJGoGR6tvFx3EYZGgHyc/Xst6eCI IApA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773558523; x=1774163323; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=UGp5LxAmYWTKuDMXym/h2A+YdJTwFfJW4kvCbf6qbNk=; b=guGpFXaukiohAIOvlbPfzi/+VaJjV1ryw6MbOFLCfylANMDuStYYMKO39aDZK3aIWz co/IyOXGd+/FcA8B5e42CwAikJ6ZjKlXYu8X8XFatzH2Wbgr9neMsxB/KfszkUKMBmt1 st3gjuBuoNB6efQUmc7cxwh2vxn4ULhCQ/Jr+eH3xV8dKiMMyUmd4q1JLkFD+Jl5WXe9 +R2h37CQF7T/oHfPAKvGkVCjUoSLHSNk5sshaMInwwr3UGTIotqAljZx8UbF4Wjge1sw 0wuX+SQWequ6tiROqAZhhnvZr7jessrDVOwSplaMsgQb02r1JhVhGojjqyia7QiIDnRh 7yjw== X-Gm-Message-State: AOJu0Yz7fDL6KiRHO61Tiqxabk7XsLHz8klG5jZjHpqCAz42g/2Ir44n /eZh9W02M5hXFX9c6szPGwPUUOzv9VQwJgjXM6ZqNVhICv5a6fjP4/kIFRDVb2IZPaIlpCsJXNX NQ/BbfEw= X-Gm-Gg: ATEYQzyMNZRA9pPRf6V8LhPGxKd8NB6ucS9DbhlEHj4uTden18fpZeMo+22p2m5Rcw1 vT/aUZfxIchv5RsQsfGo3yQkTX2GkXVXKzZV5iz7d24mO8ZGYz/97+Qd02Poq5lCrmFJ7gDxUpn g0m9Z5ew7mhFpFr4JY4cW4nlqXS0xtohLoHAyuyOqsq4O9me5dfY4Smuz8RfmYTcJINWHjblaEW 7z/YAK9Gm5wsxjj3SiaO+q803WaYkI64Fa2HJNtwNnSbNwiygepQjoGbukUcQUlDVLCY78yTDne l+pdCKFfo9X7QagCFgcyL9LTlYj4COz7VOxUYlJXYn0aan9fFCEbua2LhhsZU2nt5s7mKvFEcyf BQv8uhAAIGo4CkddFXE6HpCNPo+Z8MtNb2auzcth4x9krClCI66E/PBpcb9o6eRBymeb6AuVDnq 0m2qh73Kn40hV8UJkoKDoqUviMfe/lFj7BtuHXfWXOPKVkkyB2Xzn+g9ALu1ngxy2gItxOVqTLa ck= X-Received: by 2002:a17:90b:3501:b0:359:fa1e:2bc3 with SMTP id 98e67ed59e1d1-35a21ea5dbfmr8294012a91.6.1773558523006; Sun, 15 Mar 2026 00:08:43 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Richard Henderson , Paolo Bonzini , philmd@linaro.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-ppc@nongnu.org, eric.auger@redhat.com Subject: [PATCH v3 1/8] hw/vfio/listener.c: remove CONFIG_KVM Date: Sun, 15 Mar 2026 00:08:27 -0700 Message-ID: <20260315070834.198331-2-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260315070834.198331-1-pierrick.bouvier@linaro.org> References: <20260315070834.198331-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::102b; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pj1-x102b.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1773558608508158500 Code concerned is under a kvm_enabled() guard. Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Pierrick Bouvier Tested-by: Philippe Mathieu-Daud=C3=A9 --- hw/vfio/listener.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/hw/vfio/listener.c b/hw/vfio/listener.c index 960da9e0a93..31c3113f8fb 100644 --- a/hw/vfio/listener.c +++ b/hw/vfio/listener.c @@ -20,9 +20,7 @@ =20 #include "qemu/osdep.h" #include -#ifdef CONFIG_KVM #include -#endif #include =20 #include "exec/target_page.h" @@ -303,11 +301,9 @@ static bool vfio_ram_discard_register_listener(VFIOCon= tainer *bcontainer, if (bcontainer->dma_max_mappings) { unsigned int vrdl_count =3D 0, vrdl_mappings =3D 0, max_memslots = =3D 512; =20 -#ifdef CONFIG_KVM if (kvm_enabled()) { max_memslots =3D kvm_get_max_memslots(); } -#endif =20 QLIST_FOREACH(vrdl, &bcontainer->vrdl_list, next) { hwaddr start, end; --=20 2.47.3 From nobody Fri Mar 27 02:37:20 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1773558596; cv=none; d=zohomail.com; s=zohoarc; b=IKj+TaTGoClyaCT8u+0vQYQjH0Sg7An52V0d0xDz1IIXxS8BT+eDENAZgViKZd4Ih7pwB8B57wNr6YpctDHtg3Nj/UGbJE34nVvf/lhytRpDnXTjTK+WYHLsGbsMk14O/YDGnFZmN1YubvFCfUVDU5G1ze34kDgt+zmTacu5rDs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773558596; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Wg3l86J4Mr25+rkQyEjziZ0gWLQDxkgWnrfmi6Gz93U=; b=DqWzfs8ljbMuKtrjoowHy2oEp40mEg35Mn2ttfNZCzJ+l1ojo6qeR0rvv7xx/6Ngg0H2WR7roGTCMphEQZdW/EfpeteKaRc3ZrTVbHffbSXtrsLPpHg9xAk6lthH1WXE3fYlcfp7jMmXCOH9HLwehQWgaxkAF6HrlVtuV7r/9k0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773558596644227.97401789407843; Sun, 15 Mar 2026 00:09:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w1faj-0001iJ-MN; Sun, 15 Mar 2026 03:08:49 -0400 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 1w1fai-0001hO-7D for qemu-devel@nongnu.org; Sun, 15 Mar 2026 03:08:48 -0400 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1w1faf-0000bn-NX for qemu-devel@nongnu.org; Sun, 15 Mar 2026 03:08:47 -0400 Received: by mail-pj1-x1034.google.com with SMTP id 98e67ed59e1d1-35b88a4f123so424527a91.1 for ; Sun, 15 Mar 2026 00:08:45 -0700 (PDT) Received: from pc.taild8403c.ts.net (216-71-219-44.dyn.novuscom.net. [216.71.219.44]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-35a24acecadsm3468233a91.2.2026.03.15.00.08.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Mar 2026 00:08:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1773558524; x=1774163324; 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=Wg3l86J4Mr25+rkQyEjziZ0gWLQDxkgWnrfmi6Gz93U=; b=KrCiOPqcsadhOEFICjFfy6xpV1xQpVfPGztZzfA4fCx8l4Cf1FU/3ltzqJE86GmQfO cLAREoNgsjFFoamy27SnCyy81rvMtR3wdu2s7lZs2tIxd3gYEVIXLiaXi48TVqGzdaqq XrfUEvYtdQvqoPXCIRPX2JN61oDggkXfyAOiO+m8OpVxMPWcYwatvxLYbTEYwFdcBNrf luUA3AORlNZQNM+EQROUiM4Rm/6eJithudOudhbf7/sTWKRUHC2smH17FSEK4EGidfFd ai+MJL5DpFQc2xFcjKo7vrQzA5vACCIXWab9zbPoAaWEtjmLfGcSO7bOFf0/Thm51iK/ EGWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773558524; x=1774163324; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Wg3l86J4Mr25+rkQyEjziZ0gWLQDxkgWnrfmi6Gz93U=; b=NMFdMYbKt0uUtsk8W1iu9Djv7w0eTPAQIgsGCU7DkzBHXOzp8PXfhJCaOp8QlXnQNz oPJ882OEwQLtbcJjUEmPM+10af/7jq3X9li/3CDbsGMqGqtveQwiWuAap/kAp9ga3Vz8 KMaE43uxVEsYdpahph8N3koDHJHMcZLga0+belQEjX4NdxH562lhPcmbU1zv4lydkQhS J+EL5IY6R/G5F4sbt1hOs7WwqBitBV0NMJNkNiVdGUKmbWdYCuUls1WPGp03w5NGhKbP IsPeh1vusmu6nGcg2GNZ5gwgyb7D75EDre/woDgVRUzHRtmEx4Mz9imZnoKZKQAIOIDE 46cA== X-Gm-Message-State: AOJu0Yz4sdyvuihuFBAb+a58OIevG+INkVdIaIT3+OK15paZFvhKVmYt avIlJLU2xqgQ/Syhh4qlb7w7o600ZqGfFVEchZhvtIr7TOhDb7YD/imJd2bxdTv+V/TWMrrLHq0 58qdDdVU= X-Gm-Gg: ATEYQzzckMxsJ9Dz4zc0v4j1HYS4zSvuyCt7dZ9UODwT+LXSIifpmOS/9aAifaG5Xo9 x5uxaIDb3QbTU+6SRetkTFuogqRkuxhXPKX8QehCMBNMnVgD44sYwdqV9/XQVlLwvxbu5lz0Cw8 xZHhi2x/uMZcuaUE7OBn62ymUKiLM61y2lPv5cQ1jg0rSFjOJHWQjEwLUh0jTsT2mpbuMZV1eR6 5PfI3pbNPGgS7gKysdgCJCdvXrCTQS5nei/zXXpi9KSdzHB+dngrDM+uBIupxeSevWt++XXq7r4 brP4fbyrfCi0TCzJmwjxRSREX6pF8CSRlcMl/yS3FaZFpnNcIxQyIXrO4EF1UkQ0A0eCdwSLW9b yHhu/rVgMPgGZQ6ejnaz1o4Zz2/eIzTu9sjinv7MdLaDvIZZXLui3C7J8TlZQaIgIO7h+fjerJ4 H8yix39FCmJSvkldhwia+ql6R0A8pK0+xNy0GJPSTGLo9NCAD1eVpX9pNa57GBe0IZRdrmT3Bmt NUl0kLrw++reA== X-Received: by 2002:a17:90b:250f:b0:35b:952c:43ab with SMTP id 98e67ed59e1d1-35b952c44f0mr897405a91.4.1773558524074; Sun, 15 Mar 2026 00:08:44 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Richard Henderson , Paolo Bonzini , philmd@linaro.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-ppc@nongnu.org, eric.auger@redhat.com Subject: [PATCH v3 2/8] hw/vfio/helpers.c: extract kvm helpers in kvm-helpers.c Date: Sun, 15 Mar 2026 00:08:28 -0700 Message-ID: <20260315070834.198331-3-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260315070834.198331-1-pierrick.bouvier@linaro.org> References: <20260315070834.198331-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1034; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pj1-x1034.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1773558603638158500 Because those functions use kvm specific types, they need to be isolated in another source file. This allows us to link kvm-helpers only in configurations with CONFIG_KVM. Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Pierrick Bouvier Tested-by: Philippe Mathieu-Daud=C3=A9 --- hw/vfio/helpers.c | 172 ------------------------------------- hw/vfio/kvm-helpers.c | 192 ++++++++++++++++++++++++++++++++++++++++++ hw/vfio/kvm-stubs.c | 26 ++++++ hw/vfio/meson.build | 2 + 4 files changed, 220 insertions(+), 172 deletions(-) create mode 100644 hw/vfio/kvm-helpers.c create mode 100644 hw/vfio/kvm-stubs.c diff --git a/hw/vfio/helpers.c b/hw/vfio/helpers.c index 00d42d3b98e..65c6dba0428 100644 --- a/hw/vfio/helpers.c +++ b/hw/vfio/helpers.c @@ -22,7 +22,6 @@ #include "qemu/osdep.h" #include =20 -#include "system/kvm.h" #include "exec/cpu-common.h" #include "hw/vfio/vfio-device.h" #include "hw/core/hw-error.h" @@ -107,177 +106,6 @@ bool vfio_get_info_dma_avail(struct vfio_iommu_type1_= info *info, return true; } =20 -#ifdef CONFIG_KVM -/* - * We have a single VFIO pseudo device per KVM VM. Once created it lives - * for the life of the VM. Closing the file descriptor only drops our - * reference to it and the device's reference to kvm. Therefore once - * initialized, this file descriptor is only released on QEMU exit and - * we'll re-use it should another vfio device be attached before then. - */ -int vfio_kvm_device_fd =3D -1; - -/* - * Confidential virtual machines: - * During reset of confidential vms, the kvm vm file descriptor changes. - * In this case, the old vfio kvm file descriptor is - * closed and a new descriptor is created against the new kvm vm file - * descriptor. - */ - -typedef struct VFIODeviceFd { - int fd; - QLIST_ENTRY(VFIODeviceFd) node; -} VFIODeviceFd; - -static QLIST_HEAD(, VFIODeviceFd) vfio_device_fds =3D - QLIST_HEAD_INITIALIZER(vfio_device_fds); - -static void vfio_device_fd_list_add(int fd) -{ - VFIODeviceFd *file_fd; - file_fd =3D g_malloc0(sizeof(*file_fd)); - file_fd->fd =3D fd; - QLIST_INSERT_HEAD(&vfio_device_fds, file_fd, node); -} - -static void vfio_device_fd_list_remove(int fd) -{ - VFIODeviceFd *file_fd, *next; - - QLIST_FOREACH_SAFE(file_fd, &vfio_device_fds, node, next) { - if (file_fd->fd =3D=3D fd) { - QLIST_REMOVE(file_fd, node); - g_free(file_fd); - break; - } - } -} - -static int vfio_device_fd_rebind(NotifierWithReturn *notifier, void *data, - Error **errp) -{ - VFIODeviceFd *file_fd; - struct kvm_device_attr attr =3D { - .group =3D KVM_DEV_VFIO_FILE, - .attr =3D KVM_DEV_VFIO_FILE_ADD, - }; - struct kvm_create_device cd =3D { - .type =3D KVM_DEV_TYPE_VFIO, - }; - - /* we are not interested in pre vmfd change notification */ - if (((VmfdChangeNotifier *)data)->pre) { - return 0; - } - - if (kvm_vm_ioctl(kvm_state, KVM_CREATE_DEVICE, &cd)) { - error_setg_errno(errp, errno, "Failed to create KVM VFIO device"); - return -errno; - } - - if (vfio_kvm_device_fd !=3D -1) { - close(vfio_kvm_device_fd); - } - - vfio_kvm_device_fd =3D cd.fd; - - QLIST_FOREACH(file_fd, &vfio_device_fds, node) { - attr.addr =3D (uint64_t)(unsigned long)&file_fd->fd; - if (ioctl(vfio_kvm_device_fd, KVM_SET_DEVICE_ATTR, &attr)) { - error_setg_errno(errp, errno, - "Failed to add fd %d to KVM VFIO device", - file_fd->fd); - return -errno; - } - } - return 0; -} - -static struct NotifierWithReturn vfio_vmfd_change_notifier =3D { - .notify =3D vfio_device_fd_rebind, -}; - -#endif - -void vfio_kvm_device_close(void) -{ -#ifdef CONFIG_KVM - kvm_close(); - if (vfio_kvm_device_fd !=3D -1) { - close(vfio_kvm_device_fd); - vfio_kvm_device_fd =3D -1; - } -#endif -} - -int vfio_kvm_device_add_fd(int fd, Error **errp) -{ -#ifdef CONFIG_KVM - struct kvm_device_attr attr =3D { - .group =3D KVM_DEV_VFIO_FILE, - .attr =3D KVM_DEV_VFIO_FILE_ADD, - .addr =3D (uint64_t)(unsigned long)&fd, - }; - - if (!kvm_enabled()) { - return 0; - } - - if (vfio_kvm_device_fd < 0) { - struct kvm_create_device cd =3D { - .type =3D KVM_DEV_TYPE_VFIO, - }; - - if (kvm_vm_ioctl(kvm_state, KVM_CREATE_DEVICE, &cd)) { - error_setg_errno(errp, errno, "Failed to create KVM VFIO devic= e"); - return -errno; - } - - vfio_kvm_device_fd =3D cd.fd; - /* - * If the vm file descriptor changes, add a notifier so that we can - * re-create the vfio_kvm_device_fd. - */ - kvm_vmfd_add_change_notifier(&vfio_vmfd_change_notifier); - } - - if (ioctl(vfio_kvm_device_fd, KVM_SET_DEVICE_ATTR, &attr)) { - error_setg_errno(errp, errno, "Failed to add fd %d to KVM VFIO dev= ice", - fd); - return -errno; - } - - vfio_device_fd_list_add(fd); -#endif - return 0; -} - -int vfio_kvm_device_del_fd(int fd, Error **errp) -{ -#ifdef CONFIG_KVM - struct kvm_device_attr attr =3D { - .group =3D KVM_DEV_VFIO_FILE, - .attr =3D KVM_DEV_VFIO_FILE_DEL, - .addr =3D (uint64_t)(unsigned long)&fd, - }; - - if (vfio_kvm_device_fd < 0) { - error_setg(errp, "KVM VFIO device isn't created yet"); - return -EINVAL; - } - - if (ioctl(vfio_kvm_device_fd, KVM_SET_DEVICE_ATTR, &attr)) { - error_setg_errno(errp, errno, - "Failed to remove fd %d from KVM VFIO device", fd= ); - return -errno; - } - - vfio_device_fd_list_remove(fd); -#endif - return 0; -} - struct vfio_device_info *vfio_get_device_info(int fd) { struct vfio_device_info *info; diff --git a/hw/vfio/kvm-helpers.c b/hw/vfio/kvm-helpers.c new file mode 100644 index 00000000000..d71c9590aaa --- /dev/null +++ b/hw/vfio/kvm-helpers.c @@ -0,0 +1,192 @@ +/* + * low level and IOMMU backend agnostic helpers used by VFIO devices, + * related to regions, interrupts, capabilities + * + * Copyright Red Hat, Inc. 2012 + * + * Authors: + * Alex Williamson + * + * SPDX-License-Identifier: GPL-2.0-or-later + * + * Based on qemu-kvm device-assignment: + * Adapted for KVM by Qumranet. + * Copyright (c) 2007, Neocleus, Alex Novik (alex@neocleus.com) + * Copyright (c) 2007, Neocleus, Guy Zana (guy@neocleus.com) + * Copyright (C) 2008, Qumranet, Amit Shah (amit.shah@qumranet.com) + * Copyright (C) 2008, Red Hat, Amit Shah (amit.shah@redhat.com) + * Copyright (C) 2008, IBM, Muli Ben-Yehuda (muli@il.ibm.com) + */ + +#include "qemu/osdep.h" +#include + +#include +#include "system/kvm.h" +#include "exec/cpu-common.h" +#include "hw/vfio/vfio-device.h" +#include "hw/core/hw-error.h" +#include "qapi/error.h" +#include "vfio-helpers.h" + +/* + * We have a single VFIO pseudo device per KVM VM. Once created it lives + * for the life of the VM. Closing the file descriptor only drops our + * reference to it and the device's reference to kvm. Therefore once + * initialized, this file descriptor is only released on QEMU exit and + * we'll re-use it should another vfio device be attached before then. + */ +int vfio_kvm_device_fd =3D -1; + +/* + * Confidential virtual machines: + * During reset of confidential vms, the kvm vm file descriptor changes. + * In this case, the old vfio kvm file descriptor is + * closed and a new descriptor is created against the new kvm vm file + * descriptor. + */ + +typedef struct VFIODeviceFd { + int fd; + QLIST_ENTRY(VFIODeviceFd) node; +} VFIODeviceFd; + +static QLIST_HEAD(, VFIODeviceFd) vfio_device_fds =3D + QLIST_HEAD_INITIALIZER(vfio_device_fds); + +static void vfio_device_fd_list_add(int fd) +{ + VFIODeviceFd *file_fd; + file_fd =3D g_malloc0(sizeof(*file_fd)); + file_fd->fd =3D fd; + QLIST_INSERT_HEAD(&vfio_device_fds, file_fd, node); +} + +static void vfio_device_fd_list_remove(int fd) +{ + VFIODeviceFd *file_fd, *next; + + QLIST_FOREACH_SAFE(file_fd, &vfio_device_fds, node, next) { + if (file_fd->fd =3D=3D fd) { + QLIST_REMOVE(file_fd, node); + g_free(file_fd); + break; + } + } +} + +static int vfio_device_fd_rebind(NotifierWithReturn *notifier, void *data, + Error **errp) +{ + VFIODeviceFd *file_fd; + struct kvm_device_attr attr =3D { + .group =3D KVM_DEV_VFIO_FILE, + .attr =3D KVM_DEV_VFIO_FILE_ADD, + }; + struct kvm_create_device cd =3D { + .type =3D KVM_DEV_TYPE_VFIO, + }; + + /* we are not interested in pre vmfd change notification */ + if (((VmfdChangeNotifier *)data)->pre) { + return 0; + } + + if (kvm_vm_ioctl(kvm_state, KVM_CREATE_DEVICE, &cd)) { + error_setg_errno(errp, errno, "Failed to create KVM VFIO device"); + return -errno; + } + + if (vfio_kvm_device_fd !=3D -1) { + close(vfio_kvm_device_fd); + } + + vfio_kvm_device_fd =3D cd.fd; + + QLIST_FOREACH(file_fd, &vfio_device_fds, node) { + attr.addr =3D (uint64_t)(unsigned long)&file_fd->fd; + if (ioctl(vfio_kvm_device_fd, KVM_SET_DEVICE_ATTR, &attr)) { + error_setg_errno(errp, errno, + "Failed to add fd %d to KVM VFIO device", + file_fd->fd); + return -errno; + } + } + return 0; +} + +static struct NotifierWithReturn vfio_vmfd_change_notifier =3D { + .notify =3D vfio_device_fd_rebind, +}; + +void vfio_kvm_device_close(void) +{ + kvm_close(); + if (vfio_kvm_device_fd !=3D -1) { + close(vfio_kvm_device_fd); + vfio_kvm_device_fd =3D -1; + } +} + +int vfio_kvm_device_add_fd(int fd, Error **errp) +{ + struct kvm_device_attr attr =3D { + .group =3D KVM_DEV_VFIO_FILE, + .attr =3D KVM_DEV_VFIO_FILE_ADD, + .addr =3D (uint64_t)(unsigned long)&fd, + }; + + if (!kvm_enabled()) { + return 0; + } + + if (vfio_kvm_device_fd < 0) { + struct kvm_create_device cd =3D { + .type =3D KVM_DEV_TYPE_VFIO, + }; + + if (kvm_vm_ioctl(kvm_state, KVM_CREATE_DEVICE, &cd)) { + error_setg_errno(errp, errno, "Failed to create KVM VFIO devic= e"); + return -errno; + } + + vfio_kvm_device_fd =3D cd.fd; + /* + * If the vm file descriptor changes, add a notifier so that we can + * re-create the vfio_kvm_device_fd. + */ + kvm_vmfd_add_change_notifier(&vfio_vmfd_change_notifier); + } + + if (ioctl(vfio_kvm_device_fd, KVM_SET_DEVICE_ATTR, &attr)) { + error_setg_errno(errp, errno, "Failed to add fd %d to KVM VFIO dev= ice", + fd); + return -errno; + } + + vfio_device_fd_list_add(fd); + return 0; +} + +int vfio_kvm_device_del_fd(int fd, Error **errp) +{ + struct kvm_device_attr attr =3D { + .group =3D KVM_DEV_VFIO_FILE, + .attr =3D KVM_DEV_VFIO_FILE_DEL, + .addr =3D (uint64_t)(unsigned long)&fd, + }; + + if (vfio_kvm_device_fd < 0) { + error_setg(errp, "KVM VFIO device isn't created yet"); + return -EINVAL; + } + + if (ioctl(vfio_kvm_device_fd, KVM_SET_DEVICE_ATTR, &attr)) { + error_setg_errno(errp, errno, + "Failed to remove fd %d from KVM VFIO device", fd= ); + return -errno; + } + + vfio_device_fd_list_remove(fd); + return 0; +} diff --git a/hw/vfio/kvm-stubs.c b/hw/vfio/kvm-stubs.c new file mode 100644 index 00000000000..5a489d1b711 --- /dev/null +++ b/hw/vfio/kvm-stubs.c @@ -0,0 +1,26 @@ +/* + * Stubs for kvm helpers + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" + +#include "hw/vfio/vfio-device.h" +#include "qapi/error.h" +#include "vfio-helpers.h" + +void vfio_kvm_device_close(void) +{ + return; +} + +int vfio_kvm_device_add_fd(int fd, Error **errp) +{ + return 0; +} + +int vfio_kvm_device_del_fd(int fd, Error **errp) +{ + return 0; +} diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build index 82f68698fb8..f2a7728d3d0 100644 --- a/hw/vfio/meson.build +++ b/hw/vfio/meson.build @@ -7,6 +7,8 @@ vfio_ss.add(files( 'container-legacy.c', 'helpers.c', )) +vfio_ss.add(when: 'CONFIG_KVM', if_true: files('kvm-helpers.c')) +stub_ss.add(files('kvm-stubs.c')) vfio_ss.add(when: 'CONFIG_PSERIES', if_true: files('spapr.c')) vfio_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files( 'pci-quirks.c', --=20 2.47.3 From nobody Fri Mar 27 02:37:20 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1773558561; cv=none; d=zohomail.com; s=zohoarc; b=NsZ6AAyiy1o8bXD8F0IxL07wYgJdIGl1uXYBB4CPb06D+xNr0crCzQhYEmXvSVylBT7YHLZLPiEPfTCcUiYjd9cq8+2s80Zh4Ix6YrMaIIDxTWMWtMZGwA/wTQHLUMy2fGVWo4SlDbeQiMjKf0dD5D4jUztgpxrGtrC89xMtEQ8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773558561; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=k06r4+VvkL2G3ql4sYSuFl4jS3d8PMWI1522EBSoENc=; b=bTHPHcFLLABtoKG6yv7dffNkRYwlj8aBDH/DmkzSQMTNPl9QTby6V8LeoBXkaghrUl3t+bFopA9AqHaZe30yCGog8F3Xf+g+VFetZLanVylP5axRXgrfBy2Y64w3pb+NqNq/AsjlL2Gm7nr+dmUS66re7sBaLhQDs1QW+HTQe6s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773558558774593.7096520099366; Sun, 15 Mar 2026 00:09:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w1fak-0001jE-UH; Sun, 15 Mar 2026 03:08:50 -0400 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 1w1fai-0001hY-Nt for qemu-devel@nongnu.org; Sun, 15 Mar 2026 03:08:48 -0400 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1w1fah-0000cD-10 for qemu-devel@nongnu.org; Sun, 15 Mar 2026 03:08:48 -0400 Received: by mail-pj1-x102a.google.com with SMTP id 98e67ed59e1d1-35a1cc6e478so1719931a91.0 for ; Sun, 15 Mar 2026 00:08:46 -0700 (PDT) Received: from pc.taild8403c.ts.net (216-71-219-44.dyn.novuscom.net. [216.71.219.44]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-35a24acecadsm3468233a91.2.2026.03.15.00.08.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Mar 2026 00:08:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1773558525; x=1774163325; 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=k06r4+VvkL2G3ql4sYSuFl4jS3d8PMWI1522EBSoENc=; b=TrIGkMTzKeIjxvmxB1Ixt7UawiCgTX+k6PiZmnGVus2WakHzMfjTVHQTLq3AO+47Qz 22Lopaq3mMcoTU+PdXOjjqqWJKCHM+z8BqrAgCMyLyb9QK5/f5ZdqdlPvpYE4YpAsnlH Mu8eYMBzzlxkpr4Wmm3UQgtoHYUWej7tmSthP/6sSiDPeI6zav/MqktgJZlzzEqjre2J YO4TiC/4ZZ9iEdtV20CyhwIJx6HOtcqVENTgauycVoJX9b0sAKhBImlp0sZXtIqpgnOc MkCzwMD1IBp2ihz+FWPVohpJNIlxmOVHa2wWljNChTHWHa4YIqU7SfDzyAjw7j9HB2Jw oEYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773558525; x=1774163325; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=k06r4+VvkL2G3ql4sYSuFl4jS3d8PMWI1522EBSoENc=; b=py5FEUawWZgGl7RIUz8UUSviqCcPNm9xvwnuGH62RNhQGCo6r8FQvfcbv/eEURwLge gIMzXWvxMv6wC5qR0UC7a5jIAIHVsznAKSgGx/rs1Nle7o8YkCJp4wuKHiwXzU9dbKHK rIGE+1SFdS2+cS7LpcnDVcsyJueYydriGfX/ZcDumRAHBT8ak0HcHel1zpiHfmV5jKR8 5SBVKzrZDJPTZ0oKfttIGSn406rOXBM/czFdO1IpWOHF/0eWmDkXEPZRXkHBh87Lw42Y MmVvx/7da0M7QdN0Ef8Ub0LPWrUvv5qPMgNp6bo+9NPvPYy5xD8KO3JEaFAZJGtiUGQl 1Hig== X-Gm-Message-State: AOJu0YyIx9naenMVbsSHKlXMueJfUV9DEGxq9yaI53vVlU+/FABvWGpS VSfIPVXIOzdYrzTanCy1DXzrjiBkn6gGVKVghRT01toKg4qM1w6c493Ht8JkNSq1AyMZfjWwhNP BZA9JL8o= X-Gm-Gg: ATEYQzxrqTmcpA4DSmrGgIopZsxD35uuQY8IMXZIqAv+FH5NWTC91ipOZTtLYv2F/Zd C9a+YsWNg0bNamoUH/WNMv6nbX7uzAZhOFrYQpL0ZKHjK7+SViCfLdm2a3+PXNTTvNa2EPCj+96 93yJFvzild96pqlkYv5sPpI746/+VnavJOk+qluLEz+KgisZMibDqjLBizxYeGwC1/pE6W9URgm sjaiKmw1w0wDsActqmAbGD37GYUzw738n8PZzbYDbm3VW6GLN+u7Pf02KmEiIDBow813BZAS6kg +ztJLw8xsfOAXOjzENu5QXol3aAwJKNxBd/2rumm//KwZBvgstpCQIB80hwu9AuTYTZk6a5iXJb QLCfglQFPtslSX31TchX4qrZhYf1Guh9etF6StGu8kwD0zhZsyiy3ASxhp/fMKbXg+9Qi+Dp9TL TNl85///xOy00NuVHfqXSvDI46lp/Zo4M6rEitVcQ3zA6mWloMf2qfBp2hp18d0FF+e5FFNuQaH 3o= X-Received: by 2002:a17:90b:38c1:b0:359:fecd:1cb6 with SMTP id 98e67ed59e1d1-35a21cb4b21mr7987793a91.0.1773558525286; Sun, 15 Mar 2026 00:08:45 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Richard Henderson , Paolo Bonzini , philmd@linaro.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-ppc@nongnu.org, eric.auger@redhat.com Subject: [PATCH v3 3/8] hw/vfio/pci-quirks.c: remove CONFIG_VFIO_IGD Date: Sun, 15 Mar 2026 00:08:29 -0700 Message-ID: <20260315070834.198331-4-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260315070834.198331-1-pierrick.bouvier@linaro.org> References: <20260315070834.198331-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::102a; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pj1-x102a.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1773558572009158500 Add stubs for needed functions. As well, we need to add pixman to qemuutil library dependencies since pixman is transitively included from pci.h header, which is needed to be able to include prototypes for stubs we declared. In file included from include/ui/console.h:4, from ../hw/vfio/vfio-display.h:12, from ../hw/vfio/pci.h:25, from ../hw/vfio/igd-stubs.c:9: include/ui/qemu-pixman.h:10:10: fatal error: pixman.h: No such file or dire= ctory 10 | #include | ^~~~~~~~~~ On OpenBSD, opengl headers are not available in default include path, and thus we need to add opengl to list of qemuutil dependencies. In file included from /home/root/qemu/include/ui/console.h:9: /home/root/qemu/include/ui/surface.h:11:11: fatal error: 'epoxy/gl.h' file = not found Finally, vfio_pci_hot_reset_info must be forwarded declared on non linux platforms: In file included from ../hw/vfio/igd-stubs.c:9: ../hw/vfio/pci.h:265:44: error: 'struct vfio_pci_hot_reset_info' declared i= nside parameter list will not be visible outside of this definition or decl= aration [-Werror] 265 | struct vfio_pci_hot_reset_info = **info_p); | Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Pierrick Bouvier Signed-off-by: Pierrick Bouvier Tested-by: Philippe Mathieu-Daud=C3=A9 --- meson.build | 2 +- hw/vfio/pci.h | 2 ++ hw/vfio/igd-stubs.c | 20 ++++++++++++++++++++ hw/vfio/pci-quirks.c | 5 ----- hw/vfio/meson.build | 1 + 5 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 hw/vfio/igd-stubs.c diff --git a/meson.build b/meson.build index 11139f540b0..5abfc8ef190 100644 --- a/meson.build +++ b/meson.build @@ -3794,7 +3794,7 @@ util_ss =3D util_ss.apply({}) libqemuutil =3D static_library('qemuutil', build_by_default: false, sources: util_ss.sources() + stub_ss.sources(= ) + genh, - dependencies: [util_ss.dependencies(), libm, = threads, glib, socket, malloc, rt]) + dependencies: [util_ss.dependencies(), libm, = threads, glib, socket, malloc, rt, pixman, opengl]) qemuutil =3D declare_dependency(link_with: libqemuutil, sources: genh + version_res, dependencies: [event_loop_base]) diff --git a/hw/vfio/pci.h b/hw/vfio/pci.h index d6495d7f297..c3a1f53d350 100644 --- a/hw/vfio/pci.h +++ b/hw/vfio/pci.h @@ -258,6 +258,8 @@ bool vfio_probe_igd_config_quirk(VFIOPCIDevice *vdev, E= rror **errp); =20 extern const PropertyInfo qdev_prop_nv_gpudirect_clique; =20 +struct vfio_pci_hot_reset_info; + void vfio_pci_pre_reset(VFIOPCIDevice *vdev); void vfio_pci_post_reset(VFIOPCIDevice *vdev); bool vfio_pci_host_match(PCIHostDeviceAddress *addr, const char *name); diff --git a/hw/vfio/igd-stubs.c b/hw/vfio/igd-stubs.c new file mode 100644 index 00000000000..f7687d90912 --- /dev/null +++ b/hw/vfio/igd-stubs.c @@ -0,0 +1,20 @@ +/* + * IGD device quirks stubs + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "qapi/qmp/qerror.h" +#include "pci.h" +#include "pci-quirks.h" + +void vfio_probe_igd_bar0_quirk(VFIOPCIDevice *vdev, int nr) +{ + return; +} + +bool vfio_probe_igd_config_quirk(VFIOPCIDevice *vdev, Error **errp) +{ + return true; +} diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c index 7b907b9360d..ab864048943 100644 --- a/hw/vfio/pci-quirks.c +++ b/hw/vfio/pci-quirks.c @@ -11,7 +11,6 @@ */ =20 #include "qemu/osdep.h" -#include CONFIG_DEVICES #include "exec/memop.h" #include "qemu/units.h" #include "qemu/log.h" @@ -1128,11 +1127,9 @@ static void vfio_probe_rtl8168_bar2_quirk(VFIOPCIDev= ice *vdev, int nr) */ bool vfio_config_quirk_setup(VFIOPCIDevice *vdev, Error **errp) { -#ifdef CONFIG_VFIO_IGD if (!vfio_probe_igd_config_quirk(vdev, errp)) { return false; } -#endif return true; } =20 @@ -1179,9 +1176,7 @@ void vfio_bar_quirk_setup(VFIOPCIDevice *vdev, int nr) vfio_probe_nvidia_bar5_quirk(vdev, nr); vfio_probe_nvidia_bar0_quirk(vdev, nr); vfio_probe_rtl8168_bar2_quirk(vdev, nr); -#ifdef CONFIG_VFIO_IGD vfio_probe_igd_bar0_quirk(vdev, nr); -#endif } =20 void vfio_bar_quirk_exit(VFIOPCIDevice *vdev, int nr) diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build index f2a7728d3d0..6c00a7f51bb 100644 --- a/hw/vfio/meson.build +++ b/hw/vfio/meson.build @@ -17,6 +17,7 @@ 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_AP', if_true: files('ap.c')) vfio_ss.add(when: 'CONFIG_VFIO_IGD', if_true: files('igd.c')) +stub_ss.add(files('igd-stubs.c')) =20 specific_ss.add_all(when: 'CONFIG_VFIO', if_true: vfio_ss) =20 --=20 2.47.3 From nobody Fri Mar 27 02:37:20 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1773558577; cv=none; d=zohomail.com; s=zohoarc; b=l5leX8ad311GjNFFIKVlWZm1dkKenM6reXkk7Wrz3TKEendoHniQtBAcWjN6QelZVC2OUTZPZh1L240rzE2Yw42jz69wcuvAXARJjoEBoLrRfiTNSwHLAUpNr65UflGXMJSnwrzr+mruoUyteNYfP8NOOO/ONZvfmtJ7Zbi2D+E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773558577; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=N4ZUK5OdFX1Uj62uUQzKpHzS+GcZQqU09JoP5tVMW5I=; b=GwZkDBiSFiGjbcAWVaA05QT1RIdk8JKS73vZbcoCuOLJrhwUKy/XpcKnWBv8Zzi2duKdAxzokw8ucuxGbfCFze8u1rUJytmwSMm2IAF5oM/8FHsgD6Kg6i+hZKtPw8uYEShTYwt6pZ6wc3wWzKiKON/BHlLmbox1G3zrkCCUHcc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773558577660260.91722909895384; Sun, 15 Mar 2026 00:09:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w1fal-0001jl-Co; Sun, 15 Mar 2026 03:08:51 -0400 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 1w1faj-0001iC-FN for qemu-devel@nongnu.org; Sun, 15 Mar 2026 03:08:49 -0400 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1w1fah-0000cU-LB for qemu-devel@nongnu.org; Sun, 15 Mar 2026 03:08:49 -0400 Received: by mail-pj1-x102b.google.com with SMTP id 98e67ed59e1d1-35a02f3b8feso1397203a91.3 for ; Sun, 15 Mar 2026 00:08:47 -0700 (PDT) Received: from pc.taild8403c.ts.net (216-71-219-44.dyn.novuscom.net. [216.71.219.44]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-35a24acecadsm3468233a91.2.2026.03.15.00.08.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Mar 2026 00:08:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1773558526; x=1774163326; 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=N4ZUK5OdFX1Uj62uUQzKpHzS+GcZQqU09JoP5tVMW5I=; b=qxb4xyqYFbBcNi/ZeMF+fYgYHOjayO5E8uv6bPsR/1jRQggIiGKO6xQ2WU2pL3S7ub i4BqltrEr8MX3H6u3t/Xj8+ki1NmyOXadcgk+R9lF4iZByTmFRNW6LOsrkHpPxy8pOfD CjY26o/1xT5fYL8XV6cG0t7qjuQeOKKcPd0MKQXXWvQbRobe8jfHpBVNfQNywT/kyWAs uRU4jYAlq9+FWc0fMZ1K3Gm43PzfM+EjJVxeSAZh+ZosZEgnyFpWmmh3ahFobof7Gb4e fqxGu8FPx50QJ0InBwsY6rFZR80lGWFmHly23OpkVaG89naOOjWg/FJkhATGRevPyYOp QEUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773558526; x=1774163326; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=N4ZUK5OdFX1Uj62uUQzKpHzS+GcZQqU09JoP5tVMW5I=; b=cH5nbwQpafjSvzECeNglM3ybzmkp0sJXlR1MD5BlicU/NQj9C+om2WjqLhc5Ba80lW 26SdmhMCR611jJ2Y+60/N+9jmaznLStEhuwBVTMGFz/CgOzD+IW/DcXxCFe29Mr4grgz fpGsy5Cbz1p0cG9GtDjRqLLjNIiHGomK7cGl/jl+HEAo9kxQi7tqv/KLNj3gWTENYYd/ NuksGoKlHHYc3V1Y7mCFmoXwwKlBMntraMPUxSnd6T817IwcoqdzOHJ19TcBEEY6xRVj zrjH8QKudu1PWFPnCz4E9wSfUKhb+vBPN3Ai8zyZrTGItWlBjhKPEOqNTDc5br0TqsDD Ac6Q== X-Gm-Message-State: AOJu0YxrdVon8tkfTMAmtAOxMlg0CyTxqzMx+GzYkeLMNfjhl5rczyjd ++VPD7PATxwujiW86Ryv2kMsvJqw1c3wSk6smI7zKuTC76kNkHrlXWZRUT+1WK/gZsJ8QvLqpEA tTuOa2Uc= X-Gm-Gg: ATEYQzy0aa1dOZO4nLG1f8Icj1i2iiBeI+KLlJefPWF14f1dYGGAohVlDmnrlx15ula MzMnEWp0ZUzS8j4BXPxOADzCjRMumGYVzvyUJMBI4d8q54tequhDcLJC5R0aporI5GvBMDvy8Zz ldvHcJMN8MzBKoo1bpjCyBqCewiH395UOlFX/zsQnwFvE74XLAgnRLHOmr8sHXLNvms11Rbn3sB 28WA6idpeHUkqQEmTu9S3OER7YSOHY6I5kVoQLN1wF6vOmLaphFBn/ki7viHALFZUuY2ktZuoTy yNdnmH+4pVNmjOXtXg/ZUkGm1ZAgZ4UQNr4PHEPSQr68AyOTDBded5x4I2+H52OlQNl7MW129FG YsJ5aIfeXrCgdS7lYTM6x99Mzaslva2kDhLqKK2alvVWcSNsT3F9LWaarSjt3qcKvLla0dkD4NX vjvzjCKRqcw7wHdmxfizTzpot/FnKA+6jW6q0EFc7GukxS63AkFTaPy5bpdm9i55jmsVifm7fBa lVn4qGDuMukgA== X-Received: by 2002:a17:90b:5103:b0:359:8988:38bc with SMTP id 98e67ed59e1d1-35a21e1b7c1mr7893181a91.7.1773558526004; Sun, 15 Mar 2026 00:08:46 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Richard Henderson , Paolo Bonzini , philmd@linaro.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-ppc@nongnu.org, eric.auger@redhat.com Subject: [PATCH v3 4/8] hw/vfio: eradicate CONFIG_IOMMU from sources Date: Sun, 15 Mar 2026 00:08:30 -0700 Message-ID: <20260315070834.198331-5-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260315070834.198331-1-pierrick.bouvier@linaro.org> References: <20260315070834.198331-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::102b; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pj1-x102b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1773558582223154100 Content-Type: text/plain; charset="utf-8" As pointed in c1139fa4 "vfio/iommufd: Remove CONFIG_IOMMUFD usage", iommufd presence can be detected at runtime (through /dev/iommufd) and we don't need to isolate this at build time. It's much (much) more simple to expose this inconditionally compared to build dynamically properties arrays. Signed-off-by: Pierrick Bouvier Tested-by: Philippe Mathieu-Daud=C3=A9 --- hw/vfio/ap.c | 9 --------- hw/vfio/ccw.c | 9 --------- hw/vfio/pci.c | 11 ----------- 3 files changed, 29 deletions(-) diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c index e58a0169af9..856fa2678cd 100644 --- a/hw/vfio/ap.c +++ b/hw/vfio/ap.c @@ -11,7 +11,6 @@ */ =20 #include "qemu/osdep.h" -#include CONFIG_DEVICES /* CONFIG_IOMMUFD */ #include #include #include "qapi/error.h" @@ -279,10 +278,8 @@ static void vfio_ap_unrealize(DeviceState *dev) =20 static const Property vfio_ap_properties[] =3D { DEFINE_PROP_STRING("sysfsdev", VFIOAPDevice, vdev.sysfsdev), -#ifdef CONFIG_IOMMUFD DEFINE_PROP_LINK("iommufd", VFIOAPDevice, vdev.iommufd, TYPE_IOMMUFD_BACKEND, IOMMUFDBackend *), -#endif }; =20 static void vfio_ap_reset(DeviceState *dev) @@ -320,21 +317,17 @@ static void vfio_ap_instance_init(Object *obj) vbasedev->mdev =3D true; } =20 -#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 =20 static void vfio_ap_class_init(ObjectClass *klass, const void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); =20 device_class_set_props(dc, vfio_ap_properties); -#ifdef CONFIG_IOMMUFD object_class_property_add_str(klass, "fd", NULL, vfio_ap_set_fd); -#endif dc->vmsd =3D &vfio_ap_vmstate; dc->desc =3D "VFIO-based AP device assignment"; set_bit(DEVICE_CATEGORY_MISC, dc->categories); @@ -347,11 +340,9 @@ static void vfio_ap_class_init(ObjectClass *klass, con= st void *data) object_class_property_set_description(klass, /* 3.1 */ "sysfsdev", "Host sysfs path of assigned dev= ice"); -#ifdef CONFIG_IOMMUFD object_class_property_set_description(klass, /* 9.0 */ "iommufd", "Set host IOMMUFD backend device= "); -#endif } =20 static const TypeInfo vfio_ap_info =3D { diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c index 2251facb356..c66f42a13c2 100644 --- a/hw/vfio/ccw.c +++ b/hw/vfio/ccw.c @@ -15,7 +15,6 @@ */ =20 #include "qemu/osdep.h" -#include CONFIG_DEVICES /* CONFIG_IOMMUFD */ #include #include #include @@ -647,10 +646,8 @@ static void vfio_ccw_unrealize(DeviceState *dev) static const Property vfio_ccw_properties[] =3D { DEFINE_PROP_STRING("sysfsdev", VFIOCCWDevice, vdev.sysfsdev), DEFINE_PROP_BOOL("force-orb-pfch", VFIOCCWDevice, force_orb_pfch, fals= e), -#ifdef CONFIG_IOMMUFD DEFINE_PROP_LINK("iommufd", VFIOCCWDevice, vdev.iommufd, TYPE_IOMMUFD_BACKEND, IOMMUFDBackend *), -#endif DEFINE_PROP_CCW_LOADPARM("loadparm", CcwDevice, loadparm), }; =20 @@ -679,12 +676,10 @@ static void vfio_ccw_instance_init(Object *obj) DEVICE(vcdev), true); } =20 -#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 =20 static void vfio_ccw_class_init(ObjectClass *klass, const void *data) { @@ -692,9 +687,7 @@ static void vfio_ccw_class_init(ObjectClass *klass, con= st void *data) S390CCWDeviceClass *cdc =3D S390_CCW_DEVICE_CLASS(klass); =20 device_class_set_props(dc, vfio_ccw_properties); -#ifdef CONFIG_IOMMUFD object_class_property_add_str(klass, "fd", NULL, vfio_ccw_set_fd); -#endif dc->vmsd =3D &vfio_ccw_vmstate; dc->desc =3D "VFIO-based subchannel assignment"; set_bit(DEVICE_CATEGORY_MISC, dc->categories); @@ -713,11 +706,9 @@ static void vfio_ccw_class_init(ObjectClass *klass, co= nst 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 object_class_property_set_description(klass, /* 9.2 */ "loadparm", "Define which devices that can b= e used for booting"); diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 94c174a773f..df617f1fe46 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -19,7 +19,6 @@ */ =20 #include "qemu/osdep.h" -#include CONFIG_DEVICES /* CONFIG_IOMMUFD */ #include #include =20 @@ -3471,9 +3470,7 @@ static void vfio_pci_realize(PCIDevice *pdev, Error *= *errp) ~vdev->host.slot || ~vdev->host.function)) { error_setg(errp, "No provided host device"); error_append_hint(errp, "Use -device vfio-pci,host=3DDDDD:BB:D= D.F " -#ifdef CONFIG_IOMMUFD "or -device vfio-pci,fd=3DDEVICE_FD " -#endif "or -device vfio-pci,sysfsdev=3DPATH_TO_DEVI= CE\n"); return; } @@ -3816,22 +3813,18 @@ static const Property vfio_pci_properties[] =3D { qdev_prop_nv_gpudirect_clique, uint8_t), DEFINE_PROP_OFF_AUTO_PCIBAR("x-msix-relocation", VFIOPCIDevice, msix_r= elo, 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= ), DEFINE_PROP_UINT16("x-vpasid-cap-offset", VFIOPCIDevice, vpasid_cap_offset, 0), }; =20 -#ifdef CONFIG_IOMMUFD static void vfio_pci_set_fd(Object *obj, const char *str, Error **errp) { VFIOPCIDevice *vdev =3D VFIO_PCI_DEVICE(obj); vfio_device_set_fd(&vdev->vbasedev, str, errp); } -#endif =20 static void vfio_pci_class_init(ObjectClass *klass, const void *data) { @@ -3840,9 +3833,7 @@ static void vfio_pci_class_init(ObjectClass *klass, c= onst void *data) =20 device_class_set_legacy_reset(dc, vfio_pci_reset); device_class_set_props(dc, vfio_pci_properties); -#ifdef CONFIG_IOMMUFD object_class_property_add_str(klass, "fd", NULL, vfio_pci_set_fd); -#endif dc->vmsd =3D &vfio_cpr_pci_vmstate; dc->desc =3D "VFIO-based PCI device assignment"; pdc->realize =3D vfio_pci_realize; @@ -3944,11 +3935,9 @@ static void vfio_pci_class_init(ObjectClass *klass, = const 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 object_class_property_set_description(klass, /* 9.1 */ "x-device-dirty-page-tracking", "Disable device dirty page track= ing and use " --=20 2.47.3 From nobody Fri Mar 27 02:37:20 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1773558640; cv=none; d=zohomail.com; s=zohoarc; b=STPAeha2CsHnqPxO7vwaFprC5yLvMWZshWpjiZh9LrzpKheETLaLrNq+IicFxBsgKeiY2/IreK0wptxVnAkXRWp3qe8SJVIuYxYXhaFRJbSDPC8BBpwS72q5Z+FX/iPwPko2rQFRabsUB6z69rT51/SIfMPGQizqHQhDaqbsCoE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773558640; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=WdPki2OUDvv7GbdAB4TVVTocQqYHi/i0OX7XXacQtPQ=; b=Y5RXsBYgeWpb3G42nqUinNd5ULeDhdhdv39NM+tBsNK70F1BRVDuVzE++qg4UvABRJWr1nxA6gwOJlzc6qR0TwLAhTFujPIRrgx/JFMdI+5FxGICNvmYvDU6O/Uoijua3QST2KQpMDutyuPj1iCw8T+MPJ+Ss1zhrnjJdX5ltXE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773558640461220.75425793020668; Sun, 15 Mar 2026 00:10:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w1fao-0001kn-2m; Sun, 15 Mar 2026 03:08:54 -0400 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 1w1fal-0001jN-29 for qemu-devel@nongnu.org; Sun, 15 Mar 2026 03:08:51 -0400 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1w1faj-0000d1-CX for qemu-devel@nongnu.org; Sun, 15 Mar 2026 03:08:50 -0400 Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-359f35dfef6so1879021a91.2 for ; Sun, 15 Mar 2026 00:08:48 -0700 (PDT) Received: from pc.taild8403c.ts.net (216-71-219-44.dyn.novuscom.net. [216.71.219.44]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-35a24acecadsm3468233a91.2.2026.03.15.00.08.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Mar 2026 00:08:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1773558528; x=1774163328; 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=WdPki2OUDvv7GbdAB4TVVTocQqYHi/i0OX7XXacQtPQ=; b=pjIyScWprMV9V3SyefwdoZk1u+dMQPMD+LW6o6U9tBLBPcNmKtRTx1Re/2KEiPQB6k RqTftvhhc0yVxOyD9Pk1EeQoKUP62Eau2rFk3n3DnXYDCsktGlBiKNLmU2G5+jFVjZtN S3jLP/aULnLdmVM8GwMoSXZXbCv/2FYoEfL8R6M6oHEDrpAifr1CuVGv+6QU/TjenJlY 8sCbuOvZJ2a4ZGD+vQog9Db3G+2Iu3MiCMB7dgk1Pczif/OwVwCn8qccgCJsh3ElJqIh e4bFJmLHLSbfXbdY1sCe5Zss9Vhbun+KMSoKSHxXPHe4A0DVHD+wUZF4YKVbwzrQ7w7e NY5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773558528; x=1774163328; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=WdPki2OUDvv7GbdAB4TVVTocQqYHi/i0OX7XXacQtPQ=; b=Vrb8bLGFHPQTpUCcp+c5EqeaGR7btYd0gbWhizEGACh9YEv5ooRBp9QOOBSw/hSQFm 6lWGlUrOp7Vi7BitbWQ0gXCNMmqZhGwAtXyfw+ZD4iUG1cav2XeD+7mWaOSPc0epbQ+L 3C5oJ/mNsiRSzw/R2KCNiPHCvuqtlxJ32KEjAgYgID2TYNJW486578fWUVoFjdT9sgM4 6VFXx8a9wJ+XpxpO6k2WFq3f34BEOLuMwT8/GS/uor0OEhQ6ZIYBanYl3wK8qMExU+Um OkZsstggUWhcC0Hpx3nzNbNNUhPq/jAboawJsZjLTieC3+kAR3+E63VpXEnz2C+4jmoZ 1tiw== X-Gm-Message-State: AOJu0YxyLoJzL6alro1iNxoKbYUjljPUGGWOQNkKKhhCKxvobFKCyksE EtvO9YpuMvzo4gGfqzcGAi5XVu2Z5AdL2MZclBK094RSpT5EjJCjob2RaA1pAke9g02buPQgDjT 5XSxLB4c= X-Gm-Gg: ATEYQzzdFduSqwehAoOIcrzUaasR+9PNad4WD/yxjXtgq85RR1memkEhiMjADWiJkai 3bl1NV0erNm58SdtlhD3TTkLNlb+TuQbZP5mBTzSJzkl4inO/UoLL4FAvvPGg6wQtUyQXdNAsWJ ZhKukTcrOjpYK7ZHVPXci2yQ4J2V+QLwV6dnsOtlOWmSRBuvo8g4x1GFeMpszv/BjLGhTnViIUq W6fa2I24O7rkC8FepMDHE1LaCIx9+tXdPGzEsAkzxV4ywalXbXIcsVq7Wsahtzt4jLUjI0793WL IDOhYhZ0XiRyBtAWPXnjM+Y/ONjku0u6/eUvDs9hxVX4FU4FlGv7rrYqgqAeYCef8cZr3GP08hF upJjo9+lGK4Ymi9NkDsFMccfePmnzuUskKgX14BH2Zzoi/IvzcFn0z0OWBghIKVoqylZDlm07rz k/+QdYxtgUHDvF6uS01I1CMC5pFqSestyyGgUZLoxOeVuHscs9biLcAX1PHY6VPkyB3cNbXrO75 64= X-Received: by 2002:a17:90a:e7d1:b0:359:fecd:1cd3 with SMTP id 98e67ed59e1d1-35a2205551fmr7546004a91.23.1773558527895; Sun, 15 Mar 2026 00:08:47 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Richard Henderson , Paolo Bonzini , philmd@linaro.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-ppc@nongnu.org, eric.auger@redhat.com Subject: [PATCH v3 5/8] hw/vfio/pci.c: eradicate CONFIG_KVM Date: Sun, 15 Mar 2026 00:08:31 -0700 Message-ID: <20260315070834.198331-6-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260315070834.198331-1-pierrick.bouvier@linaro.org> References: <20260315070834.198331-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pj1-x1032.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1773558645193158500 We just need to add kvm_enabled() guard when calling concerned functions, but no need to extract those kvm functions since they are not using any kvm specific types that would not be visible at compilation time. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Pierrick Bouvier Tested-by: Philippe Mathieu-Daud=C3=A9 --- hw/vfio/pci.c | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index df617f1fe46..811e5001de5 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -152,7 +152,6 @@ void vfio_pci_intx_eoi(VFIODevice *vbasedev) =20 static bool vfio_intx_enable_kvm(VFIOPCIDevice *vdev, Error **errp) { -#ifdef CONFIG_KVM PCIDevice *pdev =3D PCI_DEVICE(vdev); int irq_fd =3D event_notifier_get_fd(&vdev->intx.interrupt); =20 @@ -206,14 +205,10 @@ fail: qemu_set_fd_handler(irq_fd, vfio_intx_interrupt, NULL, vdev); vfio_device_irq_unmask(&vdev->vbasedev, VFIO_PCI_INTX_IRQ_INDEX); return false; -#else - return true; -#endif } =20 static bool vfio_cpr_intx_enable_kvm(VFIOPCIDevice *vdev, Error **errp) { -#ifdef CONFIG_KVM if (vdev->no_kvm_intx || !kvm_irqfds_enabled() || vdev->intx.route.mode !=3D PCI_INTX_ENABLED || !kvm_resamplefds_enabled()) { @@ -236,14 +231,10 @@ static bool vfio_cpr_intx_enable_kvm(VFIOPCIDevice *v= dev, Error **errp) vdev->intx.kvm_accel =3D true; trace_vfio_intx_enable_kvm(vdev->vbasedev.name); return true; -#else - return true; -#endif } =20 static void vfio_intx_disable_kvm(VFIOPCIDevice *vdev) { -#ifdef CONFIG_KVM PCIDevice *pdev =3D PCI_DEVICE(vdev); =20 if (!vdev->intx.kvm_accel) { @@ -277,7 +268,6 @@ static void vfio_intx_disable_kvm(VFIOPCIDevice *vdev) vfio_device_irq_unmask(&vdev->vbasedev, VFIO_PCI_INTX_IRQ_INDEX); =20 trace_vfio_intx_disable_kvm(vdev->vbasedev.name); -#endif } =20 static void vfio_intx_update(VFIOPCIDevice *vdev, PCIINTxRoute *route) @@ -287,7 +277,9 @@ static void vfio_intx_update(VFIOPCIDevice *vdev, PCIIN= TxRoute *route) trace_vfio_intx_update(vdev->vbasedev.name, vdev->intx.route.irq, route->irq); =20 - vfio_intx_disable_kvm(vdev); + if (kvm_enabled()) { + vfio_intx_disable_kvm(vdev); + } =20 vdev->intx.route =3D *route; =20 @@ -295,7 +287,7 @@ static void vfio_intx_update(VFIOPCIDevice *vdev, PCIIN= TxRoute *route) return; } =20 - if (!vfio_intx_enable_kvm(vdev, &err)) { + if (kvm_enabled() && !vfio_intx_enable_kvm(vdev, &err)) { warn_reportf_err(err, VFIO_MSG_PREFIX, vdev->vbasedev.name); } =20 @@ -350,16 +342,14 @@ static bool vfio_intx_enable(VFIOPCIDevice *vdev, Err= or **errp) vdev->intx.pin =3D pin - 1; /* Pin A (1) -> irq[0] */ pci_config_set_interrupt_pin(pdev->config, pin); =20 -#ifdef CONFIG_KVM /* * Only conditional to avoid generating error messages on platforms * where we won't actually use the result anyway. */ - if (kvm_irqfds_enabled() && kvm_resamplefds_enabled()) { + if (kvm_enabled() && kvm_irqfds_enabled() && kvm_resamplefds_enabled()= ) { vdev->intx.route =3D pci_device_route_intx_to_irq(pdev, vdev->intx.pin); } -#endif =20 if (!vfio_notifier_init(vdev, &vdev->intx.interrupt, "intx-interrupt",= 0, errp)) { @@ -370,7 +360,7 @@ static bool vfio_intx_enable(VFIOPCIDevice *vdev, Error= **errp) =20 =20 if (cpr_is_incoming()) { - if (!vfio_cpr_intx_enable_kvm(vdev, &err)) { + if (kvm_enabled() && !vfio_cpr_intx_enable_kvm(vdev, &err)) { warn_reportf_err(err, VFIO_MSG_PREFIX, vdev->vbasedev.name); } goto skip_signaling; @@ -383,7 +373,7 @@ static bool vfio_intx_enable(VFIOPCIDevice *vdev, Error= **errp) return false; } =20 - if (!vfio_intx_enable_kvm(vdev, &err)) { + if (kvm_enabled() && !vfio_intx_enable_kvm(vdev, &err)) { warn_reportf_err(err, VFIO_MSG_PREFIX, vdev->vbasedev.name); } =20 @@ -400,7 +390,9 @@ static void vfio_intx_disable(VFIOPCIDevice *vdev) int fd; =20 timer_del(vdev->intx.mmap_timer); - vfio_intx_disable_kvm(vdev); + if (kvm_enabled()) { + vfio_intx_disable_kvm(vdev); + } vfio_device_irq_disable(&vdev->vbasedev, VFIO_PCI_INTX_IRQ_INDEX); vdev->intx.pending =3D false; pci_irq_deassert(pdev); --=20 2.47.3 From nobody Fri Mar 27 02:37:20 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1773558629; cv=none; d=zohomail.com; s=zohoarc; b=NTZC+Zx5FiqStgiWvhtjGpY2OGuwPIrsPo3D4FveBY+PJpx80PUas3OcFTsc2XVw/OjBb/4zThVX/R9vgRA+3C2q7kJnM0sWxgZ3KuaoraUdKTfIxBohMP3ZrkrBNAiXIVQ8qwF1wHznHhiuJQiCY0YN0EHObg6/ocARzpN10pU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773558629; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=D7SBLNkZfE70Q4c4n8fHx6puQVux00Zu8cChd4QK9u4=; b=cN7POik5UG/4o8AQupi9xd2zMDbY9DOK2zm1/5EReE5nJOYPd8KxMedV0tjbk/2ib8wH4MbiKe9p/vrUmtswbumyc8aW/QegvVF8fkpvUPsaSd/2lClyfQdfNIbvSm97kkpypi0lvTj5HU0cFiVWTg/lmcguRSO9UHSwGfLGza8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 177355862971078.39431425697842; Sun, 15 Mar 2026 00:10:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w1fao-0001ko-3N; Sun, 15 Mar 2026 03:08:54 -0400 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 1w1fam-0001k4-Gc for qemu-devel@nongnu.org; Sun, 15 Mar 2026 03:08:52 -0400 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1w1fal-0000dW-4p for qemu-devel@nongnu.org; Sun, 15 Mar 2026 03:08:52 -0400 Received: by mail-pj1-x1034.google.com with SMTP id 98e67ed59e1d1-35a211df8e3so1579562a91.2 for ; Sun, 15 Mar 2026 00:08:50 -0700 (PDT) Received: from pc.taild8403c.ts.net (216-71-219-44.dyn.novuscom.net. [216.71.219.44]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-35a24acecadsm3468233a91.2.2026.03.15.00.08.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Mar 2026 00:08:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1773558530; x=1774163330; 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=D7SBLNkZfE70Q4c4n8fHx6puQVux00Zu8cChd4QK9u4=; b=JBDy7fylnU/Jm31EUVo+h0R9wvOWKV6a4Rd4juGoVZhQO2tOrlGkPgI+Sms85ADw83 mQhnu0l9I5lR/5rlinuGYfKu6ltdpz0eVkEVTJTRhWAb0iZ1xaXWnd7ZIAqZceHhARN9 YtdGWpe6wYtPl+UvwEqEDALp1pdj3eVka/CJM3v9HQnVRyyi/3QogJzAEH1CZbUkrTKq y3gPIaFKSH5RIKFKAgK0neff+tVslTyHmxUPv23/LoL6UNyhRUwg7eMNsb4RRCMmR986 qWwthQpo5S+BbVFQDUEUrnT7PCVy2nkDemK/EIM33drWgbx4+oWEJxGZMWsJJleaHNDP QjGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773558530; x=1774163330; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=D7SBLNkZfE70Q4c4n8fHx6puQVux00Zu8cChd4QK9u4=; b=sRhoqyWaEwvBDnu53s7g8PWfz2kBS9ojHTJlhoTQsSIm/RZXZcb3rKy+o6zA2G1jlu 6eqrRfAqmpQKVyVQzEvnsO3nGWWDPfTqoKpf63WK00PiaHp8d062IKDPWY90Jg77Sn3G 203nJ5vM01KQdtqD/PNcREI3ACzdmIurvNNW8rEy9lZzRCLHweKWRXd+64wqCLmWQvwJ 7RvIiyKxzb59Jv0XCm9zsoGCcly5qCwcSVAR7xzDrCGyIewNXq7SsggkZ0eAJAqwKEyr 9uY8L5a5GNHbVv6Af+2nS40q+D0HGTZJ05prUblLhkkkEwZigSux+1y9eCWwhIvcfvEc VapA== X-Gm-Message-State: AOJu0Yxb2L2sa728OUqNp5NTfQvBrAwwhwyqKB8/gYeL+z8QAJfjLgm7 fSE1z2aUK52UqmWV2/6EtZpa6qyOmGzLzybfMpMhBgzNh1WyYNtu55+AZMDzQ6OVPDxPEWenctF HNe0lXW8= X-Gm-Gg: ATEYQzyandPnZaPuxrAFeer7zWZqSkDW7Ah48Idi8VMn1+R16uMmfh5K749IYWgUZLn 4TMkVh+ghC1sMVNbKvsMT13G/VtIk+f/7nGes4MzhFcwUn5BEImh0AIci8E2mv+2gS/JP96BFHr 1cD998HcbqoG23Wtc9nSnD4yP9aCer5WFHvHRghdNDxJEEKj0Za5LqhszTKxkOtfL8jal5Ri1T0 L3Jaw/7BmqPUdenIpgYht7GYwX11boIuvNDHlm/R7JtvOwtZH9XMWhhccS3bvcUW43Gj8TaBm1x vZ9yb/bYirBIO22bJgrtmknaLLdXqlEGgW+4DDhYruadvCEimZ7tySbyDUUXlmZLJdUhIFQBGET DaBjt7SPJeE2JTw5SEP/rb7bsx2oKE9MAYfUEMaoBQqQkKGr5D7Aqak1YvK/aNREG5N1KujeLtK oNwshtLUu4Xi+VtrTfobCyUBkFLfxWF2IkhRuARgycBHeQt61TbyVM21SPtibDHAIQcfaLaJevX Nc= X-Received: by 2002:a17:90b:574f:b0:359:fe72:3559 with SMTP id 98e67ed59e1d1-35a21fdd3b7mr8189306a91.21.1773558529698; Sun, 15 Mar 2026 00:08:49 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Richard Henderson , Paolo Bonzini , philmd@linaro.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-ppc@nongnu.org, eric.auger@redhat.com Subject: [PATCH v3 6/8] hw/vfio/ap.c: use full path for target specific header Date: Sun, 15 Mar 2026 00:08:32 -0700 Message-ID: <20260315070834.198331-7-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260315070834.198331-1-pierrick.bouvier@linaro.org> References: <20260315070834.198331-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1034; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pj1-x1034.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1773558635555154100 In addition, we fix target/s390x/kvm/kvm_s390x.h cpu-qom include also. Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Pierrick Bouvier Tested-by: Philippe Mathieu-Daud=C3=A9 --- target/s390x/kvm/kvm_s390x.h | 2 +- hw/vfio/ap.c | 2 +- 2 files changed, 2 insertions(+), 2 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 =20 -#include "cpu-qom.h" +#include "target/s390x/cpu-qom.h" =20 struct kvm_s390_irq; =20 diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c index 856fa2678cd..3fae9ae9814 100644 --- a/hw/vfio/ap.c +++ b/hw/vfio/ap.c @@ -25,7 +25,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/core/qdev-properties.h" #include "hw/s390x/ap-bridge.h" --=20 2.47.3 From nobody Fri Mar 27 02:37:20 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1773558643; cv=none; d=zohomail.com; s=zohoarc; b=UYK2WXNVl1/2DyfB37kV1E9mTZYkwUgTnIlowLJ8mhCr9ATmgJwIESpPv4ZdLFfFfBcyfJ8dt6n4N3+KATE3q2JMJhHve0xaQ8Ob88MdfMHyldXuGHZri/FgERcAlVXfzxHApmxNCxXtiqPbn5SSVOEBy0rAx5YTGqUTo7kXDJA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773558643; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=U6HBDS69l4fbTlZmSQgqfg1BjiYPNjySjY8DwVgdsMo=; b=FeznhaGpG3zf7SRQpfM3JoXkKxuxDxmSM6XF5xYxgz08voYHHetE7A+UcZsBxrqjw8ZWymTXqeTitgXW6FQU9rjkhkfEaMugZ5TC4v3bK0JlpkLZsmFPze4UjXVXCKuY4I2eZN/ELBjOl9auKdn41SpJQnTcRn9XRujshpRm3pw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773558643362499.25944735723067; Sun, 15 Mar 2026 00:10:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w1faq-0001mO-56; Sun, 15 Mar 2026 03:08:56 -0400 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 1w1fao-0001lS-Cq for qemu-devel@nongnu.org; Sun, 15 Mar 2026 03:08:54 -0400 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1w1fam-0000dt-K2 for qemu-devel@nongnu.org; Sun, 15 Mar 2026 03:08:54 -0400 Received: by mail-pj1-x102d.google.com with SMTP id 98e67ed59e1d1-35b905e9dc0so367847a91.3 for ; Sun, 15 Mar 2026 00:08:52 -0700 (PDT) Received: from pc.taild8403c.ts.net (216-71-219-44.dyn.novuscom.net. [216.71.219.44]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-35a24acecadsm3468233a91.2.2026.03.15.00.08.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Mar 2026 00:08:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1773558531; x=1774163331; 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=U6HBDS69l4fbTlZmSQgqfg1BjiYPNjySjY8DwVgdsMo=; b=lTHHhYOD4Xpjjkgmy70EQoTXQun3nSau9SXVUe6cUR65svfJ3f+KqUMj4zkMTMxBPP +48/YtHzOcq9gv00/i85589KRGW/TPRrrvR5rPp2kUfYfB9LTYOoFOugAtlClksF9qxv yKVTkJoAGFsG7cfVwbveFNS6mKczLnEHo+hH+89gFSdM47++Nm9K4owvwM4vwPGhtRuf YMTjahWRp3uHZDlepUw+8LBAR9UWtbGEl3X6wlgkDVZqrHP5qQ4RXuXyfbEJoc2yld1s aXZEo5au78eg8oOsOUcj7LbRxUJ75i+ec7D3iL5ucoqlLYPRVPmmS5422AVqha96hmcv ElQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773558531; x=1774163331; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=U6HBDS69l4fbTlZmSQgqfg1BjiYPNjySjY8DwVgdsMo=; b=YOQ4RSF6gHB6kQA81GPyLr2MIsE/o9F9bCq64RS59aIRVwsgZJjJAaneLNPzbMp+Hi NVGXLA16s9NaTAxLEkjER+APcF9JAoLHz2ailcPj0t8th1OcSrRjhp+hiCn3TnBdAyxX n98txgmOOObZktpH4uUeqKqVh8iUsa8QyLxhrA6pRezOzOxcvdrkSWbS5S3LHFstTX3f 47srsV0+Y9atWkAYKGXCqrJ5kfVKgd/QXdN1oOGU5hi6B0mCmMGZhfOfXn4Fay2ugwnP O/TZow5KH2XhDo2wI5NowJhpDJZgunCllCrWdBG+IIbVgqc902hbXQXYLmwrbWi/BR8l u+7g== X-Gm-Message-State: AOJu0Yy8yE/u16761yvlbLV0r/IhKsP6a7f7EmOPo+AqepRNGkaBKNAE Lc+k3/e/Lj8rxOuEUYR5jbDpAOEVoxEiJBNhp0wn6nKxY/lWLrEryaGBRNTfhH47qCW+cyHRYKE /CAKiQls= X-Gm-Gg: ATEYQzwAp6fvalv7lSqRKSIBLWRz5tUTl5SvElQUM2pi1xfihKerlQSwtrGw0s6wiaJ YkDaFb8WCbrAUj6Ogaope4a0Sn2gAr9q7f5MY1jdGt8Nv6wSALRFnxe5U/BovLPR/jnQhJGj0gR DJxydpoGfcVx00CzuSvzHJR5Ya16+rMVfBJ2QNNYuyx1hl/yino7K3KESgOWBmd1KBh0Juva0qc BoAyCRczK1tnqBlufRulZC5sXPbKmdOT3ZvnFKl35ZgGoB68gTKbpSK+gWPm16bbkQqWgpCn7bD 32IJ4Dm66nNNm2UrH2/OL/s54mkJ/65u8Ea/qs6cbx24uW4rhmg9W7fS+6KY6ZIW7RByQ0kSr3g wRvtm1qv9Fyc3oPg3mzndzYG33S2djW6iG4Uq4twV0+F3C3GDDXig0kUONImMHwkPj7orwTx76e SibgXuaUajZI8Yi+2asoZusjc3WIKOCU7+hjPUPc7kYo1gxXHh+6KjPvvt9P1QpVIReS2yutxMd UY= X-Received: by 2002:a17:90a:d407:b0:359:1130:1047 with SMTP id 98e67ed59e1d1-35a21fdd3acmr7857183a91.17.1773558531025; Sun, 15 Mar 2026 00:08:51 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Richard Henderson , Paolo Bonzini , philmd@linaro.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-ppc@nongnu.org, eric.auger@redhat.com Subject: [PATCH v3 7/8] hw/vfio/spapr.c: extract vfio_spapr_kvm_attach_tce to hw/vfio/kvm-spapr.c Date: Sun, 15 Mar 2026 00:08:33 -0700 Message-ID: <20260315070834.198331-8-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260315070834.198331-1-pierrick.bouvier@linaro.org> References: <20260315070834.198331-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::102d; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pj1-x102d.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1773558645188154100 Since this function needs kvm specific types, we need to extract in another file and link it only for KVM builds. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Pierrick Bouvier Tested-by: Philippe Mathieu-Daud=C3=A9 --- hw/vfio/kvm-spapr.h | 12 ++++++++++++ hw/vfio/kvm-spapr.c | 47 +++++++++++++++++++++++++++++++++++++++++++++ hw/vfio/kvm-stubs.c | 8 ++++++++ hw/vfio/spapr.c | 30 ++++------------------------- hw/vfio/meson.build | 1 + 5 files changed, 72 insertions(+), 26 deletions(-) create mode 100644 hw/vfio/kvm-spapr.h create mode 100644 hw/vfio/kvm-spapr.c diff --git a/hw/vfio/kvm-spapr.h b/hw/vfio/kvm-spapr.h new file mode 100644 index 00000000000..b1f68c686a7 --- /dev/null +++ b/hw/vfio/kvm-spapr.h @@ -0,0 +1,12 @@ +/* + * VFIO sPAPR KVM specific functions + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "hw/vfio/vfio-container.h" +#include "qapi/error.h" + +bool vfio_spapr_kvm_attach_tce(VFIOContainer *bcontainer, + MemoryRegionSection *section, + Error **errp); diff --git a/hw/vfio/kvm-spapr.c b/hw/vfio/kvm-spapr.c new file mode 100644 index 00000000000..ad71c5a85e2 --- /dev/null +++ b/hw/vfio/kvm-spapr.c @@ -0,0 +1,47 @@ +/* + * VFIO sPAPR KVM specific functions + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include +#include +#include + +#include "hw/vfio/vfio-container-legacy.h" +#include "hw/vfio/kvm-spapr.h" +#include "qapi/error.h" +#include "trace.h" +#include "vfio-helpers.h" + +bool vfio_spapr_kvm_attach_tce(VFIOContainer *bcontainer, + MemoryRegionSection *section, + Error **errp) +{ + VFIOLegacyContainer *container =3D VFIO_IOMMU_LEGACY(bcontainer); + VFIOGroup *group; + IOMMUMemoryRegion *iommu_mr =3D IOMMU_MEMORY_REGION(section->mr); + struct kvm_vfio_spapr_tce param; + struct kvm_device_attr attr =3D { + .group =3D KVM_DEV_VFIO_GROUP, + .attr =3D KVM_DEV_VFIO_GROUP_SET_SPAPR_TCE, + .addr =3D (uint64_t)(unsigned long)¶m, + }; + + if (!memory_region_iommu_get_attr(iommu_mr, IOMMU_ATTR_SPAPR_TCE_FD, + ¶m.tablefd)) { + QLIST_FOREACH(group, &container->group_list, container_next) { + param.groupfd =3D group->fd; + if (ioctl(vfio_kvm_device_fd, KVM_SET_DEVICE_ATTR, &attr)) { + error_setg_errno(errp, errno, + "vfio: failed GROUP_SET_SPAPR_TCE for " + "KVM VFIO device %d and group fd %d", + param.tablefd, param.groupfd); + return false; + } + trace_vfio_spapr_group_attach(param.groupfd, param.tablefd); + } + } + return true; +} diff --git a/hw/vfio/kvm-stubs.c b/hw/vfio/kvm-stubs.c index 5a489d1b711..78c51b99155 100644 --- a/hw/vfio/kvm-stubs.c +++ b/hw/vfio/kvm-stubs.c @@ -6,6 +6,7 @@ =20 #include "qemu/osdep.h" =20 +#include "hw/vfio/kvm-spapr.h" #include "hw/vfio/vfio-device.h" #include "qapi/error.h" #include "vfio-helpers.h" @@ -24,3 +25,10 @@ int vfio_kvm_device_del_fd(int fd, Error **errp) { return 0; } + +bool vfio_spapr_kvm_attach_tce(VFIOContainer *bcontainer, + MemoryRegionSection *section, + Error **errp) +{ + g_assert_not_reached(); +} diff --git a/hw/vfio/spapr.c b/hw/vfio/spapr.c index a9f093c3570..42690e4323d 100644 --- a/hw/vfio/spapr.c +++ b/hw/vfio/spapr.c @@ -16,6 +16,7 @@ #include "system/address-spaces.h" =20 #include "hw/vfio/vfio-container-legacy.h" +#include "hw/vfio/kvm-spapr.h" #include "hw/core/hw-error.h" #include "qemu/error-report.h" #include "qapi/error.h" @@ -406,33 +407,10 @@ vfio_spapr_container_add_section_window(VFIOContainer= *bcontainer, vfio_host_win_add(scontainer, section->offset_within_address_space, section->offset_within_address_space + int128_get64(section->size) - 1, pgsize); -#ifdef CONFIG_KVM - if (kvm_enabled()) { - VFIOGroup *group; - IOMMUMemoryRegion *iommu_mr =3D IOMMU_MEMORY_REGION(section->mr); - struct kvm_vfio_spapr_tce param; - struct kvm_device_attr attr =3D { - .group =3D KVM_DEV_VFIO_GROUP, - .attr =3D KVM_DEV_VFIO_GROUP_SET_SPAPR_TCE, - .addr =3D (uint64_t)(unsigned long)¶m, - }; - - if (!memory_region_iommu_get_attr(iommu_mr, IOMMU_ATTR_SPAPR_TCE_F= D, - ¶m.tablefd)) { - QLIST_FOREACH(group, &container->group_list, container_next) { - param.groupfd =3D group->fd; - if (ioctl(vfio_kvm_device_fd, KVM_SET_DEVICE_ATTR, &attr))= { - error_setg_errno(errp, errno, - "vfio: failed GROUP_SET_SPAPR_TCE for= " - "KVM VFIO device %d and group fd %d", - param.tablefd, param.groupfd); - return false; - } - trace_vfio_spapr_group_attach(param.groupfd, param.tablefd= ); - } - } + if (kvm_enabled() && !vfio_spapr_kvm_attach_tce(bcontainer, section, e= rrp)) { + return false; } -#endif + return true; } =20 diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build index 6c00a7f51bb..bab5f2b7f15 100644 --- a/hw/vfio/meson.build +++ b/hw/vfio/meson.build @@ -10,6 +10,7 @@ vfio_ss.add(files( vfio_ss.add(when: 'CONFIG_KVM', if_true: files('kvm-helpers.c')) stub_ss.add(files('kvm-stubs.c')) vfio_ss.add(when: 'CONFIG_PSERIES', if_true: files('spapr.c')) +vfio_ss.add(when: ['CONFIG_KVM', 'CONFIG_PSERIES'], if_true: files('kvm-sp= apr.c')) vfio_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files( 'pci-quirks.c', 'pci.c', --=20 2.47.3 From nobody Fri Mar 27 02:37:20 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1773558605; cv=none; d=zohomail.com; s=zohoarc; b=VqDitCUn8dv7zdCKzJ9knBmcJUU+9F+PROwMI7GDGZ2uU4X2qLTZaIAteFSUmHkT0gFCeqwIEh55ApWQh2P7c1RYSbjzHoxZQmJb1fTR6q6+a5zLeeGG1XeauP1UjOfsfCxUmdM93YywTEavX+P6gsY96DUvBbpFxSBIdXW67fs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773558605; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=j1EkWaHvbsvBNf8xjg+jC92XlcL8wcQLQiGSVioaaEM=; b=lSPOVANk8JOQT0w2iBF444Lghla/edtmmzzYS+d/uR7RKXmLmYuvx3woCXBxrIRfoScWb+GKHSa2mZGtu6TWBfEi9c9FE0JQmMMgtau0PUAkcmv79Ofar3qMTiVAnr62n4fnwCaVsIiHjCrIw3sUP1caLb3Miz7faYe+pfEQ0Lw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773558604380302.1322411850243; Sun, 15 Mar 2026 00:10:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w1far-0001nL-NZ; Sun, 15 Mar 2026 03:08:57 -0400 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 1w1fap-0001m6-IW for qemu-devel@nongnu.org; Sun, 15 Mar 2026 03:08:55 -0400 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1w1fan-0000eE-Nz for qemu-devel@nongnu.org; Sun, 15 Mar 2026 03:08:55 -0400 Received: by mail-pj1-x102b.google.com with SMTP id 98e67ed59e1d1-35b905a05a8so356302a91.1 for ; Sun, 15 Mar 2026 00:08:53 -0700 (PDT) Received: from pc.taild8403c.ts.net (216-71-219-44.dyn.novuscom.net. [216.71.219.44]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-35a24acecadsm3468233a91.2.2026.03.15.00.08.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Mar 2026 00:08:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1773558532; x=1774163332; 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=j1EkWaHvbsvBNf8xjg+jC92XlcL8wcQLQiGSVioaaEM=; b=JWL6Hcy81i5O7bjpy/DtlVdfdzfQE6FkrOSMzhude0M0Odpugw5qPJD/HTwlqq4JGh 67p1AjpnQYnQNriAfpv0X+oCRZlI7mzjUnk/HQhjvzmj19f8dhj4P17jeUh+0rzMlxaG q2Kqivz7n3pwSRvs3kHAbaHmmYZ/5AGBkGiQK5KUxZdzSgNRNMShLu3ph0t9DSsP2sYV DHHAhbjM8wbYVLVUDGg+pzPPLzA4rbOEPOm5ZHW5kd43L7hSjlfmSuYNHWvi1uGWhL2A b94aq3DK5gLPbHB70ovEn5FKSbY35tA3flpRfcJryYeZD5Of6pBWOGTpUCm+AhiVKp/s jlkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773558532; x=1774163332; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=j1EkWaHvbsvBNf8xjg+jC92XlcL8wcQLQiGSVioaaEM=; b=qL65WmrwJrohouhiOHB6nCEza63Y0AAAHP09USftAyAvu3wul9exlJOuMy1XECDwLn 7PfdMUi1qNnUOnvTAMsbPGVIuXMiH7maZuPJM5tA9qqVlYdCN9Gld5LZjzkXx084SU0g 1s4qzlZ2miRKIc/jsUkPdDd/2fEGnkkFrpUV66SiRhroVbwRhZv9Y4VX86/iz9SpIZ97 iEb2VmUBnpP54fQLF96RUya9y85OvzkHsTlh9L3s+i4DB72xC/mYwIzyJzE4WxlhPlPy 1gJMJxsy3ZziT/Iq9YpdOtNZuoyofBEO13mkibawXrsrpt07JC9BpjTGWZnoCZSC3GrL pBDQ== X-Gm-Message-State: AOJu0YxRyRCrYu5rVN5MJncYOEcHbZVCCIbAeU9vLzyV7ju+caVSf95A zdIsfNukKyeQ6qsIW++s15evEUVvyQMRP8smOyhClsRlSfSJuf+6C3yHj2HFUuQ2rILTqWWkJOQ hoaBW+p8= X-Gm-Gg: ATEYQzy7YcMNX1GjAiG0DN/3pT7RvO2Wdk7PjGu9aT9AUpBhvIlFiGf3V4TZn6y4l/X R2uFQQ1Nobggdc1k7gk9rSqHsYk7fUE1qe3kx8/sn8P5s8FRz71Jkf+L8PeTH3g8TcYkz+G619D 0aTj26snUdaJx6jl7LCmr9Kzx42ZmHP7xmJrn5siApPRnLP3ioWMxC8/BlK9vHnjxQCz4bMUHjb 0mdzE62Txg18funUen1lnDLV+qrzcovfnyoLSSDTs++2MiMqifSvhKcVqcAT0v5QMkaD22RbqHY omatxwOm1OBHKzZAgkvG1vrsxfBHhe8W59NrxEPn8CIsFEURjRuiapJ60iOx9DWJHmXOpIsDsw5 rhd9vdM7cbCeh+ax9lGqYfC+JPH9A8QwTaqMBdwGdfMfuwe9ncPqgE+xsKX0YAC7NItg3I4LCoi xbSEOwsy/E3zaSsxMIy2LQBnHY5thDc3fKJByXA41q1kUmqQ3wXpq1XsvXMiwVbDNkYEREfvRSI /c= X-Received: by 2002:a17:90b:540c:b0:359:9016:1e72 with SMTP id 98e67ed59e1d1-35a2208b5e6mr7653157a91.19.1773558532311; Sun, 15 Mar 2026 00:08:52 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Richard Henderson , Paolo Bonzini , philmd@linaro.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-ppc@nongnu.org, eric.auger@redhat.com Subject: [PATCH v3 8/8] hw/vfio: all vfio files can now be common files Date: Sun, 15 Mar 2026 00:08:34 -0700 Message-ID: <20260315070834.198331-9-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260315070834.198331-1-pierrick.bouvier@linaro.org> References: <20260315070834.198331-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::102b; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pj1-x102b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1773558606821158500 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Pierrick Bouvier Tested-by: Philippe Mathieu-Daud=C3=A9 --- hw/vfio/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build index bab5f2b7f15..fa0ea6ecf0e 100644 --- a/hw/vfio/meson.build +++ b/hw/vfio/meson.build @@ -20,7 +20,7 @@ vfio_ss.add(when: 'CONFIG_VFIO_AP', if_true: files('ap.c'= )) vfio_ss.add(when: 'CONFIG_VFIO_IGD', if_true: files('igd.c')) stub_ss.add(files('igd-stubs.c')) =20 -specific_ss.add_all(when: 'CONFIG_VFIO', if_true: vfio_ss) +system_ss.add_all(when: 'CONFIG_VFIO', if_true: vfio_ss) =20 system_ss.add(when: 'CONFIG_VFIO', if_true: files( 'cpr.c', --=20 2.47.3