From nobody Mon Feb 9 00:38:51 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1654716337; cv=none; d=zohomail.com; s=zohoarc; b=LbF3t5HGKEa4/mEtGaeeZpdwmgpdnTtlZBqR6A0G0yPLAO54dO9Z4SmXmYfuKgdJMstbjLSYIggtakzQA3yb0ZPb2tnCT/smLBcW7rTP1yFNWF/QOERsVacoJhwI0UaW6KZxErUlVkrIEGCBWy9oXbmFKPu+JgrhKnVFyVLOjpw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654716337; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ZmOX2TYVZx+LQoPB1+OfmQTMvrMRdEFqIly6KfSjrmc=; b=Ala2ZFP+sUZ01d3BniZZnltk7MyKFg8gFprHhXN9ywmiYK4KbUT3B0vTzbMNWcbBaUhIGcDORE9q/DnYAguCbLkR95NL3G6kWYHljciSF3GPCr7NE1mgNVCTggLzbKxCrGhZ8hESiUAZnxPxNXDVt1AVNKeeKVRiK4TGdjRmcIQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1654716337816926.669428511261; Wed, 8 Jun 2022 12:25:37 -0700 (PDT) Received: from localhost ([::1]:54056 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nz1J9-00022L-Vq for importer@patchew.org; Wed, 08 Jun 2022 15:25:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39106) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nz1HN-0000P6-LV for qemu-devel@nongnu.org; Wed, 08 Jun 2022 15:23:45 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:58970) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nz1HL-0006Z6-Rc for qemu-devel@nongnu.org; Wed, 08 Jun 2022 15:23:45 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-144-pF4OKHcqP3CO3iA3DbdjRA-1; Wed, 08 Jun 2022 15:23:41 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9F31438149AB for ; Wed, 8 Jun 2022 19:23:41 +0000 (UTC) Received: from [172.30.41.16] (unknown [10.22.35.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id 576801731B; Wed, 8 Jun 2022 19:23:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654716222; 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=ZmOX2TYVZx+LQoPB1+OfmQTMvrMRdEFqIly6KfSjrmc=; b=DYFj2NYWySYHktczQp3szjGU4gNlYIiuVsbeNCW/x1Woq9Yg9TlFBU+kyLob0E0LFHTQdD 2JAwWmYxK7oAspTZC4Ky0lDfjENdNC70PS2S/04IAuL9fwL23W1wXvBtT4hTOBhYCLhOf0 MyoYQuWkB9Uhz4zQ8mtBQmQRli4qSWc= X-MC-Unique: pF4OKHcqP3CO3iA3DbdjRA-1 Subject: [PULL 1/1] vfio/common: remove spurious warning on vfio_listener_region_del From: Alex Williamson To: qemu-devel@nongnu.org, alex.williamson@redhat.com Cc: eric.auger@redhat.com Date: Wed, 08 Jun 2022 13:23:41 -0600 Message-ID: <165471620962.206382.12129223070303260958.stgit@omen> In-Reply-To: <165471611818.206382.17518111383201260657.stgit@omen> References: <165471611818.206382.17518111383201260657.stgit@omen> User-Agent: StGit/1.5.dev2+g9ce680a52bd9 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=alex.williamson@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1654716338436100001 From: Eric Auger 851d6d1a0f ("vfio/common: remove spurious tpm-crb-cmd misalignment warning") removed the warning on vfio_listener_region_add() path. However the same warning also hits on region_del path. Let's remove it and reword the dynamic trace as this can be called on both map and unmap path. Signed-off-by: Eric Auger Reviewed-by: Cornelia Huck Link: https://lore.kernel.org/r/20220524091405.416256-1-eric.auger@redhat.c= om Fixes: 851d6d1a0ff2 ("vfio/common: remove spurious tpm-crb-cmd misalignment= warning") Signed-off-by: Alex Williamson --- hw/vfio/common.c | 10 +++++++++- hw/vfio/trace-events | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/hw/vfio/common.c b/hw/vfio/common.c index 29982c7af8c4..ace9562a9ba1 100644 --- a/hw/vfio/common.c +++ b/hw/vfio/common.c @@ -1145,7 +1145,15 @@ static void vfio_listener_region_del(MemoryListener = *listener, if (unlikely((section->offset_within_address_space & ~qemu_real_host_page_mask()) !=3D (section->offset_within_region & ~qemu_real_host_page_mas= k()))) { - error_report("%s received unaligned region", __func__); + if (!vfio_known_safe_misalignment(section)) { + error_report("%s received unaligned region %s iova=3D0x%"PRIx64 + " offset_within_region=3D0x%"PRIx64 + " qemu_real_host_page_size=3D0x%"PRIxPTR, + __func__, memory_region_name(section->mr), + section->offset_within_address_space, + section->offset_within_region, + qemu_real_host_page_size()); + } return; } =20 diff --git a/hw/vfio/trace-events b/hw/vfio/trace-events index 582882db91c3..73dffe9e00d5 100644 --- a/hw/vfio/trace-events +++ b/hw/vfio/trace-events @@ -100,7 +100,7 @@ vfio_listener_region_add_skip(uint64_t start, uint64_t = end) "SKIPPING region_add vfio_spapr_group_attach(int groupfd, int tablefd) "Attached groupfd %d to = liobn fd %d" vfio_listener_region_add_iommu(uint64_t start, uint64_t end) "region_add [= iommu] 0x%"PRIx64" - 0x%"PRIx64 vfio_listener_region_add_ram(uint64_t iova_start, uint64_t iova_end, void = *vaddr) "region_add [ram] 0x%"PRIx64" - 0x%"PRIx64" [%p]" -vfio_known_safe_misalignment(const char *name, uint64_t iova, uint64_t off= set_within_region, uintptr_t page_size) "Region \"%s\" iova=3D0x%"PRIx64" o= ffset_within_region=3D0x%"PRIx64" qemu_real_host_page_size=3D0x%"PRIxPTR ":= cannot be mapped for DMA" +vfio_known_safe_misalignment(const char *name, uint64_t iova, uint64_t off= set_within_region, uintptr_t page_size) "Region \"%s\" iova=3D0x%"PRIx64" o= ffset_within_region=3D0x%"PRIx64" qemu_real_host_page_size=3D0x%"PRIxPTR vfio_listener_region_add_no_dma_map(const char *name, uint64_t iova, uint6= 4_t size, uint64_t page_size) "Region \"%s\" 0x%"PRIx64" size=3D0x%"PRIx64"= is not aligned to 0x%"PRIx64" and cannot be mapped for DMA" vfio_listener_region_del_skip(uint64_t start, uint64_t end) "SKIPPING regi= on_del 0x%"PRIx64" - 0x%"PRIx64 vfio_listener_region_del(uint64_t start, uint64_t end) "region_del 0x%"PRI= x64" - 0x%"PRIx64