From patchwork Wed Oct 4 08:43:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1843096 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ULDnp/nM; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 4S0pBL6z6xz1yng for ; Wed, 4 Oct 2023 19:43:38 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qnxTf-0002EF-6W; Wed, 04 Oct 2023 04:43:31 -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 1qnxTd-000297-CH for qemu-devel@nongnu.org; Wed, 04 Oct 2023 04:43:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qnxTb-0000tj-Pb for qemu-devel@nongnu.org; Wed, 04 Oct 2023 04:43:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696409007; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=g3XainUJVMKa+Hs4fQFDx+vYokCoMuU5n+RMYZYnWdU=; b=ULDnp/nMFRk6/GV6rKWGkUa2Oj1bJ9fgObvejX03mK7qnecIT1UXzLD+c0Pr4vodQL7yqD kU3YmNyHqvIPuofuab3jv2rzqMMbUH+qbuf53MDK5fdpRVWUQh1x9b58q7LRwKazJtoexu RlezH9wXA6R9yIpmOBo9uyr5wOOOLCA= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-596-5GByD0ClNg-yF6gpiFvsQw-1; Wed, 04 Oct 2023 04:43:25 -0400 X-MC-Unique: 5GByD0ClNg-yF6gpiFvsQw-1 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-3231f43fc5eso1406070f8f.2 for ; Wed, 04 Oct 2023 01:43:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696409004; x=1697013804; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=g3XainUJVMKa+Hs4fQFDx+vYokCoMuU5n+RMYZYnWdU=; b=u1pRs4eIE/6/En4TvSyt1QDNTPQIchtdsILgMX1siIaCGXs9LIRrHypjj0yuxBWYrl 4tytiSHeeY46eCJ2blUKwJqbgPjbJuxX0PzOgBjMbQRY+tuH8UQ79Cp3OmGKDyIhxuUH BvcSyTt/btMtU1ME3hANHzoSKlcMW1bxDOX/PpG9ufLCsJLLojGFJeE4xd3NQ8dZqEZh ESzxYxXW9BczPHRmdaT7TG+ssRk9fdN8EivoUPuL1fU/x++lenefj56m//n3Qxqd0NUD WjANpbaDfbBvesehEJ7bh4+JTS/9GI30Gx1v+BYDitTl8/S7EA9NEqfdgS0of5CfCbfJ My3A== X-Gm-Message-State: AOJu0YyPyi+Vc2wJMKYvFs8X+fe22C/JeElbWEZ4FoKotLZwkHnze4OS WN817LoiXIFE3zyBfwrafbdWl+ZqyN4whjOV0a90VlWXTyYlPbX9WjBVJYjcTspFdG7WT7QCyjH dnZGWmuSwRDeT3+vjnFzofDQWlT13Yh8j8j3cIBFExAerfjlbVCORwA2w2wCUPDAWNvn/ X-Received: by 2002:a5d:654d:0:b0:322:5251:d798 with SMTP id z13-20020a5d654d000000b003225251d798mr1287098wrv.70.1696409004184; Wed, 04 Oct 2023 01:43:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFMx7uZIJUKsjozHyD7xpXezcSD4e6GIbSNdhP0jcVS4GLNRd+msRoPiYt3ZBDQ7WMqK13vYQ== X-Received: by 2002:a5d:654d:0:b0:322:5251:d798 with SMTP id z13-20020a5d654d000000b003225251d798mr1287084wrv.70.1696409003794; Wed, 04 Oct 2023 01:43:23 -0700 (PDT) Received: from redhat.com ([2.52.137.96]) by smtp.gmail.com with ESMTPSA id f16-20020adff590000000b0032326908972sm3440984wro.17.2023.10.04.01.43.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 01:43:23 -0700 (PDT) Date: Wed, 4 Oct 2023 04:43:21 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Philippe =?utf-8?q?Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , Richard Henderson Subject: [PULL 04/63] hw/virtio/vhost-vdpa: Inline TARGET_PAGE_ALIGN() macro Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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 From: Philippe Mathieu-Daudé 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 Message-Id: <20230710094931.84402-4-philmd@linaro.org> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- 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 3ab0dc0b5b..0e0ed6d7ac 100644 --- a/hw/virtio/vhost-vdpa.c +++ b/hw/virtio/vhost-vdpa.c @@ -331,7 +331,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; @@ -415,7 +415,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,