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: 700031 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp3929284wrs; Fri, 7 Jul 2023 08:18:44 -0700 (PDT) X-Google-Smtp-Source: APBJJlEn73AK0+8Jj3sB3ki8/9J7+7lI08XWsCbiCKTGloAcwUrfIV/mEbtSmY0c0k5+PsNtCXjP X-Received: by 2002:a05:620a:2485:b0:767:2412:f269 with SMTP id i5-20020a05620a248500b007672412f269mr5934168qkn.61.1688743124674; Fri, 07 Jul 2023 08:18:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688743124; cv=none; d=google.com; s=arc-20160816; b=NNH2Pxd9TjAW+Lf7eKymQ7GtgQgMT/+bZNW8seEbs4g8sTL+XZH845zwItQZ3k24uh cMYy4p2X+phXq0Q9QiAxCRPsTK00aNbpB0AGkJO58A7nYthxHjvyMmtS8rkd9KqdvVGh 5qYfpVsGFWOK5BYqOV5biWP8kQi885HEN7bGqqOUzCcMjn0e/MyHikFTzCuIL+hpS/wx wL9hiuPNw+1DhYpS3wZz9Ba9EF1CwXNWoh9kpqtR/PXJaw2QGqoXGOBRmKsuRYSEC4M0 z/Z5CrSKLMavRKkEwIZUiZfF32WUBHbYjO3nDZz+VCJO7jV+Xo6LzMwW9/RD+VVCTBwA +rWg== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=tEOl601lp/glMFLXL/Pb6sc13gALwOrVo4hgtvYuZtU=; fh=aRxBrgA7CrSouwdXoZUw1AmyeDG9xQchBaflhNgNTHQ=; b=RcbNBsaPOQcAWOASXHZeQoEB1ceVHhzJ6ycaTHYeSosdVzzUV0h/NgNZx9hj31EKmA gNRWyJ6RSfPs9tQ05Y/3bgQTaAK+TNJrqn7eitkYe982EFjy6pAjdGk17gu+zNfRWKA0 C3IPInnZzyme3ctVMAOWUkm8CkmeE3Bp9GDPWJMz8v+GKVnd2CAM5X8Hb+HYjgB3IB7E lxyy2NcVlAsZ8JWqwm3lcPmE3OR72MrEBHMeIDaUNnrYThKGvdLcPoBeaIeeopoJRr4u 26srJUUZgp0tIGgEEhs6Lmpt2yM2eRxcnuQpPDrhfr5R214wClwpuc+BScllVDMJl9ok R3dA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Kll5WQn6; 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 u6-20020a05620a454600b00767bad28805si48915qkp.667.2023.07.07.08.18.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Jul 2023 08:18:44 -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=Kll5WQn6; 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 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 700030 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp3929283wrs; Fri, 7 Jul 2023 08:18:44 -0700 (PDT) X-Google-Smtp-Source: APBJJlGLnUEak0GPNFnjcvHsh5X/u8qi9yp/QgwyrDGVtkdOpQYoPhBq1MunYUCmBLS3xtYyINaQ X-Received: by 2002:a05:620a:8ecb:b0:767:7d99:650 with SMTP id rg11-20020a05620a8ecb00b007677d990650mr4382956qkn.65.1688743124617; Fri, 07 Jul 2023 08:18:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688743124; cv=none; d=google.com; s=arc-20160816; b=PkpltcOcZUld2QT36yQDxx1XKZSAM14qGDlUoEs5OI3zI5IpumURnsSLak01Qy/Guq 4v4Zp/LdcBFIlO6L/k3tj54/FrI1KcHkdRAEzTOib/wNjWeNVhHCTyTId1eLxc9JXplh RCo9LQQpAEuqgZFS8ep9e+7X3kW1meKGAzKtG0HHKm4VUaIeh34k2jgFapr5TJ2csQd4 8arJ/wejvSoGnwBCCEmD2lm27QvvMAYWheGRTueBrATazSKcoG37+dq2VPb6WNZE29PC OVYY3IvxDwn890Wo7CzKeYFaDh8H07wTHnz1m1ym5/lFM/2BvNTD2+UN0PFF8ida3Ayd wdqw== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=NLj6fc0nTXSo2Q6ccqQ2bRaAaaNn/Lom3RgmCaoHH/4=; fh=aRxBrgA7CrSouwdXoZUw1AmyeDG9xQchBaflhNgNTHQ=; b=ZhEy//nh7rsN2Hi4krISGW1OATBCTiMq63WBFvXDzDApoGB2museuGkUxkB+7GqL5O Gz9cMaqkwTXV5cu/b8cbo3INlikWryLmd8xLPIGGYIRpMQM///Q48Jt/zEOMBiYlBIAa 8hCGF2uFXSffyifP0Sk74tg6HyOvZ336LCtg/f8kj6hp1LYYkFTBvyTRkGWCBY6OWbEg D9jIVzfWq5NUxowES82L6ck51X+cy30Za0KJh2/ON8XMA8+xv+Ghq2XeUSzPg3YtCEx+ KXHIi2MDHeInGEOJ3vYmLdtuLewx+sRWaaVOmSxhH8JVkeSUEefgvqpIngVG1nNX8P7d t1EQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GeS3mrXv; 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 i8-20020a05620a404800b00767c39eb69asi16682qko.615.2023.07.07.08.18.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Jul 2023 08:18:44 -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=GeS3mrXv; 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 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 700034 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp3929439wrs; Fri, 7 Jul 2023 08:19:02 -0700 (PDT) X-Google-Smtp-Source: APBJJlFr7dkQRzA8v7jkdMVq4rpORFC8nwPRC0TC+zNzC44gbTSyRlZT/X/azHpdXB/x2PjL53Xj X-Received: by 2002:a67:db89:0:b0:443:5cbc:82f9 with SMTP id f9-20020a67db89000000b004435cbc82f9mr2232100vsk.31.1688743141763; Fri, 07 Jul 2023 08:19:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688743141; cv=none; d=google.com; s=arc-20160816; b=gmdl4OZEvnfox/bjBUMa0jFORnn2frZm6DVIO0vhOxGYCqJhbTETgcqSP6j+EagVGC 3zn86KDNCrIC3hDoUidoCU5ZmUGaCZ+wZ1fYLtq5I+esNNQwM3yT3tx26JKg6BLhByv0 qOlncgoLyalrr9ottYwg5LHmfyGU8sQLLZheYUhAMb1veyUcoTXth6pwOuWJAMlMlALp 47VKfIz9vGSadCG+gVFvIscDZTnnaYUMwqFlYxjESyeutNhD0KFlp6Z4+zJ/77NAhdge teI1QeQzwrg4ncbMs55xn7EIdZHc8nD5ZU+S9Er5TU3h6xTBYEDMZrosAVcKcgXdH1LT AJXA== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=FzWZerM4O//3gQRZXyrbL/L51wu/EYwT/LPgDLorvzA=; fh=aRxBrgA7CrSouwdXoZUw1AmyeDG9xQchBaflhNgNTHQ=; b=HE/WLYE97OhbBY8atY+Zv0OZLXjX1xw/DDMqRbgHw5is5/uTpl/A88usRLmOHE0LZ4 Gzrxtq362ak36D9HDRPAkO6hWuBuSAN86GtrcNQSwn+J9oWtO3J5t/z8+357IEsYYsGL OoqiEDWfDqZfyENchM/Yvf8gRatH2T/Z7liv96NGE1QBauy8mAt7n/F8YmDUp7Ltm6sN GUheQ7G8gCcGYT9M2wA/ulynI5rUu1ZEvw30XD5BERxPHUqGtLx0INsGHxX96vnRguwZ T2TVH29RRFkwEYqiXABLPuzDNif9tKD2yjtVsGS3UKKvGCLe7ob/0WoxDPfqiB2EIiDQ oCWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AcsfCN9J; 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 x10-20020a0ce24a000000b00628519b824asi2762823qvl.382.2023.07.07.08.19.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Jul 2023 08:19:01 -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=AcsfCN9J; 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 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 700035 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp3929498wrs; Fri, 7 Jul 2023 08:19:11 -0700 (PDT) X-Google-Smtp-Source: APBJJlEuT0bCJJWPfdiWAFErCqKF1Eqmv/eBMhKzFUys8Gp5SQ+9wygBKwsok5gX1BAN58NIk0Yu X-Received: by 2002:a81:83c2:0:b0:579:dd41:468e with SMTP id t185-20020a8183c2000000b00579dd41468emr5419900ywf.22.1688743151267; Fri, 07 Jul 2023 08:19:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688743151; cv=none; d=google.com; s=arc-20160816; b=UzeCoiwyEl8G7kBDwaHA1aqJy258D9hEHssYvWR+CpLtayQ1TAogwEURiEXHkXKTaj OFaNpNrdlkLLnCl03vJjEzHPGMSwqxoQMmWERO9XHGm71oYWYni8QAhejsq7J/fO/IRz Ngbd3uBVIIbPuW1CR8gP64L3Hu7lMW4IHmvOcig5Fmpmgd8b+/IxjP3M8koWUAX4eJo1 OHbSSlYUwgwZQuT+yckp1DCPeZj6BxM4JMUzzkW161pBxVfKlquS7EWzBnNUPyUbsCad vqQKzrFEcnFUKy6+1zbFEjIDuGJV2d/xHApnODRb3v/EajnBOKBkOfx/yPBGH2OxnvHw Eanw== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=aWI/6gGfjRPtDVKiMDrKPzVxOvluZG91V1TrcTp6oHQ=; fh=aRxBrgA7CrSouwdXoZUw1AmyeDG9xQchBaflhNgNTHQ=; b=Lr2dJEjWU6db7NIYLxE+cqCdSdFHoP4rrwBWObC/fvoHYUI8SjAVeHxuK+wNsjg/PZ Qs2xGW7MUUSv8ONcXe3jRXVwVV1Olm76MaRUN4Mr8juSJJKqxC/12g0eyDda8ZxHKsA9 q+KR+cMhvk1EmddHKP4zJW5g4BCWKPpom3Zaz2QCoqCHiUqEJXOBK5uMuyDO8LYbf0Tz QoFGiXKEcOnmJr2fCEXPjGI3qJaU2MbHaY3lpB4ErapbZDlumv3fJIeu5vNqBjNMYhWU f4opjKIwIzCdqGHEH6PleqpH65T+dJ5hPQbVmFngIi0y7mfX2yU0Zu/dK8DJcGdO+pXV B6/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NyeQ4dMR; 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 s20-20020a05622a019400b003f8b05ee732si2628675qtw.375.2023.07.07.08.19.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Jul 2023 08:19:11 -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=NyeQ4dMR; 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 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 700032 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp3929285wrs; Fri, 7 Jul 2023 08:18:45 -0700 (PDT) X-Google-Smtp-Source: APBJJlFjq6Rey4U5GqWsFDFa1Cw4mTdZA1kWazC9SRA9BxPK6nhZ4UwTVBOodE+rPzA/qOweZAgv X-Received: by 2002:a0c:e345:0:b0:636:64e8:a3a6 with SMTP id a5-20020a0ce345000000b0063664e8a3a6mr4769349qvm.62.1688743124908; Fri, 07 Jul 2023 08:18:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688743124; cv=none; d=google.com; s=arc-20160816; b=PrNOyhgVwQ6BTLlGgTzB9wmi7l49cqTq1NcYPde7M790PzfcpVbccsmpSM8NrbJvjX QCilVUBWNNR4coa8VXWVLy/FTtgT4/n9HPbLOvdXaQnnZB8iOcqlPB0jZUcCg959mIJI o7F7o4aHu3ODyMMmShMKkiUG9x7uU8M/cKrz4ZoHL/RmzMIYB3iCcahN4mclYJdKSsRP AhImDgvBs1WEdgIQY0KgzoDLK8ZF1wGlBHFeY6jTr6oLX807gxpyMpqqfHa/zWD2MGPT u6wvVzLdDfMN68XNRRy7IT0vhAfubURKaoqLayUS1KFOJjvboPRlfZ5pIVybMTZ2sCnO lELQ== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TVD90IOvXxa9gbrEDa2+is9EMTWQ2Ss4OFWOQoPhb+k=; fh=aRxBrgA7CrSouwdXoZUw1AmyeDG9xQchBaflhNgNTHQ=; b=MgQW45W2De7OmnZgkh5vpOMZSPos0NTWA4Nt/FiAmjcCE5H3wANgfkd05lrShDnI8r 8lORklUcMJXBAThd9LVVCIzP2IZR0PTet5+zUTvnn4FipxpR3xJp+cFhNqEbPaRa7yIi bl1IuxbeFb9Kcr1dR+z7hhdDb+su+b8G4UshQWee72uG1WDNEe2K9nZn064ah9MS1m4P G4iAjAVEFT1EC4K8KUY5fYqnwBkjGuPbvzLWHLY6Bu2cEQNuG5hk7WuE1Amer2CooXsT BF5wRn9DanDOknxmwdBCh8HGA3BrPAa1d/tu9i6LWEOWr0lIB+RXvAgzy2Zh2T+6Vfie 7WGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jlG1mIAb; 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 d14-20020a0cb2ce000000b006262e4d428asi2634078qvf.191.2023.07.07.08.18.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Jul 2023 08:18:44 -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=jlG1mIAb; 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 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 700033 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp3929382wrs; Fri, 7 Jul 2023 08:18:54 -0700 (PDT) X-Google-Smtp-Source: APBJJlEID7gFJKdfO0AfQQshuzIAFSwUT+D8/EdOuSvZejE3rv7cVH61hSsvQGygoaLgG82byHoe X-Received: by 2002:a05:622a:148d:b0:403:9cfa:2dcc with SMTP id t13-20020a05622a148d00b004039cfa2dccmr1628755qtx.42.1688743134405; Fri, 07 Jul 2023 08:18:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688743134; cv=none; d=google.com; s=arc-20160816; b=WtdKgaXP731nKpCEbfLNviexXCTZV6bjI2zelj91eReXH9MD15A1JpXdReW1XHU1il hcJYALAgheZPXlwTfDnBkh3HG/x10mzYtfp584R7S+uDZ72ZTNepORsLdFW4p+yAdvTv 0Jx6TtunRY8a7BFtssmLCWeacapc8AfPenKDE0qmrtcRFY6fSBwPS6fHnQxLFwpani1s iuKhSCLcq+wx/QCvNfawv2o4jSe4z6PEMWz574TRbwGt6SapUYdcYwmTAKs2Khj2d28S jZMDbjI20AL/068l9pppKh2Qs4ECOATdR/l2Hjd+4Hn+o/fIx4lknU3w4OPMkw5meaDY aneQ== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3eSUqNv4lq/ydOH00bjXM5Xy7kEmqRO8+nhmVd9FBts=; fh=aRxBrgA7CrSouwdXoZUw1AmyeDG9xQchBaflhNgNTHQ=; b=micJvCFfjeKhPsOwPFUISCbmjq/cr+oyrCSqTT1p8Hlo61g3AwAqDd7z5tUXVa03/K K7CKXBxAKOC9Vy+ihKasooYRrM4JEFji3isJ2S8r4ToRdSqyB/2s4Bg8tZY0OTvFiczZ 2PLtiNhRs3ZtM/WB3edGzlyKlmzIlHqilaguT2vPhTZ7rElhm+LVjGeIqCvEgExuUWwR MtNCD2B+UOsxFg9M2njtV+6E2YN2/t4UNsof3cuk8//HHNs7MIjWOICyocmwch0EHQ7V TSVY8eNMCQNOKw0wDT8X0c4TD6eZGLYDPEQJicp8L/k4Mj1AYJBj8GaLymu+1CKltsSr P5xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=orj9IBgs; 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 d18-20020ac85d92000000b004034ce9a8b1si2768467qtx.153.2023.07.07.08.18.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Jul 2023 08:18:54 -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=orj9IBgs; 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 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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'))