From nobody Tue Dec 16 03:21:21 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=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1752008014; cv=none; d=zohomail.com; s=zohoarc; b=dW5Yc8AhNv+KeLtaox1eNBTRzzjErNxrUGWUAonkvOwquQ2BjXfk1NyS8xit1l0OXNfYn8AzgeYECKJWQqktQKbHaWqt+sAVUy4uxVzpfXdymuyD9orrAPndIjKECmS195ATaj3QwOP9ZYWJJwuscUv8RTphkbP3HcCNBmBUt/4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752008014; 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=bEOImi2VO3DZu8PRd+W9Z97+V53/R1U1vvMpOETczLE=; b=G50VNzyGpn5dYmh+JNri7JbXCMyrr9/jQ2vTTpDLqO2GGt3tak+IUL/snLK9nd82Hpr6jtSLAeLTOTD/G1wXUUHoVBHEx3MY+t/m67S/Y7ORDZFI7lKo1Awehqvr7QQZUlwLiZZ+Q1xrBNyW1TTsj0mEeKFgdRBrNTYBKStQ8l0= 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 175200801417892.37926044373182; Tue, 8 Jul 2025 13:53:34 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uZFAa-0003eD-Td; Tue, 08 Jul 2025 16:44:04 -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 1uZDcq-0002pK-VE for qemu-devel@nongnu.org; Tue, 08 Jul 2025 15:06:00 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uZDcm-0003zK-WE for qemu-devel@nongnu.org; Tue, 08 Jul 2025 15:05:08 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-450ce3a2dd5so44277575e9.3 for ; Tue, 08 Jul 2025 12:05:04 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b471b966c0sm13781596f8f.52.2025.07.08.10.23.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 08 Jul 2025 10:24:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1752001503; x=1752606303; 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=bEOImi2VO3DZu8PRd+W9Z97+V53/R1U1vvMpOETczLE=; b=Q8uYeK59UYKbSkk/ovK4Q7WRJi//1Q5thWcvPH3Hywf0LPt3Ts2zHgK2IJe+7nsT3H oXlltmS4lLuzg3ghXFVZ8tGTYG2RWZsoINrrc7rBHsUHQf+b5I9mQ6RjHb2pHfhb0GnI w0fSYTyuwfFiiQpxi48XT99zs0yDnr0bmVkb+ZCANYeAtru+xy8prpIQ+olh3aKCCIa7 CFafuL5/Vk6XXmpwY06nt0JOaMfH/PbrZ7Pu9zSRUGupDQhfbpXcCbs00RdsIzMMNMQe LqePtlffqwcPCSx/tAWaA4mI0CejkR6ek2ukEt/9lFep8HITLhpmBgXQfpRfA/MMXiD8 6m0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752001503; x=1752606303; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bEOImi2VO3DZu8PRd+W9Z97+V53/R1U1vvMpOETczLE=; b=d3yv82V86r6FnWBXLNx8o2iVcX1o6Jo8SEmSJYlRt0gfvZIvwM7RdUDRa4v1H9cumh 2iDuZWYZgisf6SIWhBn8Q5ppa0WUGQuYCrYxM2owZ9zSm1MIKrD/yhSEpS3uOZyuvLE3 Wx+2marwlMX2Rq5xLtUPZJShgV32S4rYhFkifbesL82fUkDMXzFPZfzlvSmD8uINLMj4 BIxSgtaOnxVen07SzVefWkhN/pdSTUgcFpSNq4E0BPFDaQM1Dc+YsaObIX2HiknYYuNv n1hmkRTFWHtQGiM2p2A9aBFOINvt4fDN/0wNwvDsOwHW+qDd84988VzTbecdduiwtsob vVZw== X-Gm-Message-State: AOJu0YzsyXRfF5WlSBpaMXQAJY5TaErFQWSEwwPfFrzZcOA4ugQIbtNa f9i+nrrS6lmAgVWlJer6FXCGXs5iF3iOiypyaTwsxuRHTRIHPJIzmM0hE+meSRrZg3LmHE1Ickm FsdW0 X-Gm-Gg: ASbGncspw6GeU3GWmMStSXlEZOkv+ZutPrzgwnLgxzD4l/qliCWFTZR/yrMApppIWdC c1FULHF0r5cj3T+A1pWNkme7MFn2lZ6qk60C+BYPODZApZwLsYWhKLZiyGBBnCJo66roh1zVlEd UfBaUnLp4F+9lQyec2NpUP24z0Hf0P/sfx6dBAx1tWSJi1bYR9Ni+Z8XpkeoyzZPvZkuiNji+qd fvMdiYgdEwGEOQR6p+pRX9UPCki1NqgzufSsk8GkW/59EV6Aw1KENScMWA2dvBfUsDSxcnWEtdZ JGSbrcIamGMfM6ChhLaxZLJw/hW6mR6lkh8u2rO68Ona7vbKjUi4f7xW0C08WaFu1EeQk9UFeBj M+po8IrTIYwIGhK4xwg3jYmRunoxsPnrDP+nV X-Google-Smtp-Source: AGHT+IG2E4JIlXfdQQvRjce8IXIvZNIOOF5rgjcL1X02SY3IwGdbbfoCXCdaMg6vCkSGBjZ9LVYmXg== X-Received: by 2002:a05:6000:2c06:b0:3a4:f2ed:217e with SMTP id ffacd0b85a97d-3b49702e79emr12971492f8f.42.1751995451388; Tue, 08 Jul 2025 10:24:11 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Manos Pitsidianakis , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Paolo Bonzini , Thomas Huth , qemu-arm@nongnu.org, qemu-s390x@nongnu.org, Pierrick Bouvier , "Michael S. Tsirkin" , qemu-riscv@nongnu.org, Richard Henderson , qemu-block@nongnu.org, qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Kevin Wolf , Hanna Reitz Subject: [PATCH-for-10.1? v7 8/8] hw/virtio: Build various files once Date: Tue, 8 Jul 2025 19:19:48 +0200 Message-ID: <20250708171949.62500-9-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250708171949.62500-1-philmd@linaro.org> References: <20250708171949.62500-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1752008015533116600 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 --- MST prefers to defer this one to 10.2. 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 ad78e0b9bc5..f58d90b6e31 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 655704471a5..43ed296cf47 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 164f6fd995a..3ea7b3cec83 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 2.49.0