From nobody Tue Feb 10 00:23:06 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1561414151; cv=none; d=zoho.com; s=zohoarc; b=OKL1vtuI0Vr+BOMFjMlZYKA1HpT8/zqTJcciSL18VPlvQkc9gY2iQSlsOIv12pXvoV4GcR//kmuFPXOdeDOTrYKZ1s1cmV7kSkvybOz26wWNh8t+yMCUAmViGbyROpI12oaklntQvVgXpBvAdG+5+3Z1EIS4T1gNef+L+djE3xc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561414151; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=IIHLqb+Tji18CeWo1iHa+k4D0J8xhz1pLarQhDAY1ak=; b=hyrcxgBmy0k6ZeTKWKV/Fhrj9jlJ3847EQP7hlENidPBiiD/ohBU3/Wfvlwa/QYtloPNm5C6zT9BG+WwaReXU3CrLRLndAXam8iCAvU1JxqUjYMN8rpWkbFIBK4GUR8K/g0CPgtRIrc1g4LBB3EF72EURdu4KlI/NUOa6MumiuQ= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1561414151316717.9860550389077; Mon, 24 Jun 2019 15:09:11 -0700 (PDT) Received: from localhost ([::1]:54910 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfX9C-00059P-Bh for importer@patchew.org; Mon, 24 Jun 2019 18:09:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54845) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfX29-0007tk-J9 for qemu-devel@nongnu.org; Mon, 24 Jun 2019 18:01:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfX27-00044m-GC for qemu-devel@nongnu.org; Mon, 24 Jun 2019 18:01:53 -0400 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:37203) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfX25-0003Cx-Ht for qemu-devel@nongnu.org; Mon, 24 Jun 2019 18:01:51 -0400 Received: by mail-wr1-x443.google.com with SMTP id v14so15514939wrr.4 for ; Mon, 24 Jun 2019 15:01:11 -0700 (PDT) Received: from x1.local (183.red-88-21-202.staticip.rima-tde.net. [88.21.202.183]) by smtp.gmail.com with ESMTPSA id z126sm1118612wmb.32.2019.06.24.15.01.09 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 24 Jun 2019 15:01:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IIHLqb+Tji18CeWo1iHa+k4D0J8xhz1pLarQhDAY1ak=; b=STvIRsYS7c4ixW9EM2qXv466H5GuFA4qgeyPVE2hktxzDJCyLso7WfRHGLs0WDrAnN 3AjygYnO6wxX2Kf8PToIpM1Va/x4z2+YfmZgWcMuvaH1HohCb3lolpTsOa+AFXRCy/ul zVGjFfWtvV5o6HMGW9HODZxPzTKNNO96aHOqp+Osy4+hrE8bSyFBxCvtrld9pHxLeADE KcKp0hYzwAlsBedmZfgAUGnaQIrVgpxX56SrdfUNFOtcIPk1KQ5bhF544fPdmYflVChi ft3w9urYvsm6bgiiZKgRS3zBcIKofp2Md2cB5sTqrE+zhe2a19qhdsb4AKQAHPIWDNWD b/5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=IIHLqb+Tji18CeWo1iHa+k4D0J8xhz1pLarQhDAY1ak=; b=E5HdQy4CA282XDPW5xJpb+eNOIZwDIN5eGKUgFtxFs+Y4Qj+9MZJekb8hHpf3OG/9Z QJ4CDi7Ib3d+7LLpZjaaV6Dvqab4Ri/qYQ7MMUrfFYACHmhpFa4bxySFFwL8+2ncYvc7 PT16RkoRXNhyLHuXO3+2CxBTHuA/Y4HCiW5WLiSWiGzo3ucpvaWB9bbFkpPzDRTppj5x CEq8Eyo/QYEf6PQcUTMuwr1K0/Hr/GzONAkXdURooYnIuSS2YaSG41+Av1lCNYnWr7Ar YwhzLG9f3Pb84uGS03CbZrIUxI1skLVdjX3PARAIBMigl/ptPRtF2EpDscAJ3Gu+Nqoj WeJg== X-Gm-Message-State: APjAAAUDciPUjg/x/GmQkIUD68wX1wlgPy2uDTlQz18RkWUWJUlrbjDH ZwI9tQvkCjMlvTquVQfMk9BUyHNW X-Google-Smtp-Source: APXvYqwOiq7JbOmk3mmwzAEUSz+GNrlGtkk0+NELdqvIv5ttHSyBIo0/MB7n1bl2JpFb0QGpbBxOVA== X-Received: by 2002:a5d:56cb:: with SMTP id m11mr14964052wrw.255.1561413670596; Mon, 24 Jun 2019 15:01:10 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Tue, 25 Jun 2019 00:00:56 +0200 Message-Id: <20190624220056.25861-10-f4bug@amsat.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190624220056.25861-1-f4bug@amsat.org> References: <20190624220056.25861-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::443 Subject: [Qemu-devel] [PATCH 9/9] hw/misc/empty_slot: Pass the slot name as argument 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: Peter Maydell , Aleksandar Rikalo , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Aleksandar Markovic , Artyom Tarasenko Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Use the slot name to have more meaningful tracing logs. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Artyom Tarasenko --- include/hw/misc/empty_slot.h | 3 ++- hw/mips/mips_malta.c | 2 +- hw/misc/empty_slot.c | 6 ++++-- hw/sparc/sun4m.c | 9 ++++++--- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/include/hw/misc/empty_slot.h b/include/hw/misc/empty_slot.h index 46483f24c3..d0cd989d2d 100644 --- a/include/hw/misc/empty_slot.h +++ b/include/hw/misc/empty_slot.h @@ -14,6 +14,7 @@ =20 /** * empty_slot_init: create and map a RAZ/WI device + * @name: name of the device for debug logging * @base: base address of the device's MMIO region * @size: size of the device's MMIO region * @@ -27,6 +28,6 @@ * use it to cover a large region and then map other devices on top of it * if necessary. */ -void empty_slot_init(hwaddr addr, uint64_t slot_size); +void empty_slot_init(const char *name, hwaddr addr, uint64_t slot_size); =20 #endif diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 7008be2e5b..51db5212be 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -1212,7 +1212,7 @@ void mips_malta_init(MachineState *machine) /* The whole address space decoded by the GT-64120A doesn't generate exception when accessing invalid memory. Create an empty slot to emulate this feature. */ - empty_slot_init(0, 0x20000000); + empty_slot_init("gt64120-ad", 0x00000000, 0x20000000); =20 qdev_init_nofail(dev); =20 diff --git a/hw/misc/empty_slot.c b/hw/misc/empty_slot.c index b810655554..396f9dd06a 100644 --- a/hw/misc/empty_slot.c +++ b/hw/misc/empty_slot.c @@ -52,12 +52,13 @@ static const MemoryRegionOps empty_slot_ops =3D { .endianness =3D DEVICE_NATIVE_ENDIAN, }; =20 -void empty_slot_init(hwaddr addr, uint64_t slot_size) +void empty_slot_init(const char *name, hwaddr addr, uint64_t slot_size) { DeviceState *dev; =20 dev =3D qdev_create(NULL, TYPE_EMPTY_SLOT); =20 + qdev_prop_set_string(dev, "name", name); qdev_prop_set_uint64(dev, "size", slot_size); qdev_init_nofail(dev); =20 @@ -77,7 +78,8 @@ static void empty_slot_realize(DeviceState *dev, Error **= errp) return; } if (s->name =3D=3D NULL) { - s->name =3D g_strdup("empty-slot"); + error_setg(errp, "property 'name' not specified"); + return; } =20 memory_region_init_io(&s->iomem, OBJECT(s), &empty_slot_ops, s, diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index d55753d5cb..b17be3ddb8 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -819,7 +819,7 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwd= ef, machine->ram_size); memory_region_add_subregion(get_system_memory(), 0x00000000, &ram); /* models without ECC don't trap when missing ram is accessed */ - empty_slot_init(0x00000000, hwdef->max_mem); + empty_slot_init("dram", 0x00000000, hwdef->max_mem); =20 /* init CPUs */ for(i =3D 0; i < smp_cpus; i++) { @@ -859,7 +859,8 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwd= ef, Software shouldn't use aliased addresses, neither should it cra= sh when does. Using empty_slot instead of aliasing can help with debugging such accesses */ - empty_slot_init(hwdef->iommu_pad_base,hwdef->iommu_pad_len); + empty_slot_init("iommu.alias", + hwdef->iommu_pad_base, hwdef->iommu_pad_len); } =20 sparc32_dma_init(hwdef->dma_base, @@ -908,7 +909,9 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwd= ef, for (i =3D 0; i < MAX_VSIMMS; i++) { /* vsimm registers probed by OBP */ if (hwdef->vsimm[i].reg_base) { - empty_slot_init(hwdef->vsimm[i].reg_base, 0x2000); + char *name =3D g_strdup_printf("vsimm[%d]", i); + empty_slot_init(name, hwdef->vsimm[i].reg_base, 0x2000); + g_free(name); } } =20 --=20 2.19.1