From nobody Sat Feb 7 06:20:58 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=1603214710; cv=none; d=zohomail.com; s=zohoarc; b=LhQX8VwWWRbzqqq3Oe0s5gGQFfdBtcyMJLNMSw3OwAqaRtym6HcnI4/ccq1o9nPDVC7x00d/D70eGzMpqknz5osP3n8g+4LZmgqxLdHPjaa2JMOafCLOTskaUeT47OjIg4SJjmydiJM30aZ/sIKTo7n1XJY/HNw+eKSZyYisi9k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1603214710; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=NPTgcsyGuNMaq1KpOvK5NDZDqqsXCSXk7ysr+MEn7o0=; b=fmxM5Wk3HkJnQG+blv6C5IGBBOSofV33ejCQP+preS9WSepd9F3xRRAUyj2xj4/DNyItSruZwyPQ++Mysktjrj4o7NMfwVRH9PydV4Yw0u+sx6ZlcG2wHClx7nnOmYcUJc1QoesXePKx3nDy51NXTFaPqdnwTAz4GcWedLgw8ug= 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 1603214710700771.2181719095832; Tue, 20 Oct 2020 10:25:10 -0700 (PDT) Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-420--ejkk1QUPPyq9TRvbOINIA-1; Tue, 20 Oct 2020 13:25:07 -0400 Received: by mail-wm1-f71.google.com with SMTP id f191so626911wmf.9 for ; Tue, 20 Oct 2020 10:25:07 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (237.red-88-18-140.staticip.rima-tde.net. [88.18.140.237]) by smtp.gmail.com with ESMTPSA id g5sm3666499wmi.4.2020.10.20.10.25.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Oct 2020 10:25:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603214710; 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=NPTgcsyGuNMaq1KpOvK5NDZDqqsXCSXk7ysr+MEn7o0=; b=HG09D7G5pSIOhlhnynWXQoBP/GHcESgsnOyYKcdpgwOiRnj9va39SB327XTbi0aVwLvfya qpTDk1JQ/ioi2HFsvnQID0VG/pZbXhsJ5VcR5SnwGYv61DGdzM/KgRz8qk0NS75cXwbxRb zoo9xgguM+Ci0ZdlKV2oO1mBVMbfeCY= X-MC-Unique: -ejkk1QUPPyq9TRvbOINIA-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=NPTgcsyGuNMaq1KpOvK5NDZDqqsXCSXk7ysr+MEn7o0=; b=exnd3E+clpNHUex7stbB10OaL49YUhtjSe9xQINnUf122u9mSGooMHMNFr9j2e/IS/ anPpK2fAGC/Hcr9tNAu4FWB+AL4EK0DM8gaJkWdBIHiznBKhlwZPWcQVpBHvUPm3Q83B Jr3nwgd9A5Xt10Jk+KahKIDdHoV8fdBupQF3WxX+3Dp9MikYrduO5tdd6Xo56aPaCfbk N+FYt1Dpjap8cgkeKwP85XB9cSnA/cbw6EduvWcDlvlgmuLGrX5WBGl7jSHWeRhx9bMn rypDCmuEtTXR/RQvwmbkpQ8tJbTLmaxB31bfgN18hE+BJgK643obxiuYRDSgYSxR5MuV d3rw== X-Gm-Message-State: AOAM533tlyxvmDpWyFTI10BXYrjAWdG7PvajGUykp4VCP3bApZSXbYOf +GP0MbdZQ2OZx4nlyvuH+7xSvAolaKOYsrZhJM7zPit+Dfh5XCiQ+eTj4mLVdyjbfvbjLfSWC5N IgeljRaLf5OUsPg== X-Received: by 2002:a7b:cb13:: with SMTP id u19mr4116665wmj.89.1603214706533; Tue, 20 Oct 2020 10:25:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTIb+5q7yEKp72ydfo56l3zX8thjfJUADnjRhdHe2cneHegiiLrzVGYRd4QwCD8iu+XOFo4w== X-Received: by 2002:a7b:cb13:: with SMTP id u19mr4116643wmj.89.1603214706331; Tue, 20 Oct 2020 10:25:06 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Kevin Wolf , Alex Williamson , Stefan Hajnoczi , Max Reitz , Fam Zheng , qemu-block@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 07/16] util/vfio-helpers: Trace where BARs are mapped Date: Tue, 20 Oct 2020 19:24:19 +0200 Message-Id: <20201020172428.2220726-8-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201020172428.2220726-1-philmd@redhat.com> References: <20201020172428.2220726-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 a BAR is mapped. Reviewed-by: Fam Zheng Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Stefan Hajnoczi --- util/vfio-helpers.c | 2 ++ util/trace-events | 1 + 2 files changed, 3 insertions(+) diff --git a/util/vfio-helpers.c b/util/vfio-helpers.c index 4204ce55445..95e010bed6d 100644 --- a/util/vfio-helpers.c +++ b/util/vfio-helpers.c @@ -167,6 +167,8 @@ void *qemu_vfio_pci_map_bar(QEMUVFIOState *s, int index, p =3D mmap(NULL, MIN(size, s->bar_region_info[index].size - offset), prot, MAP_SHARED, s->device, s->bar_region_info[index].offset + offset); + trace_qemu_vfio_pci_map_bar(index, s->bar_region_info[index].offset , + size, offset, p); if (p =3D=3D MAP_FAILED) { error_setg_errno(errp, errno, "Failed to map BAR region"); p =3D NULL; diff --git a/util/trace-events b/util/trace-events index a6a541270b7..7c92f2f8c1a 100644 --- a/util/trace-events +++ b/util/trace-events @@ -89,3 +89,4 @@ qemu_vfio_iommu_iova_pgsizes(uint64_t iova_pgsizes) "iomm= u page size bitmask: 0x 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 %d (region ofs 0x%"= PRIx64" size %"PRId64")" 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 %d (region ofs 0x= %"PRIx64" size %"PRId64")" qemu_vfio_region_info(const char *desc, uint64_t offset, uint64_t size, ui= nt32_t cap_offset) "region '%s' ofs 0x%"PRIx64" size %"PRId64" cap_ofs %"PR= Id32 +qemu_vfio_pci_map_bar(int index, uint64_t region_ofs, uint64_t region_size= , int ofs, void *host) "map region bar#%d ofs 0x%"PRIx64" size %"PRId64" of= s %d host %p" --=20 2.26.2