From patchwork Mon Jul 10 09:49:28 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: 701008 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp5079299wrs; Mon, 10 Jul 2023 02:51:12 -0700 (PDT) X-Google-Smtp-Source: APBJJlHbBpG0DY36K6DZVxux9sLSlxmKGQym+QSWxIzKEbhWfGd+2X9KV4h/6t9YtsRQVg02Tf1A X-Received: by 2002:a0c:dc84:0:b0:623:6b1a:c5f1 with SMTP id n4-20020a0cdc84000000b006236b1ac5f1mr11633746qvk.4.1688982672502; Mon, 10 Jul 2023 02:51:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688982672; cv=none; d=google.com; s=arc-20160816; b=jFWnJb1+p9otKaV/r0YYkrk7Z7puFyVawxmOlUCEBE5icsCg6rJ+2btnkhnZIfQHNV kLQEyxX3RjFls7NymweDXDJ4OA8X6BaF3Tzxo7XVliD0aIJRjT/o56MhOLQTKdytwe0i yLNzAApNW2acHF8rMuMs9edaHdJQ/MhnL3pmv//R/Jk4GPv7k3iAlz7VBQ7SCI5sRZW5 QAn3x0v9SbfZsBqA9JAOE7EZUuBYoPFVSuPpF9Dnt2mWv39U8sYTwA2AH3wK15bpdPMJ VyK7SfBApylIhp3gmJd6d0n5p/mX3Wbz/yzaFYAqYx0MWoIaN6c8rfZzkqajo+59tvrS k3/Q== 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=opfO9q/dSVfV5cAvnirB68cIre+ympAxvZtAmrt5FgM=; fh=FilpW137HyWOg2zjOJR+HkXqOM9xEmodh7UtIP57FfE=; b=UJistlVVNOz8ytlcz9TrXTImN7E2vDZyIb6V+6AJaxPYThpFVV3XjZMNS25t/PFoPn rmeJahxjPwKjIsy/2W9DQSR4BUIS3Jei+t+ly5n1J5nO4uHaHjt5Rvo5MnR/0TzibEgj PGl5PWoc3A88lc3H2zIZa4yae1iybPf+PY1XPw7jRAfAayI8YsNL/812vnaGxtG1iil+ a7DluDLghPua84DDkvhCvoP0+F/7EKEE+pzwvbjKaNhw6eyi8mOnhfKnCl3Rb/NXa+SD T1LvVPBf465vFt6IQH/5IozBfkVWlIZES7BQjPpYDNxPEgdxLrLU8YYu7nGkOc9piHYM TPiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FoGO98yW; 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 l12-20020a0ce50c000000b0063660b51442si5426119qvm.355.2023.07.10.02.51.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Jul 2023 02:51:12 -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=FoGO98yW; 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 1qInXw-0004I9-Hn; Mon, 10 Jul 2023 05:51:08 -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 1qInXu-0004BD-RD for qemu-devel@nongnu.org; Mon, 10 Jul 2023 05:51:06 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qInXt-00043L-BI for qemu-devel@nongnu.org; Mon, 10 Jul 2023 05:51:06 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-3fbd33a57b6so55139015e9.2 for ; Mon, 10 Jul 2023 02:51:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688982664; x=1691574664; 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=opfO9q/dSVfV5cAvnirB68cIre+ympAxvZtAmrt5FgM=; b=FoGO98yWBxpOqMAqpVEt/T49YC7q5XckNGh60YZcPopoEP1Ht7bMsJjwOkXb/6m/2L b5mV07/xWIC4tNm7Ssg35suGEJ5NKRFkc3pEUn7fyPuYCZVt1fF+rLthkNFXYWhaEvim 6/7dxETS6rAhdvDWdAHz8prBKGUdRyrP9v45kCMMxmkvgEvNouvvLEHNxMGzqZFws6w/ 45G/BRPxJ/kjTc5QOguyuw5zydk9mVVTn/ga22HNiqYAlWE/NfUUKhNg+UN9rSodMinG mHleVeT/yGBH6n9Zd4beEibW6dwxW9IR1KchTh8FxJjbvGzcbLjibt9Fc9YW+TIdeMvW 8hig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688982664; x=1691574664; 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=opfO9q/dSVfV5cAvnirB68cIre+ympAxvZtAmrt5FgM=; b=fAgSowfeUG3h5iNigwsVWbQavqgfrdcjjduL+2C5WFtgFlzZqf5gt5BzvVT11dFl2M 8ujesQC9Ydy+lFvKE4TG6B34gE8dJJ8MrURRmuhQ07+nfF6DqtDJZXfm/DvWb/6T0/qv vo31xW/Pa0h5BjtTak/Iy+qZ8Y9awtKJyhg2LWBHsQyeQgdBb1m1ZNvSNAV6TrPlEod7 U2+e3T8Jvc464c8b9i5x9Wg1Wk6bFbEXq39qBT+1nI5bEdp1TyBff+rhic5Z1u4HcOls 6mv2JHfwn2TI6tJHcZvwxoowW+HAfAJVjO4H3cHiR6mba2qlU3ZSz4aa8kp0rWkeOFlQ +nbw== X-Gm-Message-State: ABy/qLZnHFb0d+YhH6KTGnWjOM49xQBulAk+noNLCtHJIOjRoe/T9fwz 2jRe37i9fh0qZ6U+XSqx/+GZSnGdkRBbtpYRoGb0MQ== X-Received: by 2002:a05:600c:2105:b0:3fc:3e1:7105 with SMTP id u5-20020a05600c210500b003fc03e17105mr8628759wml.24.1688982663754; Mon, 10 Jul 2023 02:51:03 -0700 (PDT) Received: from localhost.localdomain (70.red-88-28-30.dynamicip.rima-tde.net. [88.28.30.70]) by smtp.gmail.com with ESMTPSA id q5-20020a1ce905000000b003fbc9d178a8sm9919839wmc.4.2023.07.10.02.50.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 10 Jul 2023 02:51:03 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , Richard Henderson , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v3 3/6] hw/virtio/vhost-vdpa: Inline TARGET_PAGE_ALIGN() macro Date: Mon, 10 Jul 2023 11:49:28 +0200 Message-Id: <20230710094931.84402-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230710094931.84402-1-philmd@linaro.org> References: <20230710094931.84402-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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,