From patchwork Fri Jul 7 15:17:14 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: 1804970 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=Kll5WQn6; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QyH9M5dkgz20b8 for ; Sat, 8 Jul 2023 01:18:46 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qHnDF-0000wh-QJ; Fri, 07 Jul 2023 11:17:37 -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 1qHnDD-0000vW-DB for qemu-devel@nongnu.org; Fri, 07 Jul 2023 11:17:35 -0400 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qHnDA-0000cp-UW for qemu-devel@nongnu.org; Fri, 07 Jul 2023 11:17:34 -0400 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-98377c5d53eso250651466b.0 for ; Fri, 07 Jul 2023 08:17:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688743049; x=1691335049; 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=tEOl601lp/glMFLXL/Pb6sc13gALwOrVo4hgtvYuZtU=; b=Kll5WQn67GmCtCbgfLbz0kZBHaf3DtxlBXW26nBe5Yjus3MKNiDMnx8CBTJwTz1XVi MkjlFtpS+4WOLEXopN/+krO56C/G+3TG6Kf8KY5yK9IU0Q7FQrA1Su/7dMZSpNpfTbIL oFyqjh8H+KbZLKRyVNIHmu3N0m8dKMsd+ZmpqaIoOYKCeOQGoSMgo0DgGDvENd9qfXT/ yQaPHAo19xXg8nQdQCrEPIbFvMlKJVChBeaGLdISqg283RHnIH1njEC9H7/Tl1mGSqr2 8pLqTXWHrc5i08/95Ne2dmYEn2t+kAallPfQIKf4sKPwBoxjp+k2Ax5vECrZovyjQ0PZ bS3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688743049; x=1691335049; 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=tEOl601lp/glMFLXL/Pb6sc13gALwOrVo4hgtvYuZtU=; b=SB5Brh5YPyzi1TpUuU80VNqUhwzPc2kRG6fsFd8tnX0ItwsGxi/zcKgW3WM/bEkj2o AZXbRCD5ulo3Vcts0Keso+RooWHz6I7nF13x3+3laaMspEXXH5Lp+uXRsuHiEEnUyzAh 3Q//xrgsmx8G5EixabnOZTpNCrO7FfmzQVFi6BARJ59KxgIz9Hx9y0TjQZySLgiIIFNz LIxi+DdyEoZJ654uoerWXUTaHqsJFnKLOBSl2s6C1qxUXFAyb0ezfZnh6IPW9HYtP0Kl IzuWNjBlaUPXGeJjpGGNBdznuen8mLHVDNE3IZaBsXLtCcYB98swFHtKODKfeWoW7Eit gsAg== X-Gm-Message-State: ABy/qLaJWPusGbFSQhYkHKo9+8RhSjleON3xF7v9s5gU0Xsk1u+a68GO XM/khgSzKtowdKi+00tlMYlqAMoH0eM+yj4pnwc= X-Google-Smtp-Source: APBJJlGP6v/u5trbYJwUq8PMrtqyY1qkLOLkAcgSly8JkY5S1GCSRyqlg1VQNrgQmSE6AJRBgvZc7Q== X-Received: by 2002:a17:906:57da:b0:98f:ab82:8893 with SMTP id u26-20020a17090657da00b0098fab828893mr3762991ejr.73.1688743049834; Fri, 07 Jul 2023 08:17:29 -0700 (PDT) Received: from m1x-phil.lan ([176.187.215.192]) by smtp.gmail.com with ESMTPSA id t3-20020a170906268300b0098e42bef736sm2322459ejc.176.2023.07.07.08.17.28 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 07 Jul 2023 08:17:29 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Michael S. Tsirkin" , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 1/6] hw/virtio: Propagate page_mask to vhost_vdpa_listener_skipped_section() Date: Fri, 7 Jul 2023 17:17:14 +0200 Message-Id: <20230707151719.70613-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230707151719.70613-1-philmd@linaro.org> References: <20230707151719.70613-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::636; envelope-from=philmd@linaro.org; helo=mail-ej1-x636.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=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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org In order to make vhost-vdpa.c a target-agnostic source unit, we need to remove the TARGET_PAGE_SIZE / TARGET_PAGE_MASK / TARGET_PAGE_ALIGN uses. TARGET_PAGE_SIZE will be replaced by the runtime qemu_target_page_size(). The other ones will be deduced from TARGET_PAGE_SIZE. Since the 3 macros are used in 3 related functions (sharing the same call tree), we'll refactor them to only depend on TARGET_PAGE_SIZE. Having the following call tree: vhost_vdpa_listener_region_del() -> vhost_vdpa_listener_skipped_section() -> vhost_vdpa_section_end() The first step is to propagate TARGET_PAGE_MASK to vhost_vdpa_listener_skipped_section(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/virtio/vhost-vdpa.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index 3c575a9a6e..87653bf841 100644 --- a/hw/virtio/vhost-vdpa.c +++ b/hw/virtio/vhost-vdpa.c @@ -42,7 +42,8 @@ static Int128 vhost_vdpa_section_end(const MemoryRegionSection *section) static bool vhost_vdpa_listener_skipped_section(MemoryRegionSection *section, uint64_t iova_min, - uint64_t iova_max) + uint64_t iova_max, + int page_mask) { Int128 llend; @@ -313,7 +314,7 @@ static void vhost_vdpa_listener_region_add(MemoryListener *listener, int ret; if (vhost_vdpa_listener_skipped_section(section, v->iova_range.first, - v->iova_range.last)) { + v->iova_range.last, TARGET_PAGE_MASK)) { return; } if (memory_region_is_iommu(section->mr)) { @@ -396,7 +397,7 @@ static void vhost_vdpa_listener_region_del(MemoryListener *listener, int ret; if (vhost_vdpa_listener_skipped_section(section, v->iova_range.first, - v->iova_range.last)) { + v->iova_range.last, TARGET_PAGE_MASK)) { return; } if (memory_region_is_iommu(section->mr)) { From patchwork Fri Jul 7 15:17:15 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: 1804972 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=GeS3mrXv; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QyH9M6GK3z242W for ; Sat, 8 Jul 2023 01:18:46 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qHnDI-0000xC-QO; Fri, 07 Jul 2023 11:17:40 -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 1qHnDH-0000wp-31 for qemu-devel@nongnu.org; Fri, 07 Jul 2023 11:17:39 -0400 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qHnDF-0000di-Ih for qemu-devel@nongnu.org; Fri, 07 Jul 2023 11:17:38 -0400 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-992f6d7c7fbso253926666b.3 for ; Fri, 07 Jul 2023 08:17:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688743055; x=1691335055; 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=NLj6fc0nTXSo2Q6ccqQ2bRaAaaNn/Lom3RgmCaoHH/4=; b=GeS3mrXvQSrxuKcn/gQ9cgnPzBIwUn4iInl0fAiL1Y2kEwQJYwJyqEzHQcPJw2JFk+ 79Mq5/zxAyjj+TOMD1dOOSjTGRVjtRvgdXL3AH/ex3B7MWOi9yc9smIDECwB2BilZz0f KQHfODngHJXxg89mtvRjjhG1VFlfSB62allue7aXWXI/7HXIZbGS9YkabpU8IDeB8HR1 G7+yt6UjtRbUoRE/y87PVan4dRlppL0H4Wqo3DJLZPYyKClfnf3QzbqgVLhDCdd7eJXC aCRaJyAjqL9ysym8maOzTbsR8emGYzV3QUnGuh4xC+yhhCX95t0mz8p+NwAfx3eh9RFO XStQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688743055; x=1691335055; 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=NLj6fc0nTXSo2Q6ccqQ2bRaAaaNn/Lom3RgmCaoHH/4=; b=VYSlEViKeYUt/rPO/OM11Wb3ZGBcmmMomLkcY7Y7+n3FNg7nvi+FKEXNQbj98sivQm 98m9Lz+mIHSg6J0wfY0b709E5VXA7g5UJiajxJ7dCG4LHqlLFBekBdrRN+TR9gSL7i3K Gqgfyu45eUXqSPu4Zb5g4WrD7JAFbQNN79L4xAkirkX8Aj2DBJqIXSM0OYL8PtLgFjOo uA3en2w5Evc4C1vpvEXM9Dt9QZVQfaa3g4qThPzrZ83SGIK7OHbzqvzP7zc9G3wbVu02 zZjnYokaOx+8W85Dh8mjBhQYqZniUeKMyHQ5Kl3zPFdWz7bzqUUPUvQvRJV4EOLklefB nxhQ== X-Gm-Message-State: ABy/qLYKNIsJgffanYrNJe8RY3Xgllh2t4Ww2bNx+s3ZU9rdsSPyP0TY 5KEC7PiNUB02qz+N2pcHpz9ynp6iEVPs6P9oeDc= X-Google-Smtp-Source: APBJJlF71bZlpDpGmx9jhWXzN4LtFerc0E0abN3UHQk7sw4hrXZdojOKxppsTFbS6NjzdJSxKtQMzA== X-Received: by 2002:a17:906:51d4:b0:987:16c6:6ff3 with SMTP id v20-20020a17090651d400b0098716c66ff3mr4158318ejk.38.1688743055541; Fri, 07 Jul 2023 08:17:35 -0700 (PDT) Received: from m1x-phil.lan ([176.187.215.192]) by smtp.gmail.com with ESMTPSA id q17-20020a17090622d100b009934855d8f1sm2282355eja.34.2023.07.07.08.17.34 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 07 Jul 2023 08:17:35 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Michael S. Tsirkin" , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 2/6] hw/virtio: Propagate page_mask to vhost_vdpa_section_end() Date: Fri, 7 Jul 2023 17:17:15 +0200 Message-Id: <20230707151719.70613-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230707151719.70613-1-philmd@linaro.org> References: <20230707151719.70613-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=philmd@linaro.org; helo=mail-ej1-x62d.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=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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Propagate TARGET_PAGE_MASK (see the previous commit for rationale). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/virtio/vhost-vdpa.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index 87653bf841..3040bd8ee8 100644 --- a/hw/virtio/vhost-vdpa.c +++ b/hw/virtio/vhost-vdpa.c @@ -31,11 +31,12 @@ * Return one past the end of the end of section. Be careful with uint64_t * conversions! */ -static Int128 vhost_vdpa_section_end(const MemoryRegionSection *section) +static Int128 vhost_vdpa_section_end(const MemoryRegionSection *section, + int page_mask) { Int128 llend = int128_make64(section->offset_within_address_space); llend = int128_add(llend, section->size); - llend = int128_and(llend, int128_exts64(TARGET_PAGE_MASK)); + llend = int128_and(llend, int128_exts64(page_mask)); return llend; } @@ -69,7 +70,7 @@ static bool vhost_vdpa_listener_skipped_section(MemoryRegionSection *section, */ if (!memory_region_is_iommu(section->mr)) { - llend = vhost_vdpa_section_end(section); + llend = vhost_vdpa_section_end(section, page_mask); if (int128_gt(llend, int128_make64(iova_max))) { error_report("RAM section out of device range (max=0x%" PRIx64 ", end addr=0x%" PRIx64 ")", @@ -329,7 +330,7 @@ static void vhost_vdpa_listener_region_add(MemoryListener *listener, } iova = TARGET_PAGE_ALIGN(section->offset_within_address_space); - llend = vhost_vdpa_section_end(section); + llend = vhost_vdpa_section_end(section, TARGET_PAGE_MASK); if (int128_ge(int128_make64(iova), llend)) { return; } @@ -411,7 +412,7 @@ static void vhost_vdpa_listener_region_del(MemoryListener *listener, } iova = TARGET_PAGE_ALIGN(section->offset_within_address_space); - llend = vhost_vdpa_section_end(section); + llend = vhost_vdpa_section_end(section, TARGET_PAGE_MASK); trace_vhost_vdpa_listener_region_del(v, iova, int128_get64(int128_sub(llend, int128_one()))); From patchwork Fri Jul 7 15:17:16 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: 1804975 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=AcsfCN9J; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QyH9g1kdJz20b8 for ; Sat, 8 Jul 2023 01:19:03 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qHnDO-0000xS-AE; Fri, 07 Jul 2023 11:17:46 -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 1qHnDN-0000xK-7S for qemu-devel@nongnu.org; Fri, 07 Jul 2023 11:17:45 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qHnDL-0000fC-Lm for qemu-devel@nongnu.org; Fri, 07 Jul 2023 11:17:44 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-3fbea14706eso22198685e9.2 for ; Fri, 07 Jul 2023 08:17:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688743062; x=1691335062; 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=FzWZerM4O//3gQRZXyrbL/L51wu/EYwT/LPgDLorvzA=; b=AcsfCN9Jy3giqdF6SM/yBl+WEoCs1sgZJeDY2DmidLNBZB+LWto25RZi1Umle/1tGv W9oEILsO/rY9cwhvv4vycdfjQ+j9rOOQNcHaBlEl06F++qH00UkgwqKKdRIYiTE0aGHU wwSJiHdb8BZVV+b0mYS6yG8dUQz40fcMiLz9HP6Bz0EJ2Z+1Tur0riRkicIlXI4naZt4 4WiiChvLr3BED8nNnEVGKipHz4PHMF2hnDWMwKT9yIgmtij/D845VZXSF9opybZOFmNx Xk71CRRDYKk1NYUEocuSs6S2EZ8mfGZ37oggs5dubaDiHkKnjyrvkP/2iLMfFcif8ZEn Dmpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688743062; x=1691335062; 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=FzWZerM4O//3gQRZXyrbL/L51wu/EYwT/LPgDLorvzA=; b=hGO6u0jkgGBHybyuxvKycjxDveuNh/Ks50x4iIca+XFKG6LNZD/uqc1ksnQ230TXbc 6EFrAvRtnk/1sILtXEVnAErr+uw7WpsSC0KdMZDIgodPvD+R2pwZTdMqaraMBKKVPmC7 SNB8qQmfaerqAKb3z5j4mfwk5Z0kL4WXDMoCxyp67QkssiNJbTJwYazTgMeYoTwFjWPm hBC10p6LG/5CxnzIVDmPZYXWRjOjYryQe7EawCtm86bg2i+A3JRw5gSDjZ1BFAoOlYLw Djnt7MT2r0p1C3XPinSNiPvqu0/WFseV4gcPFdZ4nKhujxPmYNQxxhAvmyO5gG1J7l6t LXzQ== X-Gm-Message-State: ABy/qLbDJLyjfX8Uq5LTuNpfvM+jCTxDZtSckXOr/owdnV3zHc1pQObc /x87WkziXtcXOJe9A8FbsxXMpBo3EAkJJOCkJL0= X-Google-Smtp-Source: APBJJlFvBYzZOoO+4Vb5T3MseHbB5ztYELNvjWNVqyn1YGPN59J91eQS9GYBpaKUbB0SRlUUfkMrbg== X-Received: by 2002:a7b:c3d7:0:b0:3fb:a6ee:4cec with SMTP id t23-20020a7bc3d7000000b003fba6ee4cecmr3994034wmj.33.1688743062102; Fri, 07 Jul 2023 08:17:42 -0700 (PDT) Received: from m1x-phil.lan ([176.187.215.192]) by smtp.gmail.com with ESMTPSA id n19-20020a7bc5d3000000b003fbca05faa9sm2740976wmk.24.2023.07.07.08.17.40 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 07 Jul 2023 08:17:41 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Michael S. Tsirkin" , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 3/6] hw/virtio/vhost-vdpa: Inline TARGET_PAGE_ALIGN() macro Date: Fri, 7 Jul 2023 17:17:16 +0200 Message-Id: <20230707151719.70613-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230707151719.70613-1-philmd@linaro.org> References: <20230707151719.70613-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.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=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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Use TARGET_PAGE_SIZE to calculate TARGET_PAGE_ALIGN (see the rationale in previous commits). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/virtio/vhost-vdpa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index 3040bd8ee8..a3dd7c712a 100644 --- a/hw/virtio/vhost-vdpa.c +++ b/hw/virtio/vhost-vdpa.c @@ -329,7 +329,7 @@ static void vhost_vdpa_listener_region_add(MemoryListener *listener, return; } - iova = TARGET_PAGE_ALIGN(section->offset_within_address_space); + iova = ROUND_UP(section->offset_within_address_space, TARGET_PAGE_SIZE); llend = vhost_vdpa_section_end(section, TARGET_PAGE_MASK); if (int128_ge(int128_make64(iova), llend)) { return; @@ -411,7 +411,7 @@ static void vhost_vdpa_listener_region_del(MemoryListener *listener, return; } - iova = TARGET_PAGE_ALIGN(section->offset_within_address_space); + iova = ROUND_UP(section->offset_within_address_space, TARGET_PAGE_SIZE); llend = vhost_vdpa_section_end(section, TARGET_PAGE_MASK); trace_vhost_vdpa_listener_region_del(v, iova, From patchwork Fri Jul 7 15:17:17 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: 1804976 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=NyeQ4dMR; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QyH9r56QCz20b8 for ; Sat, 8 Jul 2023 01:19:12 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qHnDZ-00013z-CA; Fri, 07 Jul 2023 11:17: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 1qHnDY-00013q-OP for qemu-devel@nongnu.org; Fri, 07 Jul 2023 11:17:56 -0400 Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qHnDX-0000h7-3i for qemu-devel@nongnu.org; Fri, 07 Jul 2023 11:17:56 -0400 Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-4f76a0a19d4so3097962e87.2 for ; Fri, 07 Jul 2023 08:17:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688743073; x=1691335073; 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=aWI/6gGfjRPtDVKiMDrKPzVxOvluZG91V1TrcTp6oHQ=; b=NyeQ4dMRbWn/YUkvk1FsWkyAaQkj1jIJpKpJevZmg0hz8vbFHxr03fLrP//b24TBtJ 2XvpeGk2KTosfWJYHsNWsFYFmiNHBnYRPgQLPFEo1Yxa6rBWxl3tNWHld0xe7JZbI0Vh vjWMMhvMvw9u+ecUTaq6NFSh6O2OcGQbx8dU+oixf2xEbYddfjglAHxUGfY5neE/mtGB oIRxsZoj3DxgVPhxMskREaKJx+8mM5cVki54nKtSVrw1GVr40nWENC7lyCjgnFLEqdmA IobAwcpoN7u+lT/bhlqMgrllUOhFvvc1tquRvhX/vd4m4O/5Ij6QGH/rAdSWWIDu9eaQ cBhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688743073; x=1691335073; 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=aWI/6gGfjRPtDVKiMDrKPzVxOvluZG91V1TrcTp6oHQ=; b=V3SN0SUisja6Bz2mDzQa1yGG+sU8cFaSnuhkVsiL7mZLbwoZaHh5w1CJfDqVtWUrOd JuRWAr2nJHmWILQGPZ8JQNNHN0vNSmUkNzNychb/pgI0Ygq/ZlHC9U8As4Opig4AXMWG whM37mqH16XgmA3kbKHuKiAgdjGJAx649vrozSvFEoqPPgS5vIoWR/bh/eRnJVxJDnXj ZJah8CZV/yhfLaO7e++Y62xgmMLZB+Bg43bZGrYP0vpXjoCWGlSraj6TwzGGaKsJdvC9 2ed9ZrfKlSLyPyyrZfep5NoUGbxVry9ZAoPdgSgEXhh/58MjtJtN18ByQIRVymkCITaL uCRw== X-Gm-Message-State: ABy/qLZQFLXJ0dzZqxxeFspU+umlBb4YWq6wEF83JthuHoQ67+WVDyE4 qDChQM+q/N2P06v3vVB5Aez5G1xVJEk2E+528/Y= X-Google-Smtp-Source: APBJJlGHJxu075AuVhC/LwytBXEJU9Mg4Uw7ddwnUhlrMIiQ9cN5C9CMAFmf9ll85hwsS3nIk2zOvQ== X-Received: by 2002:a05:6512:33ce:b0:4f8:5600:9e5e with SMTP id d14-20020a05651233ce00b004f856009e5emr4878565lfg.47.1688743073156; Fri, 07 Jul 2023 08:17:53 -0700 (PDT) Received: from m1x-phil.lan ([176.187.215.192]) by smtp.gmail.com with ESMTPSA id v2-20020a5d6102000000b003144bfbd0b3sm4695435wrt.37.2023.07.07.08.17.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 07 Jul 2023 08:17:52 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Michael S. Tsirkin" , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 4/6] hw/virtio/vhost-vdpa: Use target-agnostic qemu_target_page_mask() Date: Fri, 7 Jul 2023 17:17:17 +0200 Message-Id: <20230707151719.70613-5-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230707151719.70613-1-philmd@linaro.org> References: <20230707151719.70613-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::135; envelope-from=philmd@linaro.org; helo=mail-lf1-x135.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=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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Similarly to commit e414ed2c47 ("virtio-iommu: Use target-agnostic qemu_target_page_mask"), Replace the target-specific TARGET_PAGE_SIZE and TARGET_PAGE_MASK definitions by a call to the runtime qemu_target_page_size() helper which is target agnostic. Signed-off-by: Philippe Mathieu-Daudé --- hw/virtio/vhost-vdpa.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index a3dd7c712a..456a0afe2e 100644 --- a/hw/virtio/vhost-vdpa.c +++ b/hw/virtio/vhost-vdpa.c @@ -14,6 +14,7 @@ #include #include #include +#include "exec/target_page.h" #include "hw/virtio/vhost.h" #include "hw/virtio/vhost-backend.h" #include "hw/virtio/virtio-net.h" @@ -23,7 +24,6 @@ #include "migration/blocker.h" #include "qemu/cutils.h" #include "qemu/main-loop.h" -#include "cpu.h" #include "trace.h" #include "qapi/error.h" @@ -313,9 +313,11 @@ static void vhost_vdpa_listener_region_add(MemoryListener *listener, Int128 llend, llsize; void *vaddr; int ret; + int page_size = qemu_target_page_size(); + int page_mask = page_size - 1; if (vhost_vdpa_listener_skipped_section(section, v->iova_range.first, - v->iova_range.last, TARGET_PAGE_MASK)) { + v->iova_range.last, page_mask)) { return; } if (memory_region_is_iommu(section->mr)) { @@ -323,14 +325,14 @@ static void vhost_vdpa_listener_region_add(MemoryListener *listener, return; } - if (unlikely((section->offset_within_address_space & ~TARGET_PAGE_MASK) != - (section->offset_within_region & ~TARGET_PAGE_MASK))) { + if (unlikely((section->offset_within_address_space & ~page_mask) != + (section->offset_within_region & ~page_mask))) { error_report("%s received unaligned region", __func__); return; } - iova = ROUND_UP(section->offset_within_address_space, TARGET_PAGE_SIZE); - llend = vhost_vdpa_section_end(section, TARGET_PAGE_MASK); + iova = ROUND_UP(section->offset_within_address_space, page_size); + llend = vhost_vdpa_section_end(section, page_mask); if (int128_ge(int128_make64(iova), llend)) { return; } @@ -396,23 +398,25 @@ static void vhost_vdpa_listener_region_del(MemoryListener *listener, hwaddr iova; Int128 llend, llsize; int ret; + int page_size = qemu_target_page_size(); + int page_mask = page_size - 1; if (vhost_vdpa_listener_skipped_section(section, v->iova_range.first, - v->iova_range.last, TARGET_PAGE_MASK)) { + v->iova_range.last, page_mask)) { return; } if (memory_region_is_iommu(section->mr)) { vhost_vdpa_iommu_region_del(listener, section); } - if (unlikely((section->offset_within_address_space & ~TARGET_PAGE_MASK) != - (section->offset_within_region & ~TARGET_PAGE_MASK))) { + if (unlikely((section->offset_within_address_space & ~page_mask) != + (section->offset_within_region & ~page_mask))) { error_report("%s received unaligned region", __func__); return; } - iova = ROUND_UP(section->offset_within_address_space, TARGET_PAGE_SIZE); - llend = vhost_vdpa_section_end(section, TARGET_PAGE_MASK); + iova = ROUND_UP(section->offset_within_address_space, page_size); + llend = vhost_vdpa_section_end(section, page_mask); trace_vhost_vdpa_listener_region_del(v, iova, int128_get64(int128_sub(llend, int128_one()))); From patchwork Fri Jul 7 15:17:18 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: 1804971 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=jlG1mIAb; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QyH9M6fRNz242X for ; Sat, 8 Jul 2023 01:18:46 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qHnDg-00014m-Uv; Fri, 07 Jul 2023 11:18: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 1qHnDe-00014S-ON for qemu-devel@nongnu.org; Fri, 07 Jul 2023 11:18:02 -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 1qHnDd-0000kK-7g for qemu-devel@nongnu.org; Fri, 07 Jul 2023 11:18:02 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-3fbfa811667so9822025e9.1 for ; Fri, 07 Jul 2023 08:18:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688743079; x=1691335079; 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=TVD90IOvXxa9gbrEDa2+is9EMTWQ2Ss4OFWOQoPhb+k=; b=jlG1mIAbb6Amm3EB8v43W3s4wHOWt1Gl8butodOCqp4W2VlLjD5nQJNnH9Iv1ui4fT FprcjY/xPtq5eTLKBKMbOrYgkuFxiD2AtCyU5TWEQ9cr5sGdUPGbr2pLzkZVBJzfZ4Ok NGexL8fKFvNVi1mi68Zdg754bui5lhJDrj0pZ/A3z2vhUkHq/FAEA+OukKRB9lqVwngC BEudfjeR3e5g1CCPYrMQWyBa4RTdDy7MltP3kTCh1wAX3ZBVQ0a3Bdnt07QL9P9fgbUl kyFI/JqVeWByz0juqjNGz7pOH8WhXJZGdrxmKe/xaetYtdOAcix/Kll1nUgbDHxILWRQ 5oOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688743079; x=1691335079; 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=TVD90IOvXxa9gbrEDa2+is9EMTWQ2Ss4OFWOQoPhb+k=; b=ajIGjKHhqLX8tE+W25cOqY3uqTCn27k3xtJnSKsIdViccC83yw6j+zwAkssa0qWeOZ 1C1cXo4nl+0ZVJS4V7VeMv0VEQvHziUrE7wV1uourrKKdbm4imArR4PNBip9K3PjGOw2 guBGJ8JT1UFh27gZxxqoKUdMKh6uKyQt/6hBxqmalsVdfLBj4c+rhQ9PHKL3Ct+A+735 +zx7+xdtpExRUaWo2onXteqPwLYsrpFFsDuzqQOKSmOcbcIbDic6aHW+RS6SQdQwpgTC tM3atfXatoetm7s3Tu5JnWgpWLysN+1F50j45ESQ+njKbR2b5mBWAOBNQ7wkWDcUtGrV Oidw== X-Gm-Message-State: ABy/qLaUsdZ4xIkalCphU7DSqwXaNQ/PWXs9rIr948WGCA/umhjER48R AuZu4cqyHQmC+vUHHIx+iHzOqL8gAJZQpHMbkIw= X-Google-Smtp-Source: APBJJlEGkj3u6Au/U3bRVu8L9i1ZuDIn74V8IR1M+AOwxmeEh1zR8JRuq1NXFvGBtQ26bnaJ3mTOLQ== X-Received: by 2002:a05:600c:4f85:b0:3fb:ebe2:6f5f with SMTP id n5-20020a05600c4f8500b003fbebe26f5fmr5719820wmq.13.1688743079656; Fri, 07 Jul 2023 08:17:59 -0700 (PDT) Received: from m1x-phil.lan ([176.187.215.192]) by smtp.gmail.com with ESMTPSA id y18-20020adfd092000000b0031424950a99sm4691723wrh.81.2023.07.07.08.17.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 07 Jul 2023 08:17:59 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Michael S. Tsirkin" , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 5/6] hw/virtio: Build vhost-vdpa.o once Date: Fri, 7 Jul 2023 17:17:18 +0200 Message-Id: <20230707151719.70613-6-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230707151719.70613-1-philmd@linaro.org> References: <20230707151719.70613-1-philmd@linaro.org> MIME-Version: 1.0 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, T_SCC_BODY_TEXT_LINE=-0.01 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The previous commit removed the dependencies on the target-specific TARGET_PAGE_FOO macros. We can now move vhost-vdpa.c to the 'softmmu_virtio_ss' source set to build it once for all our targets. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/virtio/meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/virtio/meson.build b/hw/virtio/meson.build index f32b22f61b..900864c1be 100644 --- a/hw/virtio/meson.build +++ b/hw/virtio/meson.build @@ -18,7 +18,8 @@ if have_vhost specific_virtio_ss.add(files('vhost-user.c')) endif if have_vhost_vdpa - specific_virtio_ss.add(files('vhost-vdpa.c', 'vhost-shadow-virtqueue.c')) + softmmu_virtio_ss.add(files('vhost-vdpa.c')) + specific_virtio_ss.add(files('vhost-shadow-virtqueue.c')) endif else softmmu_virtio_ss.add(files('vhost-stub.c')) From patchwork Fri Jul 7 15:17:19 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: 1804974 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=orj9IBgs; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QyH9W3RbMz20b8 for ; Sat, 8 Jul 2023 01:18:55 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qHnDr-00017W-MZ; Fri, 07 Jul 2023 11:18:15 -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 1qHnDm-000162-K7 for qemu-devel@nongnu.org; Fri, 07 Jul 2023 11:18:11 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qHnDk-00018v-W0 for qemu-devel@nongnu.org; Fri, 07 Jul 2023 11:18:10 -0400 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-3142860734aso2815524f8f.1 for ; Fri, 07 Jul 2023 08:18:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688743086; x=1691335086; 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=3eSUqNv4lq/ydOH00bjXM5Xy7kEmqRO8+nhmVd9FBts=; b=orj9IBgscswhsa3RkhpS9syWpj9B1QZx8mQTZOhHr6FGxaf9dENanLNQ01JTg+IxXv N2jgXT9oIdnCxFYIj9IK7g+inN7o4FX8NC+S1tpxa2O0FmIhzbeBNdQ+jvEHhLec80Q9 HSNBPWz9a6VQOa2QqI5H1TF790iwup5d8P1uDPj4KJ56dpdnO0bhpTyyHabrmdHZoj7N TfLVZgsDnMTnmSsmlTdnOKRwylLa3wA5sfdjh0qTxBgyLLzYBD5bPkb8sz4QqrI4IJ8g 52s4PegUY4gkGuF/XiIu7z9Sx8harj72K0UhLuNlk1QXLpqbFpf6eug6Mj/H53QyegIQ s1YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688743086; x=1691335086; 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=3eSUqNv4lq/ydOH00bjXM5Xy7kEmqRO8+nhmVd9FBts=; b=X+27ydg/AuFjCQNV3Bd9Fsfotlc2lPIKucy8wkKq3zdA0qsclGLcseh6A6ezWclTpl Z+dmhhFFetulBe3JWQdDCXoJ1wI3lcFYrbW8ZCnRN5UfHBcY5lacP3eOFvRHkZ4Limfl f+jvNaq3mviual0quB9H0g0aN8tE4lPShodDQUeQ0Tk5rlgiXygdMa7k5AF1Q8sm9z01 ZRkXRbpUDlF3/Dqw/SnMyup0DhdA6aI46F6FecWQ2J4+SVDR9vhfyoSY+BBWSIlIz1JI TjewU0U4X1rJXTLCBTdKHIQspzQHFQl4JX79Asg9cq3RUgBuq1B/7ATP2/ymwnwjPm08 6yWQ== X-Gm-Message-State: ABy/qLaXxbECNJQ3zVe4MHmCwxV36hrqlB5XbitqVdipefazTwC6COzE 5qQxe/evkMJupzYpV+gv4HmVRb2BLzTzcI1GzZg= X-Google-Smtp-Source: APBJJlHOXQl+pNXppt6SkzuXnsbnrm0ndWT0c3/d7wiN3I5/LmH1A6nzmqTpFgnX8m4a2KmFAKXYXQ== X-Received: by 2002:a5d:4703:0:b0:314:3e96:bd7e with SMTP id y3-20020a5d4703000000b003143e96bd7emr8404254wrq.4.1688743086679; Fri, 07 Jul 2023 08:18:06 -0700 (PDT) Received: from m1x-phil.lan ([176.187.215.192]) by smtp.gmail.com with ESMTPSA id q15-20020a7bce8f000000b003fbe791a0e8sm2807368wmj.0.2023.07.07.08.18.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 07 Jul 2023 08:18:06 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Michael S. Tsirkin" , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 6/6] hw/virtio/meson: Rename softmmu_virtio_ss[] -> system_virtio_ss[] Date: Fri, 7 Jul 2023 17:17:19 +0200 Message-Id: <20230707151719.70613-7-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230707151719.70613-1-philmd@linaro.org> References: <20230707151719.70613-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=philmd@linaro.org; helo=mail-wr1-x42f.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=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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Similarly to commit de6cd7599b ("meson: Replace softmmu_ss -> system_ss"), rename the virtio source set common to all system emulation as 'system_virtio_ss[]'. This is clearer because softmmu can be used for user emulation. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/virtio/meson.build | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/hw/virtio/meson.build b/hw/virtio/meson.build index 900864c1be..7a36eabb39 100644 --- a/hw/virtio/meson.build +++ b/hw/virtio/meson.build @@ -1,28 +1,28 @@ -softmmu_virtio_ss = ss.source_set() -softmmu_virtio_ss.add(files('virtio-bus.c')) -softmmu_virtio_ss.add(when: 'CONFIG_VIRTIO_PCI', if_true: files('virtio-pci.c')) -softmmu_virtio_ss.add(when: 'CONFIG_VIRTIO_MMIO', if_true: files('virtio-mmio.c')) -softmmu_virtio_ss.add(when: 'CONFIG_VIRTIO_CRYPTO', if_true: files('virtio-crypto.c')) -softmmu_virtio_ss.add(when: 'CONFIG_VHOST_VSOCK_COMMON', if_true: files('vhost-vsock-common.c')) -softmmu_virtio_ss.add(when: 'CONFIG_VIRTIO_IOMMU', if_true: files('virtio-iommu.c')) -softmmu_virtio_ss.add(when: 'CONFIG_VHOST_VDPA_DEV', if_true: files('vdpa-dev.c')) +system_virtio_ss = ss.source_set() +system_virtio_ss.add(files('virtio-bus.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-mmio.c')) +system_virtio_ss.add(when: 'CONFIG_VIRTIO_CRYPTO', if_true: files('virtio-crypto.c')) +system_virtio_ss.add(when: 'CONFIG_VHOST_VSOCK_COMMON', if_true: files('vhost-vsock-common.c')) +system_virtio_ss.add(when: 'CONFIG_VIRTIO_IOMMU', if_true: files('virtio-iommu.c')) +system_virtio_ss.add(when: 'CONFIG_VHOST_VDPA_DEV', if_true: files('vdpa-dev.c')) specific_virtio_ss = ss.source_set() specific_virtio_ss.add(files('virtio.c')) specific_virtio_ss.add(files('virtio-config-io.c', 'virtio-qmp.c')) if have_vhost - softmmu_virtio_ss.add(files('vhost.c')) + system_virtio_ss.add(files('vhost.c')) specific_virtio_ss.add(files('vhost-backend.c', 'vhost-iova-tree.c')) if have_vhost_user specific_virtio_ss.add(files('vhost-user.c')) endif if have_vhost_vdpa - softmmu_virtio_ss.add(files('vhost-vdpa.c')) + system_virtio_ss.add(files('vhost-vdpa.c')) specific_virtio_ss.add(files('vhost-shadow-virtqueue.c')) endif else - softmmu_virtio_ss.add(files('vhost-stub.c')) + system_virtio_ss.add(files('vhost-stub.c')) endif specific_virtio_ss.add(when: 'CONFIG_VIRTIO_BALLOON', if_true: files('virtio-balloon.c')) @@ -65,7 +65,7 @@ virtio_pci_ss.add(when: 'CONFIG_VHOST_VDPA_DEV', if_true: files('vdpa-dev-pci.c' specific_virtio_ss.add_all(when: 'CONFIG_VIRTIO_PCI', if_true: virtio_pci_ss) -system_ss.add_all(when: 'CONFIG_VIRTIO', if_true: softmmu_virtio_ss) +system_ss.add_all(when: 'CONFIG_VIRTIO', if_true: system_virtio_ss) system_ss.add(when: 'CONFIG_VIRTIO', if_false: files('vhost-stub.c')) system_ss.add(when: 'CONFIG_VIRTIO', if_false: files('virtio-stub.c')) system_ss.add(when: 'CONFIG_ALL', if_true: files('vhost-stub.c'))