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,