From nobody Sun Dec 14 05:51:28 2025 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1752535660; cv=none; d=zohomail.com; s=zohoarc; b=jby+rHjO6dAa7dne+wHEr1mS3kyATSsrW9Gu3OuTkta3Hb1oG7znyt9v2aNwqx5itnxoKdm8Puybxr8LJ0jBDvnDnnUQjJtVlCf6fVV1Db6tjzmil9SLSZMoPLtlSnwTdkZZs6BpMfIuYP9ZA2LLysdEtEk9kn2WmgxVYqrMI60= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752535660; 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=wprZxgNau5OjvcVyBV3BiqgIT2inRbQfjmepelKWyDE=; b=ZGlBJMM1A0DkzR/woe5T6hjRBbIFuRJK67/+fVGTFy6KBiJvONpOXRq+Mg12jLD9jdPnMDzkoRxTJtPp92C9tOm55H22Jub/QIX/N6dTFpp0T0AaSXizIEb7+EWPh265kDFbRauF8LO5RRyI66d9TQmRNnGQClKEbu7zE7aOgBE= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1752535660052318.9681093109507; Mon, 14 Jul 2025 16:27:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ubSI2-0001mx-IO; Mon, 14 Jul 2025 19: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 1ubSHX-0006V8-BK for qemu-devel@nongnu.org; Mon, 14 Jul 2025 19:08:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ubSHU-0005gG-K0 for qemu-devel@nongnu.org; Mon, 14 Jul 2025 19:08:23 -0400 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-416-DIvC5RLYMQWVkg5ifkXfbQ-1; Mon, 14 Jul 2025 19:08:17 -0400 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-3a52bfda108so2378987f8f.3 for ; Mon, 14 Jul 2025 16:08:16 -0700 (PDT) Received: from redhat.com ([2a0d:6fc0:150d:fc00:de3:4725:47c6:6809]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b5e8dc1f70sm13408631f8f.27.2025.07.14.16.08.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Jul 2025 16:08:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752534498; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wprZxgNau5OjvcVyBV3BiqgIT2inRbQfjmepelKWyDE=; b=X28CWvrJVJoTLl/4JvAH6MB/SO2UrFLhT7m/kab/eROHKJPb+9M2+80aRCMYqNPa9kOL4J HJtNHbEtWvnHJ3yHH/r89695XAso9EvLian4TMDuZ9YLCQtgpzzMr/GKIiwY0Sf0NDb6+7 xx1uLpgproJ5yM3yqPk/CBtyHzN2qso= X-MC-Unique: DIvC5RLYMQWVkg5ifkXfbQ-1 X-Mimecast-MFC-AGG-ID: DIvC5RLYMQWVkg5ifkXfbQ_1752534496 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752534495; x=1753139295; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=wprZxgNau5OjvcVyBV3BiqgIT2inRbQfjmepelKWyDE=; b=tBhkplP0A7+Wev8z/VeN0ZwoFpBm2EYf4eS6hFyCXo+DI9Vk6xjELJEJLE3Kbeyw/U JWNwB/os+aqp9dtGg+olMXmazkyFe3/7Q4EJwLUGhVBq0Lspjjni4zoY0B8oKh7U2LH0 2XJUTEb79MxzdiGUgoaguVylv8MG0iDCX8lq8mDUKqyB+KLlyeCcaYznYzFt+j9ECaiA W9VQod+wiAMHts9Hl7px5GYinMCuKRWoqpNxIJcHnWMHULNpOcoUSM9h5kL30CiBnhLv JnvbrVnZVqEctvl7jO7+7VQbkLtapBBL4fCpYmcsfesso/3QnuwvTKUs2UV/5YfHH3sh HDUQ== X-Gm-Message-State: AOJu0YxnG2zSm3ryT6h6NkNBr8Doka1KiL17/5NmiIdKtT+dfKG+ufPP jBCivQj0eQeFq9S++g2ODUHLgJ1WOqGuNANI4D/Dox46fMUcav6AbGZnVf3DAp5eG09gUsNMFuH pZnR2DCOGKFZKfNE0SlyCzH54Qgxy+ydos+FKryUjf6qagofho+xlHEl6rDjAIli29QKwIs2fRZ GYA5LsJXHnbbYC+wkrE1sF4bQF97Dx8F4zeQ== X-Gm-Gg: ASbGncveSKKVNAjB3EthkxsKBdQWS/kecTjsqRennnOsvsBq29dtkM8HHQIIbY011nK EDDR+cDHppevT9WzFyPij5iziG0ZlupdHmpLaH6dHNFNQxWpS7+HJ906oB/IrVfsNCQ1QysakG5 f882T+FXT3jyPh5dWzD6rgFES99he3+XxIUU19FqooK1mM1xZJPwA5Kqju/p8csY9G3WVqlfqPA Qy0Ur+XYZqL/ZCbhiipBzJYNUW45Sq+VrAjkgXoyvC1X9E7qDXyPE9TarGdD0OtJ/LOqffQMSPX JtrNRQjI9/EvT1AHuuMzyEXECIwMQ8az X-Received: by 2002:adf:e194:0:b0:3a4:e393:11e2 with SMTP id ffacd0b85a97d-3b5f35795c3mr10631077f8f.34.1752534495394; Mon, 14 Jul 2025 16:08:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGZ7pzK3m27nyh5CuMGwAD5vfKGnUTLZdbomspEXXyw/msF0CvY/PsNbH98IZeW56tHLiE6uA== X-Received: by 2002:adf:e194:0:b0:3a4:e393:11e2 with SMTP id ffacd0b85a97d-3b5f35795c3mr10631061f8f.34.1752534494938; Mon, 14 Jul 2025 16:08:14 -0700 (PDT) Date: Mon, 14 Jul 2025 19:08:13 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Manos Pitsidianakis , Pierrick Bouvier , Kevin Wolf , Hanna Reitz , qemu-block@nongnu.org Subject: [PULL 46/97] hw/virtio: Build various files once Message-ID: <2e74e46aaa31a6437af2aaf9a9fc47fdd53e142f.1752534227.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1752535660694116600 From: Philippe Mathieu-Daud=C3=A9 Now that various VirtIO files don't use target specific API anymore, we can move them to the system_ss[] source set to build them once. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Manos Pitsidianakis Reviewed-by: Pierrick Bouvier Message-Id: <20250708215320.70426-9-philmd@linaro.org> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/virtio-config-io.c | 1 - hw/block/meson.build | 6 ++++-- hw/virtio/meson.build | 20 +++++++++++--------- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/hw/virtio/virtio-config-io.c b/hw/virtio/virtio-config-io.c index ad78e0b9bc..f58d90b6e3 100644 --- a/hw/virtio/virtio-config-io.c +++ b/hw/virtio/virtio-config-io.c @@ -11,7 +11,6 @@ =20 #include "qemu/osdep.h" #include "hw/virtio/virtio.h" -#include "cpu.h" =20 uint32_t virtio_config_readb(VirtIODevice *vdev, uint32_t addr) { diff --git a/hw/block/meson.build b/hw/block/meson.build index 655704471a..43ed296cf4 100644 --- a/hw/block/meson.build +++ b/hw/block/meson.build @@ -13,7 +13,9 @@ system_ss.add(when: 'CONFIG_SSI_M25P80', if_true: files('= m25p80_sfdp.c')) system_ss.add(when: 'CONFIG_SWIM', if_true: files('swim.c')) system_ss.add(when: 'CONFIG_XEN_BUS', if_true: files('xen-block.c')) =20 -specific_ss.add(when: 'CONFIG_VIRTIO_BLK', if_true: files('virtio-blk.c', = 'virtio-blk-common.c')) -specific_ss.add(when: 'CONFIG_VHOST_USER_BLK', if_true: files('vhost-user-= blk.c', 'virtio-blk-common.c')) +specific_ss.add(when: 'CONFIG_VIRTIO_BLK', if_true: files('virtio-blk.c')) +system_ss.add(when: 'CONFIG_VIRTIO_BLK', if_true: files('virtio-blk-common= .c')) +specific_ss.add(when: 'CONFIG_VHOST_USER_BLK', if_true: files('vhost-user-= blk.c')) +system_ss.add(when: 'CONFIG_VHOST_USER_BLK', if_true: files('virtio-blk-co= mmon.c')) =20 subdir('dataplane') diff --git a/hw/virtio/meson.build b/hw/virtio/meson.build index 164f6fd995..3ea7b3cec8 100644 --- a/hw/virtio/meson.build +++ b/hw/virtio/meson.build @@ -1,6 +1,7 @@ system_virtio_ss =3D ss.source_set() system_virtio_ss.add(files('virtio-bus.c')) system_virtio_ss.add(files('iothread-vq-mapping.c')) +system_virtio_ss.add(files('virtio-config-io.c')) system_virtio_ss.add(when: 'CONFIG_VIRTIO_PCI', if_true: files('virtio-pci= .c')) system_virtio_ss.add(when: 'CONFIG_VIRTIO_MMIO', if_true: files('virtio-mm= io.c')) system_virtio_ss.add(when: 'CONFIG_VIRTIO_CRYPTO', if_true: files('virtio-= crypto.c')) @@ -10,11 +11,11 @@ system_virtio_ss.add(when: 'CONFIG_VHOST_VDPA_DEV', if_= true: files('vdpa-dev.c') =20 specific_virtio_ss =3D ss.source_set() specific_virtio_ss.add(files('virtio.c')) -specific_virtio_ss.add(files('virtio-config-io.c', 'virtio-qmp.c')) +specific_virtio_ss.add(files('virtio-qmp.c')) =20 if have_vhost system_virtio_ss.add(files('vhost.c')) - specific_virtio_ss.add(files('vhost-backend.c', 'vhost-iova-tree.c')) + system_virtio_ss.add(files('vhost-backend.c', 'vhost-iova-tree.c')) if have_vhost_user # fixme - this really should be generic specific_virtio_ss.add(files('vhost-user.c')) @@ -43,22 +44,22 @@ if have_vhost endif if have_vhost_vdpa system_virtio_ss.add(files('vhost-vdpa.c')) - specific_virtio_ss.add(files('vhost-shadow-virtqueue.c')) + system_virtio_ss.add(files('vhost-shadow-virtqueue.c')) endif else system_virtio_ss.add(files('vhost-stub.c')) endif +system_virtio_ss.add(when: 'CONFIG_VHOST_USER_VSOCK', if_true: files('vhos= t-user-vsock.c')) +system_virtio_ss.add(when: 'CONFIG_VIRTIO_RNG', if_true: files('virtio-rng= .c')) =20 specific_virtio_ss.add(when: 'CONFIG_VIRTIO_BALLOON', if_true: files('virt= io-balloon.c')) specific_virtio_ss.add(when: 'CONFIG_VHOST_USER_FS', if_true: files('vhost= -user-fs.c')) specific_virtio_ss.add(when: 'CONFIG_VIRTIO_PMEM', if_true: files('virtio-= pmem.c')) specific_virtio_ss.add(when: 'CONFIG_VHOST_VSOCK', if_true: files('vhost-v= sock.c')) -specific_virtio_ss.add(when: 'CONFIG_VHOST_USER_VSOCK', if_true: files('vh= ost-user-vsock.c')) -specific_virtio_ss.add(when: 'CONFIG_VIRTIO_RNG', if_true: files('virtio-r= ng.c')) -specific_virtio_ss.add(when: 'CONFIG_VIRTIO_NSM', if_true: [files('virtio-= nsm.c', 'cbor-helpers.c'), libcbor]) specific_virtio_ss.add(when: 'CONFIG_VIRTIO_MEM', if_true: files('virtio-m= em.c')) -specific_virtio_ss.add(when: 'CONFIG_VHOST_USER_SCMI', if_true: files('vho= st-user-scmi.c')) -specific_virtio_ss.add(when: ['CONFIG_VIRTIO_PCI', 'CONFIG_VHOST_USER_SCMI= '], if_true: files('vhost-user-scmi-pci.c')) +system_virtio_ss.add(when: 'CONFIG_VIRTIO_NSM', if_true: files('virtio-nsm= .c')) +system_virtio_ss.add(when: 'CONFIG_VIRTIO_NSM', if_true: [files('cbor-help= ers.c'), libcbor]) +system_virtio_ss.add(when: 'CONFIG_VHOST_USER_SCMI', if_true: files('vhost= -user-scmi.c')) =20 virtio_pci_ss =3D ss.source_set() virtio_pci_ss.add(when: 'CONFIG_VHOST_VSOCK', if_true: files('vhost-vsock-= pci.c')) @@ -67,6 +68,7 @@ virtio_pci_ss.add(when: 'CONFIG_VHOST_USER_BLK', if_true:= files('vhost-user-blk- virtio_pci_ss.add(when: 'CONFIG_VHOST_USER_SCSI', if_true: files('vhost-us= er-scsi-pci.c')) virtio_pci_ss.add(when: 'CONFIG_VHOST_SCSI', if_true: files('vhost-scsi-pc= i.c')) virtio_pci_ss.add(when: 'CONFIG_VHOST_USER_FS', if_true: files('vhost-user= -fs-pci.c')) +virtio_pci_ss.add(when: 'CONFIG_VHOST_USER_SCMI', if_true: files('vhost-us= er-scmi-pci.c')) =20 virtio_pci_ss.add(when: 'CONFIG_VIRTIO_CRYPTO', if_true: files('virtio-cry= pto-pci.c')) virtio_pci_ss.add(when: 'CONFIG_VIRTIO_INPUT_HOST', if_true: files('virtio= -input-host-pci.c')) @@ -85,7 +87,7 @@ virtio_pci_ss.add(when: 'CONFIG_VIRTIO_MEM', if_true: fil= es('virtio-mem-pci.c')) virtio_pci_ss.add(when: 'CONFIG_VHOST_VDPA_DEV', if_true: files('vdpa-dev-= pci.c')) virtio_pci_ss.add(when: 'CONFIG_VIRTIO_MD', if_true: files('virtio-md-pci.= c')) =20 -specific_virtio_ss.add_all(when: 'CONFIG_VIRTIO_PCI', if_true: virtio_pci_= ss) +system_virtio_ss.add_all(when: 'CONFIG_VIRTIO_PCI', if_true: virtio_pci_ss) =20 system_ss.add_all(when: 'CONFIG_VIRTIO', if_true: system_virtio_ss) system_ss.add(when: 'CONFIG_VIRTIO', if_false: files('vhost-stub.c')) --=20 MST