From patchwork Tue Sep 1 21:33:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laszlo Ersek X-Patchwork-Id: 52947 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by patches.linaro.org (Postfix) with ESMTPS id 4060222E23 for ; Tue, 1 Sep 2015 21:34:18 +0000 (UTC) Received: by laeb10 with SMTP id b10sf5699334lae.1 for ; Tue, 01 Sep 2015 14:34:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:cc:subject:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list; bh=2c4OW426a5km3ecnRauDX7e853C42ORF6oQcCXj20DE=; b=OzjRpG5sUev5107VpRsb/oOF6yAPVUNYsZg63ZyQTB+r2Ckcic2InmycwXtRK/a7kA 4BBB2Jk1/Mw9F/GVYV4XfpRUWBp0y+zCjsKFKSOFpdCTrBhKMifPkY1ZKHSrg82yVxUL AOem+I2g9S4+XD1pF0U/xLeG01pbZJvgcFt1nagnOJuO21E3/cpxpkTojRdUw0xhl+BM OHUZcEHgOugqmMfFdej2hpoU8CSD6pGsmyU8eubut+oS3zRkuosEz0DMl2gW2WxTvGrh PM8Gzoh2J1YtGL42b3Q7uEtwauDqYIST8AXoWotuKpsl4YUMov33PztCGu6wLjX0jngG /alw== X-Gm-Message-State: ALoCoQl8k4GA3wtfe43ffK9jjTUD1Vb01RBlwAvf9DH6oZ56n0TYG3cXBmyd0CmRIfJHaamzJnj5 X-Received: by 10.194.19.33 with SMTP id b1mr8218635wje.6.1441143257201; Tue, 01 Sep 2015 14:34:17 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.103 with SMTP id l7ls1052laf.35.gmail; Tue, 01 Sep 2015 14:34:16 -0700 (PDT) X-Received: by 10.152.36.161 with SMTP id r1mr14000564laj.82.1441143256706; Tue, 01 Sep 2015 14:34:16 -0700 (PDT) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com. [209.85.217.175]) by mx.google.com with ESMTPS id ky10si17673339lab.43.2015.09.01.14.34.16 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Sep 2015 14:34:16 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) client-ip=209.85.217.175; Received: by lbbmp1 with SMTP id mp1so7467047lbb.1 for ; Tue, 01 Sep 2015 14:34:16 -0700 (PDT) X-Received: by 10.152.170.230 with SMTP id ap6mr14347295lac.73.1441143256566; Tue, 01 Sep 2015 14:34:16 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.164.42 with SMTP id yn10csp129382lbb; Tue, 1 Sep 2015 14:34:15 -0700 (PDT) X-Received: by 10.140.238.85 with SMTP id j82mr55359397qhc.9.1441143255787; Tue, 01 Sep 2015 14:34:15 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [208.118.235.17]) by mx.google.com with ESMTPS id u79si23081724qki.106.2015.09.01.14.34.15 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 01 Sep 2015 14:34:15 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; Received: from localhost ([::1]:58789 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWtC3-0007Xo-0r for patch@linaro.org; Tue, 01 Sep 2015 17:34:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60012) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWtBP-0006sE-My for qemu-devel@nongnu.org; Tue, 01 Sep 2015 17:33:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZWtBL-0002wF-Ci for qemu-devel@nongnu.org; Tue, 01 Sep 2015 17:33:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40722) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWtBL-0002wB-7R; Tue, 01 Sep 2015 17:33:31 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 8059FC1CC1C1; Tue, 1 Sep 2015 21:33:30 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-102.ams2.redhat.com [10.36.116.102]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t81LXR3C028205; Tue, 1 Sep 2015 17:33:28 -0400 From: Laszlo Ersek To: qemu-devel@nongnu.org Date: Tue, 1 Sep 2015 23:33:23 +0200 Message-Id: <1441143203-15044-1-git-send-email-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: qemu-trivial@nongnu.org, Don Koch , "Michael S. Tsirkin" Subject: [Qemu-devel] [trivial PATCH] hw/pci: fix pci_update_mappings() trace events X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: lersek@redhat.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 The current trace prototypes and (matching) trace calls lead to "unorthodox" PCI BDF notation in at least the stderr trace backend. For example, the four BARs of a QXL video card at 00:01.0 (bus 0, slot 1, function 0) are traced like this (PID and timestamps removed): pci_update_mappings_add d=0x7f14a73bf890 00:00.1 0,0x84000000+0x4000000 pci_update_mappings_add d=0x7f14a73bf890 00:00.1 1,0x80000000+0x4000000 pci_update_mappings_add d=0x7f14a73bf890 00:00.1 2,0x88200000+0x2000 pci_update_mappings_add d=0x7f14a73bf890 00:00.1 3,0xd060+0x20 The slot and function values are in reverse order. Stick with the conventional BDF notation. Cc: "Michael S. Tsirkin" Cc: Don Koch Cc: qemu-trivial@nongnu.org Fixes: 7828d75045 Signed-off-by: Laszlo Ersek Reviewed-by: Marcel Apfelbaum --- hw/pci/pci.c | 4 ++-- trace-events | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 9f57aea..47f42ea 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -1154,16 +1154,16 @@ static void pci_update_mappings(PCIDevice *d) /* now do the real mapping */ if (r->addr != PCI_BAR_UNMAPPED) { trace_pci_update_mappings_del(d, pci_bus_num(d->bus), - PCI_FUNC(d->devfn), PCI_SLOT(d->devfn), + PCI_FUNC(d->devfn), i, r->addr, r->size); memory_region_del_subregion(r->address_space, r->memory); } r->addr = new_addr; if (r->addr != PCI_BAR_UNMAPPED) { trace_pci_update_mappings_add(d, pci_bus_num(d->bus), - PCI_FUNC(d->devfn), PCI_SLOT(d->devfn), + PCI_FUNC(d->devfn), i, r->addr, r->size); memory_region_add_subregion_overlap(r->address_space, r->addr, r->memory, 1); diff --git a/trace-events b/trace-events index 8f9614a..5e78f18 100644 --- a/trace-events +++ b/trace-events @@ -1303,8 +1303,8 @@ spapr_pci_lsi_set(const char *busname, int pin, uint32_t irq) "%s PIN%d IRQ %u" spapr_pci_msi_retry(unsigned config_addr, unsigned req_num, unsigned max_irqs) "Guest device at %x asked %u, have only %u" # hw/pci/pci.c -pci_update_mappings_del(void *d, uint32_t bus, uint32_t func, uint32_t slot, int bar, uint64_t addr, uint64_t size) "d=%p %02x:%02x.%x %d,%#"PRIx64"+%#"PRIx64 -pci_update_mappings_add(void *d, uint32_t bus, uint32_t func, uint32_t slot, int bar, uint64_t addr, uint64_t size) "d=%p %02x:%02x.%x %d,%#"PRIx64"+%#"PRIx64 +pci_update_mappings_del(void *d, uint32_t bus, uint32_t slot, uint32_t func, int bar, uint64_t addr, uint64_t size) "d=%p %02x:%02x.%x %d,%#"PRIx64"+%#"PRIx64 +pci_update_mappings_add(void *d, uint32_t bus, uint32_t slot, uint32_t func, int bar, uint64_t addr, uint64_t size) "d=%p %02x:%02x.%x %d,%#"PRIx64"+%#"PRIx64 # hw/net/pcnet.c pcnet_s_reset(void *s) "s=%p"