From patchwork Thu Sep 10 09:18:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 53374 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by patches.linaro.org (Postfix) with ESMTPS id F2EF922DC0 for ; Thu, 10 Sep 2015 09:23:26 +0000 (UTC) Received: by lanb10 with SMTP id b10sf12345670lan.3 for ; Thu, 10 Sep 2015 02:23:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:date:from:to:message-id:references :mime-version:content-type:content-disposition:in-reply-to: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=NmRBe6rx/Tgajabnif11FdJbKJgwOXLbZwkomSd1k88=; b=bfDJc2UWCAF9efsK/cDFXg/+daluYcD91nyqeBejoU1HX5bZm6Hs89JGQJ4TAnbhe2 mCVjJ1jzlY8LV0GfhvSj9gzsApPTC/V5/Ad5n5O3axLZp1xhWOSqSVN9Lk3LGeF1Q7Y5 WT711WH5B1O7NI/vV2hKv6YRG5+1z+mwZEfM9LcvQpfw7qf0iERIEZunReidacUYXlis rfRWh8mwGwVC6rs7EkVrvTmqpm9w/18S8Tyx+xza0udkLv80BInlO75ZPJL80pDaKzYP VO7X8L1XQdaXBNVrUnQ3Macxq2WhOhvT3wgTKvlPiw7WP0wYpj3WzPJTwdPbTvgTC2ab qxKQ== X-Gm-Message-State: ALoCoQlVRjOdLmbx1hRBAClrz8ynP7t6x43qNwvVKXmOblC98X0Dodz2TfTGCM6cRIe/yfeFSt88 X-Received: by 10.112.189.105 with SMTP id gh9mr9493311lbc.16.1441877005870; Thu, 10 Sep 2015 02:23:25 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.8 with SMTP id p8ls168527lag.29.gmail; Thu, 10 Sep 2015 02:23:25 -0700 (PDT) X-Received: by 10.112.168.100 with SMTP id zv4mr34410785lbb.117.1441877005527; Thu, 10 Sep 2015 02:23:25 -0700 (PDT) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com. [209.85.217.173]) by mx.google.com with ESMTPS id w7si9881775lal.27.2015.09.10.02.23.25 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Sep 2015 02:23:25 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by lbpo4 with SMTP id o4so19726079lbp.2 for ; Thu, 10 Sep 2015 02:23:25 -0700 (PDT) X-Received: by 10.112.169.66 with SMTP id ac2mr34032659lbc.32.1441877005409; Thu, 10 Sep 2015 02:23:25 -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.59.35 with SMTP id w3csp836132lbq; Thu, 10 Sep 2015 02:23:24 -0700 (PDT) X-Received: by 10.107.34.7 with SMTP id i7mr24089874ioi.76.1441877002813; Thu, 10 Sep 2015 02:23:22 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id k37si9776584iod.107.2015.09.10.02.23.19 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 10 Sep 2015 02:23:22 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:47899 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZy4d-0008Ub-2t for patch@linaro.org; Thu, 10 Sep 2015 05:23:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37616) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZxzf-0000i5-M4 for qemu-devel@nongnu.org; Thu, 10 Sep 2015 05:18:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZxza-0004ZZ-Kh for qemu-devel@nongnu.org; Thu, 10 Sep 2015 05:18:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39080) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZxza-0004ZV-DH; Thu, 10 Sep 2015 05:18:06 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id E9FAFC0AA273; Thu, 10 Sep 2015 09:18:05 +0000 (UTC) Received: from redhat.com (ovpn-116-92.ams2.redhat.com [10.36.116.92]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id t8A9I370019822; Thu, 10 Sep 2015 05:18:04 -0400 Date: Thu, 10 Sep 2015 12:18:03 +0300 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <1441876643-7467-8-git-send-email-mst@redhat.com> References: <1441876643-7467-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1441876643-7467-1-git-send-email-mst@redhat.com> X-Mutt-Fcc: =sent X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: qemu-trivial@nongnu.org, Peter Maydell , Laszlo Ersek , Don Koch Subject: [Qemu-devel] [PULL 7/7] 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: mst@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.173 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 From: Laszlo Ersek 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: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- 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 eba7ca2..ccea628 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 0a82f0c..1684a95 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"