From nobody Sun May 19 03:28:32 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1653385150; cv=none; d=zohomail.com; s=zohoarc; b=WbK2zhuUTCNz/b1DObpAB0zvbb8LcpTFH4PIN2rBoA9KmyNa0obeQ+wlLsRR5S3Ssh7UEo6VfLxn9FqEYCLVFtvwCuWA+v3034lo9w671HoH3Qzp2DtVRPAhb5LAPeMZlwPARmWJVTfM1UPgW9Csfg+yX4gZb521Dst8/wWvkl0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653385150; h=Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=A08G7LjJHYMQnQX/zqMpI6M7HJDJHiAgYf06DfkHjVM=; b=MDLGcLNoFlhTsGY5Am6zu80mv2lb/UWyKQcBnnht/qia0HSpBK6+MYjetNPoAwnTrxw86r1akQUlzT06BxP5UfZAHXYelZ3LO72c9+aFTgix8QVzwQjDX+mr0JWMeHdK6Wnh9LhV7mUkKVqvJjO8hJWs0v1EKK+7o0QxetmnrOQ= 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+importer2=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 1653385150721491.1516757709943; Tue, 24 May 2022 02:39:10 -0700 (PDT) Received: from localhost ([::1]:33654 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ntR0O-00018O-T0 for importer2@patchew.org; Tue, 24 May 2022 05:39:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39006) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntQcN-0000aW-7W for qemu-devel@nongnu.org; Tue, 24 May 2022 05:14:19 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:54755) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntQcJ-0002YF-H7 for qemu-devel@nongnu.org; Tue, 24 May 2022 05:14:17 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-646-AsIDvw5pNmyVM78t90Wknw-1; Tue, 24 May 2022 05:14:12 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DC13F185A7BA; Tue, 24 May 2022 09:14:11 +0000 (UTC) Received: from virtlab703.virt.lab.eng.bos.redhat.com (dhcp158-77.virt.lab.eng.bos.redhat.com [10.19.158.77]) by smtp.corp.redhat.com (Postfix) with ESMTP id AF78040C1257; Tue, 24 May 2022 09:14:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653383653; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=A08G7LjJHYMQnQX/zqMpI6M7HJDJHiAgYf06DfkHjVM=; b=NhUUZ8wn/jLBAKEzFLiyNIuSXWY8Oz7PaXTzOgKZrE5P8tvd3LLzDI/gNcQlqAArz03wVB khfpDo9fqugA7wruAf+hctDm/LZ2JCwu8RtsrTQNyTbzj8xmn2C14/BmFlqwKU0o/PWtFI 6ipw7TABhisPPCZfA+JRjpM25dFrQMs= X-MC-Unique: AsIDvw5pNmyVM78t90Wknw-1 From: Eric Auger To: eric.auger.pro@gmail.com, eric.auger@redhat.com, qemu-devel@nongnu.org, alex.williamson@redhat.com, cohuck@redhat.com Subject: [PATCH] vfio/common: remove spurious warning on vfio_listener_region_del Date: Tue, 24 May 2022 05:14:05 -0400 Message-Id: <20220524091405.416256-1-eric.auger@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=eric.auger@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 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_LOW=-0.7, 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+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1653385152401100001 Content-Type: text/plain; charset="utf-8" 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 --- 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 29982c7af8..ace9562a9b 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 582882db91..73dffe9e00 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 --=20 2.30.1