From nobody Mon Feb 9 16:19:04 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=1603709744; cv=none; d=zohomail.com; s=zohoarc; b=ggfFMDND1AoUxCEdLSwIfd19ek0erA5M7z/jm1pe0wh/aLCqAbGF83q2FZ/zg5obM/Zd6VSrKp/ZSqypdkvs9vdmu4JTkVSFHKrPg0o/O+nCQVHgP/b4u5/JcSIRABbtry2y9WnrNA2+LgiEiJm4qC3uHUx6AaeKGJyqok5ikaM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1603709744; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=jJzeX7lyaDemOB2QTG1Y3n+OWt54ICMjUzceGOoInIo=; b=LG6Qti9nHMdT1pFE+IeNBQqrc+CAmhoCPBmhiAh8FnDDHi+LJCITDk8Jj53IyLlLjvAZpl5KFT1OoQChreOUtciUCB/4OyJTwbDYPOz6s1xWFTK27RHfSD3l6bbdSPDeGGjwGCe1HzilvZoLDHxFNlnJ25v44nplpYZh9d8Via8= 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 16037097447571008.4075412884363; Mon, 26 Oct 2020 03:55:44 -0700 (PDT) Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-575-ms2s5c3jPb-L6Zs_524b6g-1; Mon, 26 Oct 2020 06:55:41 -0400 Received: by mail-wr1-f71.google.com with SMTP id i6so8168663wrx.11 for ; Mon, 26 Oct 2020 03:55:41 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (237.red-88-18-140.staticip.rima-tde.net. [88.18.140.237]) by smtp.gmail.com with ESMTPSA id b131sm1160966wmc.3.2020.10.26.03.55.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Oct 2020 03:55:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603709743; 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=jJzeX7lyaDemOB2QTG1Y3n+OWt54ICMjUzceGOoInIo=; b=Q+LxxypvE6g+ZM+ktQfVwLlihNtVGZcnBAv9xMHHsdJwVSCM+8TcJ40nKUmTzVE7y6OcUT z78jYvU2+x9mCpYGgjvensyE9SkGoC+HGv440Ay9BGBcsaGP5FjKy69Nsy9DhtpkoEipZR kC6edl97NJewPXaZbmrdFNyOT3xgLsk= X-MC-Unique: ms2s5c3jPb-L6Zs_524b6g-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=jJzeX7lyaDemOB2QTG1Y3n+OWt54ICMjUzceGOoInIo=; b=KVO1YFEjFz/msdcQg8516fijYr/iKfesNT4gTjKTbXYkTCXv0G0IFEY5foHcB5irqb mZYFHcerfjly122v2/ixRW7mL4eARZNNsWTs+2breUb6NKdzPhB0kTLV9ObImsPDNPSq m09Iv6twGaqgykGYzDG4ppe1lYyY7z+YkaD8sgGypydDZJAi6p05XfvHs2rVV/cYJZ0C Q4k1uy+6PEM0lysPZMvtQcdTdkrAlqud7k5f+K7Tg7l5O7a5Z36JcZTTaowUSuugLZsb O9X9BQM8/nMt74N+kcRJxqhzzslLxrNz5cOyg/XxqBsCdkGtgIpQi7sjBPl+WYCjznkZ 4rMQ== X-Gm-Message-State: AOAM5301YoyhX3yZhnbabl4LGcIYxivJydNrSkYoeLcgwVvNBxyoY8kE u8/MFdwNH8hF/oY52iYvHBReuOI2n02YbkpL/vHnZOaZrWOGWWlbe0AmzqaXRFDkiSe2H3w2lJb 4r3OUfBX9QB1qFA== X-Received: by 2002:a7b:c3da:: with SMTP id t26mr16284935wmj.154.1603709740673; Mon, 26 Oct 2020 03:55:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxe2y0OyvBqzoh3Dpf17wbm5M1CkR3WwDvAihIJrU9Z14iJ8ablrFpUKe264tnVOoW2Gu1G8g== X-Received: by 2002:a7b:c3da:: with SMTP id t26mr16284916wmj.154.1603709740480; Mon, 26 Oct 2020 03:55:40 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eric Auger , Alex Williamson , qemu-block@nongnu.org, Fam Zheng , Max Reitz , Stefan Hajnoczi , Kevin Wolf , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 07/19] util/vfio-helpers: Trace PCI BAR region info Date: Mon, 26 Oct 2020 11:54:52 +0100 Message-Id: <20201026105504.4023620-8-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201026105504.4023620-1-philmd@redhat.com> References: <20201026105504.4023620-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 Reviewed-by: Stefan Hajnoczi Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- 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 1d4efafcaa4..cd6287c3a98 100644 --- a/util/vfio-helpers.c +++ b/util/vfio-helpers.c @@ -136,6 +136,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, @@ -145,6 +146,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; } @@ -416,6 +421,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 c048f85f828..4d40c74a21f 100644 --- a/util/trace-events +++ b/util/trace-events @@ -87,3 +87,4 @@ qemu_vfio_dma_map(void *s, void *host, size_t size, bool = temporary, uint64_t *io 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 %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