From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: qemu-devel@nongnu.org
Cc: "Aleksandar Rikalo" <aleksandar.rikalo@syrmia.com>,
"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
"KONRAD Frederic" <frederic.konrad@adacore.com>,
"Fabien Chouteau" <chouteau@adacore.com>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Aleksandar Markovic" <aleksandar.qemu.devel@gmail.com>,
"Artyom Tarasenko" <atar4qemu@gmail.com>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>,
"Aurelien Jarno" <aurelien@aurel32.net>
Subject: [PULL 07/16] hw/misc/empty_slot: Name the slots when created
Date: Tue, 9 Jun 2020 09:32:05 +0200 [thread overview]
Message-ID: <20200609073214.14079-8-f4bug@amsat.org> (raw)
In-Reply-To: <20200609073214.14079-1-f4bug@amsat.org>
Directly set the slot name when creating the device,
to display the device name in trace events.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Acked-by: Artyom Tarasenko <atar4qemu@gmail.com>
Message-Id: <20200510152840.13558-8-f4bug@amsat.org>
---
include/hw/misc/empty_slot.h | 2 +-
hw/mips/malta.c | 2 +-
hw/misc/empty_slot.c | 2 +-
hw/sparc/sun4m.c | 10 +++++++---
4 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/include/hw/misc/empty_slot.h b/include/hw/misc/empty_slot.h
index b023bc2d91..dec56e56ae 100644
--- a/include/hw/misc/empty_slot.h
+++ b/include/hw/misc/empty_slot.h
@@ -14,6 +14,6 @@
#include "exec/hwaddr.h"
-void empty_slot_init(hwaddr addr, uint64_t slot_size);
+void empty_slot_init(const char *name, hwaddr addr, uint64_t slot_size);
#endif
diff --git a/hw/mips/malta.c b/hw/mips/malta.c
index c973c76b2a..62063b2305 100644
--- a/hw/mips/malta.c
+++ b/hw/mips/malta.c
@@ -1241,7 +1241,7 @@ void mips_malta_init(MachineState *machine)
* exception when accessing invalid memory. Create an empty slot to
* emulate this feature.
*/
- empty_slot_init(0, 0x20000000);
+ empty_slot_init("GT64120", 0, 0x20000000);
qdev_init_nofail(dev);
diff --git a/hw/misc/empty_slot.c b/hw/misc/empty_slot.c
index 54be085189..b568ae202b 100644
--- a/hw/misc/empty_slot.c
+++ b/hw/misc/empty_slot.c
@@ -50,7 +50,7 @@ static const MemoryRegionOps empty_slot_ops = {
.endianness = DEVICE_NATIVE_ENDIAN,
};
-void empty_slot_init(hwaddr addr, uint64_t slot_size)
+void empty_slot_init(const char *name, hwaddr addr, uint64_t slot_size)
{
if (slot_size > 0) {
/* Only empty slots larger than 0 byte need handling. */
diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c
index a16e667bee..249f7ba7ea 100644
--- a/hw/sparc/sun4m.c
+++ b/hw/sparc/sun4m.c
@@ -884,7 +884,8 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef,
/* models without ECC don't trap when missing ram is accessed */
if (!hwdef->ecc_base) {
- empty_slot_init(machine->ram_size, hwdef->max_mem - machine->ram_size);
+ empty_slot_init("ecc", machine->ram_size,
+ hwdef->max_mem - machine->ram_size);
}
prom_init(hwdef->slavio_base, bios_name);
@@ -915,7 +916,8 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef,
Software shouldn't use aliased addresses, neither should it crash
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);
}
sparc32_dma_init(hwdef->dma_base,
@@ -964,7 +966,9 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef,
for (i = 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 = g_strdup_printf("vsimm[%d]", i);
+ empty_slot_init(name, hwdef->vsimm[i].reg_base, 0x2000);
+ g_free(name);
}
}
--
2.21.3
next prev parent reply other threads:[~2020-06-09 7:40 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-09 7:31 [PULL 00/16] SPARC patches for 2020-06-09 Philippe Mathieu-Daudé
2020-06-09 7:31 ` [PULL 01/16] hw/sparc/sun4m: Use UnimplementedDevice for I/O devices Philippe Mathieu-Daudé
2020-06-09 7:32 ` [PULL 02/16] hw/misc/empty_slot: Lower address space priority Philippe Mathieu-Daudé
2020-06-09 7:32 ` [PULL 03/16] hw/misc/empty_slot: Convert 'size' field as qdev property Philippe Mathieu-Daudé
2020-06-09 7:32 ` [PULL 04/16] hw/misc/empty_slot: Add a 'name' " Philippe Mathieu-Daudé
2020-06-09 7:32 ` [PULL 05/16] hw/misc/empty_slot: Convert debug printf() to trace event Philippe Mathieu-Daudé
2020-06-09 7:32 ` [PULL 06/16] hw/misc/empty_slot: Move the 'hw/misc' and cover in MAINTAINERS Philippe Mathieu-Daudé
2020-06-09 7:32 ` Philippe Mathieu-Daudé [this message]
2020-06-09 7:32 ` [PULL 08/16] hw/sparc/leon3: Map the UART device unconditionally Philippe Mathieu-Daudé
2020-06-09 7:32 ` [PULL 09/16] hw/sparc64/niagara: " Philippe Mathieu-Daudé
2020-06-09 7:32 ` [PULL 10/16] hw/sparc64/niagara: Remove duplicated NIAGARA_UART_BASE definition Philippe Mathieu-Daudé
2020-06-09 7:32 ` [PULL 11/16] hw/misc/grlib_ahb_apb_pnp: Avoid crash when writing to AHB PnP registers Philippe Mathieu-Daudé
2020-06-09 7:32 ` [PULL 12/16] hw/misc/grlib_ahb_apb_pnp: Fix AHB PnP 8-bit accesses Philippe Mathieu-Daudé
2020-06-09 7:32 ` [PULL 13/16] hw/misc/grlib_ahb_apb_pnp: Add trace events on read accesses Philippe Mathieu-Daudé
2020-06-09 7:32 ` [PULL 14/16] hw/timer/grlib_gptimer: Display frequency in decimal Philippe Mathieu-Daudé
2020-06-09 7:32 ` [PULL 15/16] target/sparc/int32_helper: Remove DEBUG_PCALL definition Philippe Mathieu-Daudé
2020-06-09 7:32 ` [PULL 16/16] target/sparc/int32_helper: Extract and use excp_name_str() Philippe Mathieu-Daudé
2020-06-09 20:29 ` [PULL 00/16] SPARC patches for 2020-06-09 Peter Maydell
2020-06-09 20:55 ` Mark Cave-Ayland
2020-06-11 13:30 ` Philippe Mathieu-Daudé
2020-06-11 13:35 ` Aleksandar Markovic
2020-06-11 13:45 ` Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200609073214.14079-8-f4bug@amsat.org \
--to=f4bug@amsat.org \
--cc=aleksandar.qemu.devel@gmail.com \
--cc=aleksandar.rikalo@syrmia.com \
--cc=atar4qemu@gmail.com \
--cc=aurelien@aurel32.net \
--cc=chouteau@adacore.com \
--cc=frederic.konrad@adacore.com \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).