From nobody Sat Feb 7 06:21:11 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1603214707; cv=none; d=zohomail.com; s=zohoarc; b=LJMNvQLG4iSOe1cQJUjUH4JweId+eoD/lkzWja2ZGXuEtK/AaIe8T2roQPx+1CtgPIQJCAOJW4j2j2p9/1qI0h+wJq3V2wIijdG0ATzgSZAKomfHctsj7SOcJ47gRdOaHbgJ88zXoEXxYaVSNpMgs5e0u0xljayGJWWGAgI6Nxo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1603214707; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=1vJfrvMuiaSUgd2BJasweCjCskoP5hMk59FTWXR5TQ4=; b=nY+h17Kr45S6WNJr4J/YZmm0CR4cUMqjnCLnZ4VKxfBa+iamQLJGwSSLi1dLCV1R5E0PmVROnLOQuuXtOzoX7gHCgsPZ+szwEGvfDGZIyx7zQYBIgdP/RjiRnovh+14Hfa401yVsGBOzmvGC42l2+/YdMyiO2ymZqeKKt3C8PBA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1603214707302403.5564364474118; Tue, 20 Oct 2020 10:25:07 -0700 (PDT) Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-37-S9hpqKNWNxeJd1bm3xDn6g-1; Tue, 20 Oct 2020 13:25:02 -0400 Received: by mail-wr1-f69.google.com with SMTP id t3so1090237wrq.2 for ; Tue, 20 Oct 2020 10:25:02 -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 l26sm3581031wmi.41.2020.10.20.10.24.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Oct 2020 10:25:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603214706; 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=1vJfrvMuiaSUgd2BJasweCjCskoP5hMk59FTWXR5TQ4=; b=ITdBGJeXCU8pUJJvOLqlYb2rV/e0VE1otSt4VsfbhYGgpIdgAZIs+Wcob3dUEmI118JAcz op0Hf5epJrTYFjqnzFL/0QFNNqJ4/ijUqKmXNn+otAHi4PZ8aUbevnidm+lVk8duVR8lCr B5i7ZC+ebRr5Hycqwq+y1pdPUharUck= X-MC-Unique: S9hpqKNWNxeJd1bm3xDn6g-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=1vJfrvMuiaSUgd2BJasweCjCskoP5hMk59FTWXR5TQ4=; b=KLQBq0oLDRW/K2GZtFHHsNfZbPKHMqZtCBqSJvV9TIqf/NksbtpBb3eGhq5adse6KX F8n36dTg+T7GwKzmklwxpiqkbYJUQdANXO8d6od64jjUkVu80n09XLvBXVBTYq6d73fD qXnTBLgAhf6av9HMvWEJ75YHVmo68EbVfTdAr9U6VgtN94T+4FzPkzBbQ/VFhoqwG5SF ly/w2cU+Z/rxPchItPpA1C8LZLl75z4zTVqY6OViVf0kyPuff+aWDs148IspCgtzIlJD wCwV4k8BMsnJ/a1wS3DkeBwjtT0ZPrZy9fhJpL6s6Nhj2UTx62YLeRVV/lIAvVmVbgzk Lekw== X-Gm-Message-State: AOAM5318t2DqGvO58OrqB2r4IKCtDf5c6hXtQanvwUN8YSqSfvJ52FEE 3kQMMUbaXzpP14eMObbK7uqP7yMln86mmZ3x6tYQQSBWTz2SQj7YWYn15QadaJuF9TM3vBM4cSA GmV9H+IFGoQFExg== X-Received: by 2002:a5d:488e:: with SMTP id g14mr4766421wrq.203.1603214701414; Tue, 20 Oct 2020 10:25:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrGZ9MDGoRqBGHFRk0ZNlxEhHddRkKL8Ap7VKPmsoVz9RPDVwRmBNME9hpiuX25IN5fb6r9w== X-Received: by 2002:a5d:488e:: with SMTP id g14mr4766405wrq.203.1603214701185; Tue, 20 Oct 2020 10:25:01 -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 06/16] util/vfio-helpers: Trace PCI BAR region info Date: Tue, 20 Oct 2020 19:24:18 +0200 Message-Id: <20201020172428.2220726-7-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 debug purpose, trace BAR regions info. Reviewed-by: Fam Zheng Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Stefan Hajnoczi --- util/vfio-helpers.c | 8 ++++++++ util/trace-events | 1 + 2 files changed, 9 insertions(+) diff --git a/util/vfio-helpers.c b/util/vfio-helpers.c index ac9cc20ce29..4204ce55445 100644 --- a/util/vfio-helpers.c +++ b/util/vfio-helpers.c @@ -137,6 +137,7 @@ static inline void assert_bar_index_valid(QEMUVFIOState= *s, int index) =20 static int qemu_vfio_pci_init_bar(QEMUVFIOState *s, int index, Error **err= p) { + g_autofree char *barname =3D NULL; assert_bar_index_valid(s, index); s->bar_region_info[index] =3D (struct vfio_region_info) { .index =3D VFIO_PCI_BAR0_REGION_INDEX + index, @@ -146,6 +147,10 @@ static int qemu_vfio_pci_init_bar(QEMUVFIOState *s, in= t index, Error **errp) error_setg_errno(errp, errno, "Failed to get BAR region info"); return -errno; } + barname =3D g_strdup_printf("bar[%d]", index); + trace_qemu_vfio_region_info(barname, s->bar_region_info[index].offset, + s->bar_region_info[index].size, + s->bar_region_info[index].cap_offset); =20 return 0; } @@ -440,6 +445,9 @@ static int qemu_vfio_init_pci(QEMUVFIOState *s, const c= har *device, ret =3D -errno; goto fail; } + trace_qemu_vfio_region_info("config", s->config_region_info.offset, + s->config_region_info.size, + s->config_region_info.cap_offset); =20 for (i =3D 0; i < ARRAY_SIZE(s->bar_region_info); i++) { ret =3D qemu_vfio_pci_init_bar(s, i, errp); diff --git a/util/trace-events b/util/trace-events index b697d2d5429..a6a541270b7 100644 --- a/util/trace-events +++ b/util/trace-events @@ -88,3 +88,4 @@ qemu_vfio_dma_unmap(void *s, void *host) "s %p host %p" qemu_vfio_iommu_iova_pgsizes(uint64_t iova_pgsizes) "iommu page size bitma= sk: 0x%08"PRIx64 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 --=20 2.26.2