From patchwork Fri Jan 13 15:45:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 641997 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp288069pvb; Fri, 13 Jan 2023 08:09:06 -0800 (PST) X-Google-Smtp-Source: AMrXdXvo3HzDBgLvq97XEsvPiqY5S9tryt/R3K4w24s668q02eKPJc05AnvyAOowvNF181XZr4aI X-Received: by 2002:a05:6512:3fa1:b0:4b3:9b88:d9ce with SMTP id x33-20020a0565123fa100b004b39b88d9cemr33034596lfa.46.1673626145826; Fri, 13 Jan 2023 08:09:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673626145; cv=none; d=google.com; s=arc-20160816; b=Oi/+hsVNZzD92wTnff03PkgBwKGfLrMieulaEM0ESqC4itGpfBB03Vw2gd1OLu5RGv anSvjxmr6/QqFiYxBO3fWnJSD5YtfzaHxuHlz9qizll3qePmsPbZXm4CLdyovGL6ZzHy 1NtrmKyMWRGnrJDT5o1EP11BjU13GOsQe0YhOLmeC5UG4NHmFE98TzG4JvLRveuL3qS2 Udt4McUu3Voel1/OeoVuTFX6efse/jUHN5uCqPEInhpWZj0eWv/u5bY/HTQa5wM8cNRX SjNXqJ/hFfzQC/D6etHjrbGHRz6VEAxHn5DcJ2EzNh4hB/BrU+2O3nN9FF/NtGVnI0d5 +fRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3WSU7eqoou0ND/hnMQSDXwNv2R4bWt5GFJigtA+wKxc=; b=t0fikRcdSZlzB5s04tOiTzNZCv79CmSfUP3c6U6z2UV/jcKcUncSN5ydKqBeYhdsT3 Ct4eWk7URV28uVaCPPYw+fj8AfJpqYsD5nqtQ97+ADN71IgwMMmnz0m+EcyYPfmwpz4z R4NcDkuNI5sWkLVDDmpFklXvEnD6bjFeV4AARD6Q7+EbkJQB7eocf48Lx2mpkHavx+Sz jDGmhjpROU7l9LSv6WKWU33245KQCnpTTY26vzAkwNHNc3LIM4RBBYF6EHh6G/V1CQt7 //nL3wBrYqOzzA4iL6Nu5ykDASW2moONHFPPcB5Kx9C79zcQSqSEh1fSnpj5asfRxND9 BSyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=U713nI2U; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id k16-20020a05651210d000b0049ff976d9casi10840327lfg.36.2023.01.13.08.09.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Jan 2023 08:09:05 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=U713nI2U; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGMHi-0002a3-K6; Fri, 13 Jan 2023 10:48:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pGMHd-0002YJ-1O for qemu-devel@nongnu.org; Fri, 13 Jan 2023 10:48:00 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pGMHb-0006Rg-4R for qemu-devel@nongnu.org; Fri, 13 Jan 2023 10:47:56 -0500 Received: by mail-wm1-x32c.google.com with SMTP id f25-20020a1c6a19000000b003da221fbf48so1347634wmc.1 for ; Fri, 13 Jan 2023 07:47:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3WSU7eqoou0ND/hnMQSDXwNv2R4bWt5GFJigtA+wKxc=; b=U713nI2UYw0noBPlVXlb02z38asf3xlxabCS99/Z+USeGqPNGUOJdFfci31YAHV4Dp 3nZS08TUIC2EvotWnkydnxuZSJdwoHwuQ1jsC73OIev/mYdtEZEMlf7xbra7tfaeM0D+ UQbz4cyX/C/KAvrEk+3UZoCIbdGqAEzNgsnOBVbuZyL9yrWl6SIeHHrfX0jjmrXUFQi3 amzJQDhk2uRAXiMmGWI9h182oDWuo65Y6Bt0ukaSSY9wGrSxfICWOldj7yBx5FyW8BMz uNGCT3ISvpcQ+QYaMrR8zocb87bOvv/PT5pTP8et2kQVZBJqbDk1JZ1veq745y34NXGd /LQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3WSU7eqoou0ND/hnMQSDXwNv2R4bWt5GFJigtA+wKxc=; b=A7rPRPSCqCvrk0ht9IS4LDVNNnB504QCfKWWIxEylKfHrHw1rNT2+1Jr4/flJPnMAW WQmnqydYIdpJ64ld1vQM91KvjDt9TyaUKKZ/TBZsDyUb5iBDR37COShjgYBnWhtrZwg7 dRoJniKOoApW5fQ2P2j7zFP27R6YAXaJS6EL5ZowiVaikwdDRUa5Ns8bHChmo8oaxool JTwCI1XJfXgwZko7v+RkyCmrFJYmwL9qG5G1LUS0GcPeHyKHtU79oLiPRBUI+ztxYows +I5d63itS/YtLVBiij3VmfUWdWg8eHvld+ukkLsUsIfffZXnDC6TtL3Flq6N6ffAyC7L 3Cxg== X-Gm-Message-State: AFqh2kr1iBsSAFLnp8bq7H1WSFyhIitvovxtqoFw4Mnn10hbkrFvr++V WsCXR5cUwo5HyU0FpUj5EmJdpA6Q+/pmK1G/ X-Received: by 2002:a05:600c:4f84:b0:3d9:f758:e280 with SMTP id n4-20020a05600c4f8400b003d9f758e280mr13055657wmq.24.1673624874274; Fri, 13 Jan 2023 07:47:54 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id q1-20020a1ce901000000b003b3307fb98fsm24452136wmc.24.2023.01.13.07.47.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 13 Jan 2023 07:47:53 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 29/46] hw/pci/pci_host: Trace config accesses on unexisting functions Date: Fri, 13 Jan 2023 16:45:15 +0100 Message-Id: <20230113154532.49979-30-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230113154532.49979-1-philmd@linaro.org> References: <20230113154532.49979-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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 Currently we only emit trace events for existing PCI functions. In order to ease debugging PCI enumeration process, also emit for unexisting functions: $ qemu-system-foo -trace pci_cfg_\* ... pci_cfg_read empty 00:0a.4 @0x0 -> 0xffffffff pci_cfg_read empty 00:0a.5 @0x0 -> 0xffffffff pci_cfg_read empty 00:0a.6 @0x0 -> 0xffffffff pci_cfg_read empty 00:0a.7 @0x0 -> 0xffffffff pci_cfg_read pcnet 00:0b.0 @0x0 -> 0x20001022 pci_cfg_read empty 00:0c.0 @0x0 -> 0xffffffff pci_cfg_read empty 00:0d.0 @0x0 -> 0xffffffff pci_cfg_read empty 00:0e.0 @0x0 -> 0xffffffff pci_cfg_read empty 00:0f.0 @0x0 -> 0xffffffff pci_cfg_read empty 00:10.0 @0x0 -> 0xffffffff pci_cfg_read empty 00:11.0 @0x0 -> 0xffffffff pci_cfg_read cirrus-vga 00:12.0 @0x0 -> 0xb81013 Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20230104133935.4639-2-philmd@linaro.org> --- hw/pci/pci_host.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/pci/pci_host.c b/hw/pci/pci_host.c index eaf217ff55..ead1d3e61c 100644 --- a/hw/pci/pci_host.c +++ b/hw/pci/pci_host.c @@ -118,6 +118,9 @@ void pci_data_write(PCIBus *s, uint32_t addr, uint32_t val, unsigned len) uint32_t config_addr = addr & (PCI_CONFIG_SPACE_SIZE - 1); if (!pci_dev) { + trace_pci_cfg_write("empty", extract32(addr, 16, 8), + extract32(addr, 11, 5), extract32(addr, 8, 3), + config_addr, val); return; } @@ -131,6 +134,9 @@ uint32_t pci_data_read(PCIBus *s, uint32_t addr, unsigned len) uint32_t config_addr = addr & (PCI_CONFIG_SPACE_SIZE - 1); if (!pci_dev) { + trace_pci_cfg_read("empty", extract32(addr, 16, 8), + extract32(addr, 11, 5), extract32(addr, 8, 3), + config_addr, ~0x0); return ~0x0; }