From patchwork Tue May 23 16:35:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 685000 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1824488wrt; Tue, 23 May 2023 09:36:59 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5JI8r8DiV3nQY1rvt0NfkhL/lypt5A5uKID/VKSiyPT2x5yCAv+xPJlM0mcuoj6qZSR810 X-Received: by 2002:ad4:5b81:0:b0:615:a787:6d2a with SMTP id 1-20020ad45b81000000b00615a7876d2amr27676722qvp.3.1684859819125; Tue, 23 May 2023 09:36:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684859819; cv=none; d=google.com; s=arc-20160816; b=wuGE1C/B//Wjw/m3SDHooO11TGXk/bp9uTEj+fi2vAUMdCqsbdNTEPcR9SpvpPvfnd EEuyQvBDSP4ZT+baQO9qaRXVegTHAbD0DD/v3YSrWHHRbb4FwdiCYRdOfr3uF40uGTVB VGE/+MbGwgwyjybBSTxOD7AjmKzHVfnV/TcMMGrFlr23L1BR4iC9N1/tFkS8ujdV7Cvo 4qkUTobC7emJ6LKMznb5C+yjy4hAOCXHM+F7OeIMBq04EGRWY8SKFdH8bZJhUvP589BF XEDIoiY14hDnwOtmcUMqZBEAeOnjlu4vybvk86Et+qC//B0oQXBHTBVQlziTz4ldaGcV Ddfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=KptRZgpfBYhnMYPTPi1yHumyOrnlOIit30ThB+yVWk4=; b=IOu33zmf5QAtK59ELKngBKlhb0vYcoo1N3FGPxLvs6WfR+LI/YU1ArjV8ReMwpMi4j xdf6O2kOCoebIc3p0ngxwgZF4Xu/24AhIy/uPeW8RB8yTaR8KMyq3jV4lWbJGblNcZbN HyUCSdl7J9WI6PD4AJbN3j8vt2F7omF/Vndz3YPbIaC8+TpcM9uPzGyJtQxsedP4ovrT 8Lj3sTmjKuXVvswBibT2MgTidn1BUwPlTpaf7wka5S1vs2V9garkxixqqq+J44NPble6 z+gvEIWJv9WJ4dIy6Zk+6onJX3r0xCKDs0duEcOJheolE1D94b2TQG833xkko+1BETp0 CKfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=F7EyYfEj; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id w14-20020a05620a148e00b0074e186623a1si5147904qkj.23.2023.05.23.09.36.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 May 2023 09:36:59 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=F7EyYfEj; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1Uza-0008TH-Rr; Tue, 23 May 2023 12:36:10 -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 1q1UzY-0008SO-RP for qemu-devel@nongnu.org; Tue, 23 May 2023 12:36:08 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q1UzV-0001YX-Qs for qemu-devel@nongnu.org; Tue, 23 May 2023 12:36:08 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-3f50020e0f8so34949485e9.0 for ; Tue, 23 May 2023 09:36:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684859764; x=1687451764; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=KptRZgpfBYhnMYPTPi1yHumyOrnlOIit30ThB+yVWk4=; b=F7EyYfEj6ZREzAMVemN+LI+RJJw8lI7ll1z9ITfpS6jKfySxhd+udhvaq3dWf4jfuL dZfH+kRTpHzGVUPRxQylBLYOFzKIBqvBtb3HIs9blDBEetJVNpEu9xqaq0JsoiEW8LW4 pYxAiMnfx9szVefNDrHLlv6QzxYOm0NgV6fAba6qBmPcn3kGn+QTPu4Wu9U51TmhKttF cq9c9StYDARaoTjSA56L89egZc2LLGQ9r/tmJ0q9BTq0lkuBw5n0+Tj6yqgy72qRC0T8 qmY0xAjYJ3CwpAtEvKMIyncAyt+LI/FaqygrWMxkxQVUPgQSFdH08l8stQzzboHbWA71 Jryw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684859764; x=1687451764; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=KptRZgpfBYhnMYPTPi1yHumyOrnlOIit30ThB+yVWk4=; b=buYmAtlYkx92vIgH86ny9xjGFmt5mxAJhx5IVmgLeFGCinOPcUj7VjHNoeWn9XvWWM o5Kd7o/m8DWD6di1ER62lNI0tqq7dUeH9Iqx0T8R6lwYc15KngDzZdEBhUnJYm7Lsp94 Ulyyk/jBcwLc/zLiQCv32LBDjSRZS84x7kVjIK3mk/PSddk/5EyhqqAaHodQr2sjFIoH 6ZSVhIDiT9HdbeX0TOmr9fcSGOEYtwD61enTGaI2AZDmxJTdnSSFobOpZmx2Oitd/MvC 7nceWcwlbrU23xWynnYw0C6DumgLM1MLF8esvhGAcBnB7W4zVSbHZzBFC/UKC08PATrr jaOw== X-Gm-Message-State: AC+VfDwN2ZzgkFdl79YcEKn3qPzDjvz3psbsE5d4Ha3BuxI7P10aihxm MkSYHzSHqD5i8QFDhB5UJOnGZmSzPJpFyWLCDO4= X-Received: by 2002:a5d:4e87:0:b0:30a:3ae0:f455 with SMTP id e7-20020a5d4e87000000b0030a3ae0f455mr7118540wru.2.1684859764200; Tue, 23 May 2023 09:36:04 -0700 (PDT) Received: from localhost.localdomain (vil69-h02-176-184-48-94.dsl.sta.abo.bbox.fr. [176.184.48.94]) by smtp.gmail.com with ESMTPSA id c14-20020a056000104e00b00307b5376b2csm11488661wrx.90.2023.05.23.09.36.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 23 May 2023 09:36:03 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Raphael Norwitz , Peter Xu , Halil Pasic , Thomas Huth , "Gonglei (Arei)" , David Hildenbrand , Christian Borntraeger , Paolo Bonzini , "Michael S. Tsirkin" , Kevin Wolf , qemu-block@nongnu.org, Eric Farman , Fam Zheng , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Stefan Hajnoczi , Hanna Reitz , Cornelia Huck , Eric Auger , Ilya Leoshkevich , qemu-s390x@nongnu.org Subject: [PATCH 00/11] hw/virtio: Build various target-agnostic objects just once Date: Tue, 23 May 2023 18:35:49 +0200 Message-Id: <20230523163600.83391-1-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Less controvertial than my first approach [*] which caches the access_is_big_endian value in VirtIODevice state, this series just remove a unnecessary / pointless dependency on "virtio-access.h", allowing to build various virtio objects once for all targets. First we introduce the qemu_target_page_mask() and _align() helpers, similar to the _size() and _bits() equivalents, then we mostly perform meson.build massages. Mostly trivial. Last patch is RFC in case there is a performance issue. https://lore.kernel.org/qemu-devel/20221212230517.28872-11-philmd@linaro.org/ Philippe Mathieu-Daudé (11): softmmu: Introduce qemu_target_page_mask/qemu_target_page_align helpers hw/scsi: Introduce VHOST_SCSI_COMMON symbol in Kconfig hw/scsi: Rearrange meson.build hw/scsi: Rename target-specific source set as 'specific_virtio_scsi_ss' hw/virtio: Introduce VHOST_VSOCK_COMMON symbol in Kconfig hw/virtio/virtio-mem: Use qemu_ram_get_fd() helper hw/virtio/vhost-vsock: Include missing 'virtio/virtio-bus.h' header hw/virtio/virtio-iommu: Use target-agnostic qemu_target_page_mask() hw/virtio: Remove unnecessary 'virtio-access.h' header hw/virtio: Build various target-agnostic objects just once hw/virtio: Make vhost-vdpa.c target-agnostic to build it once include/exec/target_page.h | 2 ++ hw/block/dataplane/virtio-blk.c | 1 - hw/s390x/virtio-ccw.c | 1 - hw/scsi/vhost-scsi.c | 1 - hw/scsi/vhost-user-scsi.c | 1 - hw/scsi/virtio-scsi-dataplane.c | 1 - hw/virtio/vdpa-dev.c | 1 - hw/virtio/vhost-vdpa.c | 17 ++++++++--------- hw/virtio/vhost-vsock-common.c | 2 +- hw/virtio/vhost.c | 1 - hw/virtio/virtio-crypto.c | 1 - hw/virtio/virtio-iommu.c | 4 ++-- hw/virtio/virtio-mem.c | 3 +-- softmmu/physmem.c | 10 ++++++++++ hw/block/dataplane/meson.build | 2 +- hw/scsi/Kconfig | 6 ++++++ hw/scsi/meson.build | 19 ++++++++++++------- hw/virtio/Kconfig | 6 ++++++ hw/virtio/meson.build | 17 ++++++++++------- 19 files changed, 59 insertions(+), 37 deletions(-)