From nobody Mon Feb 9 19:52:37 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1604369288; cv=none; d=zohomail.com; s=zohoarc; b=By9gA/i2Tpt/B7jj6+nytcba+Z9Lu+JuUNRJUTiPiFqiHTv9QYo0WBEz0iCn2ymt9gF4BKMg+HsdBhMksBZrIOPqhdyBWPhraG3+Bs8b0LV8lYhEa9yWKKQVARGRc0wHDCSGGhBenZww8sxzfTP6Kv8qWULo76PFWIrB4kbR7Qc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604369288; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=OoEtmrvV7SWgD7QH62cY93Xnq1kvlQkCFqVy10vUni4=; b=ZMCY5UXHCiC58DRn+Uo41OBlIysLg3tFSCpq+1z9CU6xSCYQuHGrvk//u/601aoA2B2wg/DmI+9obdFzs29YVNTROmGsMsbUrrKMWqqKfG+N0Rpdz0hu/i6FFtITQvw7gzzeNpoFaqwQsO88SJ5nvQre7l00aKPu+ctdU1k0qOk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1604369288400669.7634001049275; Mon, 2 Nov 2020 18:08:08 -0800 (PST) Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-74-AlRhpIsSOSy0Af26Nth92w-1; Mon, 02 Nov 2020 21:08:05 -0500 Received: by mail-wr1-f70.google.com with SMTP id j15so7208889wrd.16 for ; Mon, 02 Nov 2020 18:08:05 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (234.red-83-42-66.dynamicip.rima-tde.net. [83.42.66.234]) by smtp.gmail.com with ESMTPSA id m14sm24224588wro.43.2020.11.02.18.08.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Nov 2020 18:08:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604369287; 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=OoEtmrvV7SWgD7QH62cY93Xnq1kvlQkCFqVy10vUni4=; b=IonP4XRm1aj8hEofNTYh7PTMnSEgVrKb5s0ThsLg0wACLE0xvb1GOWReHx5jSQOxM8gLtg 3aN0shrD6EwYseIFTuwi9slKaPXGyn5mcJi1/foqcZRJcp6RgusS2lrvqe7mo0ub1yWYYX /MGK0DUmx3jL0dyr6o1Mwi2XogmL9U0= X-MC-Unique: AlRhpIsSOSy0Af26Nth92w-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OoEtmrvV7SWgD7QH62cY93Xnq1kvlQkCFqVy10vUni4=; b=OlU1/oGHq/KNi47iEjDYUMAQaxmjtppUUhu5sZFrzwsxBODdc7NnLwrSkIQne9XBkL qAAFspDlEOcvgXi/gJqxFF/i/LIUUCgfLVNxEOenlbsB0hN4dMwFA+CN67vW1E6mppTB Lkld+9/lQcmDgOloh/rrCKmWsu8QRO0DNlFa78vNB1iWmBj3ozo6CRVXFuCUDfVynaB6 7Wrh+8+mQB+rM8GPecNh1uVs83U1qG7QNQ/FccMjV5LXbxXPqqKoX0imvh2YapMVfi56 XBQZNZItalDZW8kDkwRCWpN/V5KisObLdK88g92jvgapeitzWiDkfDJE2LXhxPLZLs0q PDzw== X-Gm-Message-State: AOAM531M8NvfC81XdJNpQeREv/ep9Y/l9oN9upX2hOOJ0aHCSZryj15b VwQw38l/DSyfFDeODH8ez1fddeHhMFWcx4MhFCQvKCAA/7V4PY0Xy8oXx3LhVuAhOg/4QlVy41b KZGbvv0mQ4qJBWQ== X-Received: by 2002:adf:8362:: with SMTP id 89mr24024037wrd.280.1604369284570; Mon, 02 Nov 2020 18:08:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJymTpCXejYt2U6jaySc9x0vzhoAjtUSCOqYEmvtMUIPDtts2HO293Y66zTLdis78OgqJvDNTQ== X-Received: by 2002:adf:8362:: with SMTP id 89mr24024020wrd.280.1604369284446; Mon, 02 Nov 2020 18:08:04 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Stefan Hajnoczi , Kevin Wolf , Eric Auger , Max Reitz , Fam Zheng , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH-for-5.2 v3 5/7] util/vfio-helpers: Improve DMA trace events Date: Tue, 3 Nov 2020 03:07:31 +0100 Message-Id: <20201103020733.2303148-6-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201103020733.2303148-1-philmd@redhat.com> References: <20201103020733.2303148-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) For debugging purpose, trace where DMA regions are mapped. Reviewed-by: Fam Zheng Reviewed-by: Stefan Hajnoczi Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- util/vfio-helpers.c | 3 ++- util/trace-events | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/util/vfio-helpers.c b/util/vfio-helpers.c index 278c54902e7..c24a510df82 100644 --- a/util/vfio-helpers.c +++ b/util/vfio-helpers.c @@ -627,7 +627,7 @@ static int qemu_vfio_do_mapping(QEMUVFIOState *s, void = *host, size_t size, .vaddr =3D (uintptr_t)host, .size =3D size, }; - trace_qemu_vfio_do_mapping(s, host, size, iova); + trace_qemu_vfio_do_mapping(s, host, iova, size); =20 if (ioctl(s->container, VFIO_IOMMU_MAP_DMA, &dma_map)) { error_report("VFIO_MAP_DMA failed: %s", strerror(errno)); @@ -783,6 +783,7 @@ int qemu_vfio_dma_map(QEMUVFIOState *s, void *host, siz= e_t size, } } } + trace_qemu_vfio_dma_mapped(s, host, iova0, size); if (iova) { *iova =3D iova0; } diff --git a/util/trace-events b/util/trace-events index 52d43cda3f3..08239941cb2 100644 --- a/util/trace-events +++ b/util/trace-events @@ -82,8 +82,9 @@ qemu_vfio_ram_block_added(void *s, void *p, size_t size) = "s %p host %p size 0x%z qemu_vfio_ram_block_removed(void *s, void *p, size_t size) "s %p host %p s= ize 0x%zx" qemu_vfio_find_mapping(void *s, void *p) "s %p host %p" qemu_vfio_new_mapping(void *s, void *host, size_t size, int index, uint64_= t iova) "s %p host %p size 0x%zx index %d iova 0x%"PRIx64 -qemu_vfio_do_mapping(void *s, void *host, size_t size, uint64_t iova) "s %= p host %p size 0x%zx iova 0x%"PRIx64 -qemu_vfio_dma_map(void *s, void *host, size_t size, bool temporary, uint64= _t *iova) "s %p host %p size 0x%zx temporary %d iova %p" +qemu_vfio_do_mapping(void *s, void *host, uint64_t iova, size_t size) "s %= p host %p <-> iova 0x%"PRIx64 " size 0x%zx" +qemu_vfio_dma_map(void *s, void *host, size_t size, bool temporary, uint64= _t *iova) "s %p host %p size 0x%zx temporary %d &iova %p" +qemu_vfio_dma_mapped(void *s, void *host, uint64_t iova, size_t size) "s %= p host %p <-> iova 0x%"PRIx64" size 0x%zx" qemu_vfio_dma_unmap(void *s, void *host) "s %p host %p" qemu_vfio_pci_read_config(void *buf, int ofs, int size, uint64_t region_of= s, uint64_t region_size) "read cfg ptr %p ofs 0x%x size 0x%x (region addr 0= x%"PRIx64" size 0x%"PRIx64")" qemu_vfio_pci_write_config(void *buf, int ofs, int size, uint64_t region_o= fs, uint64_t region_size) "write cfg ptr %p ofs 0x%x size 0x%x (region addr= 0x%"PRIx64" size 0x%"PRIx64")" --=20 2.26.2