From patchwork Thu Feb 18 09:46:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 384360 Delivered-To: patch@linaro.org Received: by 2002:a02:c80e:0:0:0:0:0 with SMTP id p14csp3525976jao; Thu, 18 Feb 2021 01:48:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJxDwl4OldEX3EqteqzrAJ5X1+IlNj9elP7tHc+Soyp6qcbZzCfA+2ZxFdeYKvdd7J3IMHx1 X-Received: by 2002:a25:5cd6:: with SMTP id q205mr5654386ybb.489.1613641723799; Thu, 18 Feb 2021 01:48:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613641723; cv=none; d=google.com; s=arc-20160816; b=v+MNcXmZAUk9GLhXmluxhyJHGxZrjfkW8PlxObXP70bXI9Zgwf042905CJXBGhMP2E ZYlX3M4uc06XsA8WcBOd9SbxcArDdUrUUFapg1URuOZCmZKGXfzBSO12tl64HxXqkm03 pR4l0Wbr5hc88VbeIyIa61r5/2fyPFKUn0awOLOBtJXJqtbM3uAj4hoffPMAB9EwIRD0 hn1BOGQVBQGGaFUbSTQHZMYR32InNiO13oJ0jF30ULZb3p6Kb6BIH+55FNW16lNn5aZ6 TKI6wGnrULo3iMIAZ5HH1zuwzATcyGvlW/9mG/rddItKYnMs8j1m6M91cyYa/oCGJ99E qJtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=t/CPTE/CDznZTD1WlBNg2STeH1CsnSCKnog1Lk63Lyg=; b=lTcy22ZtZYtZAJD4fV9bPMBYpu2NRjrYxx0EeS+sRZy9WzD7IGpz4kJNcQo7vnhcZ4 atrqt5qJYZxi4KkyJEXA9lwz2byRXhKq+QqTQtbd15w8bengugDLgNKkjl1gXuXRHJER ELkl1i0ugWUKB0N2mOObdVyRZE58RMEcgEqS3mHZJfyD/YadlNX2auZ1Q5xQKIUB6z1S 44oFULhhhv8dTosebG8wPfH8hwB9uh6jFrujUP0oQe5FI/v5OxkwXoQ6njU4lu0IqDGX tWEMpEv42OHYX/L0gMCgFxyLmoh357jmjMXXNywoZRU4QaNYSUH2yPIfDoG5baoLSiYM 7VgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=pCIRah91; 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=fail (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 185si5347778ybs.343.2021.02.18.01.48.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 18 Feb 2021 01:48:43 -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=fail header.i=@linaro.org header.s=google header.b=pCIRah91; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:57798 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lCfvP-0006g9-8x for patch@linaro.org; Thu, 18 Feb 2021 04:48:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53204) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lCfu3-0006fl-Jp for qemu-devel@nongnu.org; Thu, 18 Feb 2021 04:47:19 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:52207) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lCftu-0007BB-PP for qemu-devel@nongnu.org; Thu, 18 Feb 2021 04:47:19 -0500 Received: by mail-wm1-x32d.google.com with SMTP id o82so2315983wme.1 for ; Thu, 18 Feb 2021 01:47:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=t/CPTE/CDznZTD1WlBNg2STeH1CsnSCKnog1Lk63Lyg=; b=pCIRah91814QnDanVJeQlwWs77okqTntoCd9ZPyAedo4pkoESiHHTqf6ubHJUBkw7H ef3e310DFf7zwG/lGeqPHSn+GfFOke36U3pjDppNsfT3BiyIh8k9AK/oYMwC3o0Knkka iFqkyqxhx7S+BVuMZRg89FQLxlrVWR5ALEu3CqAsegczjjjhSC2InuPULK7Khc4Sfn9l iVqBFBd8Fe/02h/2wj5eoHDKezlFPhsY9q+K13m1xhSO5iGi/Xj5KovRgi3e29U3VzK3 mpZVpTGhoK1NIOTT1pOoAbQbv77WPGy+vzx04im12GY0fd8KPgLwBSJaBt9UslTZlMjj c66A== 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=t/CPTE/CDznZTD1WlBNg2STeH1CsnSCKnog1Lk63Lyg=; b=D947eQ6II2c6Ozozz8UOXtJ0SKXfpG1YsFd3npKsj6mf+pwSR34IwSNPYWrYOmWjg6 k+/2Jn7vAXiDWhSeImtMdzy/5V0kfIOR6gD18r35Yck276cwLCE6PzuZ5CDAWOAZJ5wg uXbKd6Ir3CoYklfuWsrMNiWfN5bUgS1IIzBCm62OsrmzlwWbDQ6NBZjnWkxQFNU+bBB9 m0WsXOvyS37TsSRtkDvWNmH5BpdERj6kc3+ruzpFd6sg3hUK/cUpeoG4vNhnQ3ryPdgS EpmtEjU2Yv+wHZoXHXj/FwoB7K4QxrJESvCLS/H04SHqR7zT1fGvM2P1bHY01cvza+Ap AtGQ== X-Gm-Message-State: AOAM530IJVVtVZn2OumuBX6ncYdQ73P0i3dKv1DqsUxSwC/Nk/ercFxJ xrMDHlfLO6VgnL91jYJuuFeUzw== X-Received: by 2002:a05:600c:204e:: with SMTP id p14mr2783475wmg.157.1613641629179; Thu, 18 Feb 2021 01:47:09 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id y15sm8004938wrm.93.2021.02.18.01.47.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Feb 2021 01:47:07 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 02F661FF87; Thu, 18 Feb 2021 09:47:07 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 01/23] hw/virtio/pci: include vdev name in registered PCI sections Date: Thu, 18 Feb 2021 09:46:44 +0000 Message-Id: <20210218094706.23038-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210218094706.23038-1-alex.bennee@linaro.org> References: <20210218094706.23038-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32d.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, "Michael S . Tsirkin" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" When viewing/debugging memory regions it is sometimes hard to figure out which PCI device something belongs to. Make the names unique by including the vdev name in the name string. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Michael S. Tsirkin Message-Id: <20210213130325.14781-2-alex.bennee@linaro.org> -- 2.20.1 diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 094c36aa3e..883045a223 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -1423,7 +1423,8 @@ static void virtio_pci_device_write(void *opaque, hwaddr addr, } } -static void virtio_pci_modern_regions_init(VirtIOPCIProxy *proxy) +static void virtio_pci_modern_regions_init(VirtIOPCIProxy *proxy, + const char *vdev_name) { static const MemoryRegionOps common_ops = { .read = virtio_pci_common_read, @@ -1470,36 +1471,41 @@ static void virtio_pci_modern_regions_init(VirtIOPCIProxy *proxy) }, .endianness = DEVICE_LITTLE_ENDIAN, }; + g_autoptr(GString) name = g_string_new(NULL); - + g_string_printf(name, "virtio-pci-common-%s", vdev_name); memory_region_init_io(&proxy->common.mr, OBJECT(proxy), &common_ops, proxy, - "virtio-pci-common", + name->str, proxy->common.size); + g_string_printf(name, "virtio-pci-isr-%s", vdev_name); memory_region_init_io(&proxy->isr.mr, OBJECT(proxy), &isr_ops, proxy, - "virtio-pci-isr", + name->str, proxy->isr.size); + g_string_printf(name, "virtio-pci-device-%s", vdev_name); memory_region_init_io(&proxy->device.mr, OBJECT(proxy), &device_ops, proxy, - "virtio-pci-device", + name->str, proxy->device.size); + g_string_printf(name, "virtio-pci-notify-%s", vdev_name); memory_region_init_io(&proxy->notify.mr, OBJECT(proxy), ¬ify_ops, proxy, - "virtio-pci-notify", + name->str, proxy->notify.size); + g_string_printf(name, "virtio-pci-notify-pio-%s", vdev_name); memory_region_init_io(&proxy->notify_pio.mr, OBJECT(proxy), ¬ify_pio_ops, proxy, - "virtio-pci-notify-pio", + name->str, proxy->notify_pio.size); } @@ -1654,7 +1660,7 @@ static void virtio_pci_device_plugged(DeviceState *d, Error **errp) struct virtio_pci_cfg_cap *cfg_mask; - virtio_pci_modern_regions_init(proxy); + virtio_pci_modern_regions_init(proxy, vdev->name); virtio_pci_modern_mem_region_map(proxy, &proxy->common, &cap); virtio_pci_modern_mem_region_map(proxy, &proxy->isr, &cap);