Skip to contentSkip to conversation

SPARC patches for 2020-06-09

GIT PULL Applied Philippe Mathieu-Daudé 4 participants 22 messages Jun 9, 2020 – Jun 11, 2020

lore
Share & tools
lore
#0 lore raw

Hi Peter,

These are the latest SPARC patches sent to the list.

This pull request is with authorization of Artyom and Mark:
- https://www.mail-archive.com/[email protected]/msg710154.html
- https://www.mail-archive.com/[email protected]/msg710156.html

Frederic doesn't have his GPG key signed:
- https://www.mail-archive.com/[email protected]/msg706509.html

The following changes since commit 49ee11555262a256afec592dfed7c5902d5eefd2:

Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-5.1-pull-=
request' into staging (2020-06-08 11:04:57 +0100)

are available in the Git repository at:

https://gitlab.com/philmd/qemu.git tags/sparc-next-20200609

for you to fetch changes up to 86e8c353f705f14f2f2fd7a6195cefa431aa24d9:

target/sparc/int32_helper: Extract and use excp_name_str() (2020-06-09 09:2=
1:10 +0200)

----------------------------------------------------------------
SPARC patches

HW:
- Use UNIMP device instead of EMPTY_SLOT
- Make EMPTY_SLOT similar to UNIMP device
- Map UART devices unconditionally
- Pair of fixes for AHB PnP
- Add trace events to AHB PnP

TCG:
- Improve exception logging

CI:
- https://gitlab.com/philmd/qemu/-/pipelines/154231191
- https://travis-ci.org/github/philmd/qemu/builds/696321130

----------------------------------------------------------------

Philippe Mathieu-Daud=C3=A9 (16):
hw/sparc/sun4m: Use UnimplementedDevice for I/O devices hw/misc/empty_slot: Lower address space priority hw/misc/empty_slot: Convert 'size' field as qdev property hw/misc/empty_slot: Add a 'name' qdev property hw/misc/empty_slot: Convert debug printf() to trace event hw/misc/empty_slot: Move the 'hw/misc' and cover in MAINTAINERS hw/misc/empty_slot: Name the slots when created hw/sparc/leon3: Map the UART device unconditionally hw/sparc64/niagara: Map the UART device unconditionally hw/sparc64/niagara: Remove duplicated NIAGARA_UART_BASE definition hw/misc/grlib_ahb_apb_pnp: Avoid crash when writing to AHB PnP
registers
hw/misc/grlib_ahb_apb_pnp: Fix AHB PnP 8-bit accesses hw/misc/grlib_ahb_apb_pnp: Add trace events on read accesses hw/timer/grlib_gptimer: Display frequency in decimal target/sparc/int32_helper: Remove DEBUG_PCALL definition target/sparc/int32_helper: Extract and use excp_name_str()

 include/hw/empty_slot.h        |  9 -------
 include/hw/misc/empty_slot.h   | 19 ++++++++++++++
 hw/mips/malta.c                |  4 +--
 hw/{core =3D> misc}/empty_slot.c | 47 +++++++++++++++++++---------------
 hw/misc/grlib_ahb_apb_pnp.c    | 24 +++++++++++++++--
 hw/sparc/leon3.c               | 18 ++++++-------
 hw/sparc/sun4m.c               | 23 +++++++++++------
 hw/sparc64/niagara.c           |  7 ++---
 target/sparc/int32_helper.c    | 23 +++++++++--------
 MAINTAINERS                    |  7 +++++
 hw/core/Makefile.objs          |  1 -
 hw/misc/Makefile.objs          |  1 +
 hw/misc/trace-events           |  8 ++++++
 hw/sparc/Kconfig               |  1 +
 hw/timer/trace-events          |  2 +-
 15 files changed, 124 insertions(+), 70 deletions(-)
 delete mode 100644 include/hw/empty_slot.h
 create mode 100644 include/hw/misc/empty_slot.h
 rename hw/{core =3D> misc}/empty_slot.c (66%)

--=20
2.21.3

#1 lore raw

[PULL 02/16] hw/misc/empty_slot: Lower address space priority

Empty slots model RAZ/WI access on a bus. Since we can still (hot) plug devices on the bus, lower the slot priority, so device added later is accessed first.

Message-Id: <[email protected]>

---
 hw/core/empty_slot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/core/empty_slot.c +1 -1
index 3ba450e1ca..5ab426e965 100644
@@ -67,7 +67,7 @@ void empty_slot_init(hwaddr addr, uint64_t slot_size)
 
         qdev_init_nofail(dev);
 
-        sysbus_mmio_map(s, 0, addr);
+        sysbus_mmio_map_overlap(s, 0, addr, -10000);
     }
 }
 
Signature · 1 line
2.21.3
#2 lore raw

[PULL 03/16] hw/misc/empty_slot: Convert 'size' field as qdev property

In reply to Philippe Mathieu-Daudé

Message-Id: <[email protected]>

---
 hw/core/empty_slot.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)
hw/core/empty_slot.c +9 -6
index 5ab426e965..0df086fe98 100644
@@ -12,6 +12,7 @@
 #include "qemu/osdep.h"
 #include "hw/sysbus.h"
 #include "qemu/module.h"
+#include "hw/qdev-properties.h"
 #include "hw/empty_slot.h"
 
 //#define DEBUG_EMPTY_SLOT
@@ -57,17 +58,13 @@ void empty_slot_init(hwaddr addr, uint64_t slot_size)
     if (slot_size > 0) {
         /* Only empty slots larger than 0 byte need handling. */
         DeviceState *dev;
-        SysBusDevice *s;
-        EmptySlot *e;
 
         dev = qdev_create(NULL, TYPE_EMPTY_SLOT);
-        s = SYS_BUS_DEVICE(dev);
-        e = EMPTY_SLOT(dev);
-        e->size = slot_size;
 
+        qdev_prop_set_uint64(dev, "size", slot_size);
         qdev_init_nofail(dev);
 
-        sysbus_mmio_map_overlap(s, 0, addr, -10000);
+        sysbus_mmio_map_overlap(SYS_BUS_DEVICE(dev), 0, addr, -10000);
     }
 }
 
@@ -80,11 +77,17 @@ static void empty_slot_realize(DeviceState *dev, Error **errp)
     sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem);
 }
 
+static Property empty_slot_properties[] = {
+    DEFINE_PROP_UINT64("size", EmptySlot, size, 0),
+    DEFINE_PROP_END_OF_LIST(),
+};
+
 static void empty_slot_class_init(ObjectClass *klass, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
 
     dc->realize = empty_slot_realize;
+    device_class_set_props(dc, empty_slot_properties);
 }
 
 static const TypeInfo empty_slot_info = {
Signature · 1 line
2.21.3
#3 lore raw

[PULL 01/16] hw/sparc/sun4m: Use UnimplementedDevice for I/O devices

In reply to Philippe Mathieu-Daudé

These devices are not slots on a bus, but real I/O devices that we do not implement. As the ISDN ROM would be a ROMD device, also model it as UnimplementedDevice.

Message-Id: <[email protected]>

---
 hw/sparc/sun4m.c | 11 +++++++----
 hw/sparc/Kconfig |  1 +
 2 files changed, 8 insertions(+), 4 deletions(-)
hw/sparc/sun4m.c +7 -4
index 8dda3f7292..fa3dd7775f 100644
@@ -47,6 +47,7 @@
 #include "hw/nvram/fw_cfg.h"
 #include "hw/char/escc.h"
 #include "hw/empty_slot.h"
+#include "hw/misc/unimp.h"
 #include "hw/irq.h"
 #include "hw/loader.h"
 #include "elf.h"
@@ -968,7 +969,7 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef,
     }
 
     if (hwdef->sx_base) {
-        empty_slot_init(hwdef->sx_base, 0x2000);
+        create_unimplemented_device("SUNW,sx", hwdef->sx_base, 0x2000);
     }
 
     nvram = m48t59_init(slavio_irq[0], hwdef->nvram_base, 0, 0x2000, 1968, 8);
@@ -1031,14 +1032,16 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef,
     if (hwdef->dbri_base) {
         /* ISDN chip with attached CS4215 audio codec */
         /* prom space */
-        empty_slot_init(hwdef->dbri_base+0x1000, 0x30);
+        create_unimplemented_device("SUNW,DBRI.prom",
+                                    hwdef->dbri_base + 0x1000, 0x30);
         /* reg space */
-        empty_slot_init(hwdef->dbri_base+0x10000, 0x100);
+        create_unimplemented_device("SUNW,DBRI",
+                                    hwdef->dbri_base + 0x10000, 0x100);
     }
 
     if (hwdef->bpp_base) {
         /* parallel port */
-        empty_slot_init(hwdef->bpp_base, 0x20);
+        create_unimplemented_device("SUNW,bpp", hwdef->bpp_base, 0x20);
     }
 
     initrd_size = 0;
hw/sparc/Kconfig +1 -0
index 22aff2f5b7..91805afab6 100644
@@ -5,6 +5,7 @@ config SUN4M
     select CS4231
     select ECCMEMCTL
     select EMPTY_SLOT
+    select UNIMP
     select ESCC
     select ESP
     select FDC
Signature · 1 line
2.21.3
#4 lore raw

[PULL 04/16] hw/misc/empty_slot: Add a 'name' qdev property

In reply to Philippe Mathieu-Daudé

Add a 'name' qdev property so when multiple slots are accessed, we can notice which one is accessed.

Message-Id: <[email protected]>

---
 hw/core/empty_slot.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
hw/core/empty_slot.c +6 -1
index 0df086fe98..576b276c4b 100644
@@ -31,6 +31,7 @@ typedef struct EmptySlot {
     SysBusDevice parent_obj;
 
     MemoryRegion iomem;
+    char *name;
     uint64_t size;
 } EmptySlot;
 
@@ -72,13 +73,17 @@ static void empty_slot_realize(DeviceState *dev, Error **errp)
 {
     EmptySlot *s = EMPTY_SLOT(dev);
 
+    if (s->name == NULL) {
+        s->name = g_strdup("empty-slot");
+    }
     memory_region_init_io(&s->iomem, OBJECT(s), &empty_slot_ops, s,
-                          "empty-slot", s->size);
+                          s->name, s->size);
     sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem);
 }
 
 static Property empty_slot_properties[] = {
     DEFINE_PROP_UINT64("size", EmptySlot, size, 0),
+    DEFINE_PROP_STRING("name", EmptySlot, name),
     DEFINE_PROP_END_OF_LIST(),
 };
 
Signature · 1 line
2.21.3
#5 lore raw

[PULL 06/16] hw/misc/empty_slot: Move the 'hw/misc' and cover in MAINTAINERS

In reply to Philippe Mathieu-Daudé

Add an entry for the 'empty_slot' device.

Message-Id: <[email protected]>

---
 include/hw/empty_slot.h        |  9 ---------
 include/hw/misc/empty_slot.h   | 19 +++++++++++++++++++
 hw/mips/malta.c                |  2 +-
 hw/{core => misc}/empty_slot.c |  4 ++--
 hw/sparc/sun4m.c               |  2 +-
 MAINTAINERS                    |  7 +++++++
 hw/core/Makefile.objs          |  1 -
 hw/core/trace-events           |  4 ----
 hw/misc/Makefile.objs          |  1 +
 hw/misc/trace-events           |  4 ++++
 10 files changed, 35 insertions(+), 18 deletions(-)
 delete mode 100644 include/hw/empty_slot.h
 create mode 100644 include/hw/misc/empty_slot.h
 rename hw/{core => misc}/empty_slot.c (96%)
include/hw/empty_slot.h deleted +0 -9
deleted file mode 100644
index cb9a221aa6..0000000000
@@ -1,9 +0,0 @@
-#ifndef HW_EMPTY_SLOT_H
-#define HW_EMPTY_SLOT_H
-
-#include "exec/hwaddr.h"
-
-/* empty_slot.c */
-void empty_slot_init(hwaddr addr, uint64_t slot_size);
-
-#endif
include/hw/misc/empty_slot.h new file +19 -0
new file mode 100644
index 0000000000..b023bc2d91
@@ -0,0 +1,19 @@
+/*
+ * QEMU Empty Slot
+ *
+ * The empty_slot device emulates known to a bus but not connected devices.
+ *
+ * Copyright (c) 2010 Artyom Tarasenko
+ *
+ * This code is licensed under the GNU GPL v2 or (at your option) any later
+ * version.
+ */
+
+#ifndef HW_EMPTY_SLOT_H
+#define HW_EMPTY_SLOT_H
+
+#include "exec/hwaddr.h"
+
+void empty_slot_init(hwaddr addr, uint64_t slot_size);
+
+#endif
hw/mips/malta.c +1 -1
index 636c95d1fe..c973c76b2a 100644
@@ -52,7 +52,7 @@
 #include "sysemu/runstate.h"
 #include "qapi/error.h"
 #include "qemu/error-report.h"
-#include "hw/empty_slot.h"
+#include "hw/misc/empty_slot.h"
 #include "sysemu/kvm.h"
 #include "hw/semihosting/semihost.h"
 #include "hw/mips/cps.h"
hw/misc/empty_slot.c renamed from hw/core/empty_slot.c +2 -2
similarity index 96%
rename from hw/core/empty_slot.c
rename to hw/misc/empty_slot.c
index d28f7f99c9..54be085189 100644
@@ -11,9 +11,8 @@
 
 #include "qemu/osdep.h"
 #include "hw/sysbus.h"
-#include "qemu/module.h"
 #include "hw/qdev-properties.h"
-#include "hw/empty_slot.h"
+#include "hw/misc/empty_slot.h"
 #include "trace.h"
 
 #define TYPE_EMPTY_SLOT "empty_slot"
@@ -90,6 +89,7 @@ static void empty_slot_class_init(ObjectClass *klass, void *data)
 
     dc->realize = empty_slot_realize;
     device_class_set_props(dc, empty_slot_properties);
+    set_bit(DEVICE_CATEGORY_MISC, dc->categories);
 }
 
 static const TypeInfo empty_slot_info = {
hw/sparc/sun4m.c +1 -1
index fa3dd7775f..a16e667bee 100644
@@ -46,7 +46,7 @@
 #include "hw/nvram/chrp_nvram.h"
 #include "hw/nvram/fw_cfg.h"
 #include "hw/char/escc.h"
-#include "hw/empty_slot.h"
+#include "hw/misc/empty_slot.h"
 #include "hw/misc/unimp.h"
 #include "hw/irq.h"
 #include "hw/loader.h"
MAINTAINERS +7 -0
index 6e7890ce82..3abe3faa4e 100644
@@ -1864,6 +1864,13 @@ S: Maintained
 F: include/hw/misc/unimp.h
 F: hw/misc/unimp.c
 
+Empty slot
+M: Artyom Tarasenko <[email protected]>
+R: Philippe Mathieu-Daudé <[email protected]>
+S: Maintained
+F: include/hw/misc/empty_slot.h
+F: hw/misc/empty_slot.c
+
 Standard VGA
 M: Gerd Hoffmann <[email protected]>
 S: Maintained
hw/core/Makefile.objs +0 -1
index 1d540ed6e7..d8fee8effe 100644
@@ -24,7 +24,6 @@ common-obj-$(CONFIG_SOFTMMU) += numa.o
 common-obj-$(CONFIG_SOFTMMU) += clock-vmstate.o
 obj-$(CONFIG_SOFTMMU) += machine-qmp-cmds.o
 
-common-obj-$(CONFIG_EMPTY_SLOT) += empty_slot.o
 common-obj-$(CONFIG_XILINX_AXI) += stream.o
 common-obj-$(CONFIG_PTIMER) += ptimer.o
 common-obj-$(CONFIG_FITLOADER) += loader-fit.o
hw/core/trace-events +0 -4
index bbb68fb6f0..1ac60ede6b 100644
@@ -34,7 +34,3 @@ clock_disconnect(const char *clk) "'%s'"
 clock_set(const char *clk, uint64_t old, uint64_t new) "'%s', ns=%"PRIu64"->%"PRIu64
 clock_propagate(const char *clk) "'%s'"
 clock_update(const char *clk, const char *src, uint64_t val, int cb) "'%s', src='%s', ns=%"PRIu64", cb=%d"
-
-# empty_slot.c
-empty_slot_read(uint64_t addr, unsigned width, uint64_t value, unsigned size, const char *name) "rd addr:0x%04"PRIx64" data:0x%0*"PRIx64" size %u [%s]"
-empty_slot_write(uint64_t addr, unsigned width, uint64_t value, unsigned size, const char *name) "wr addr:0x%04"PRIx64" data:0x%0*"PRIx64" size %u [%s]"
hw/misc/Makefile.objs +1 -0
index 60a9d80b74..5aaca8a039 100644
@@ -10,6 +10,7 @@ common-obj-$(CONFIG_EDU) += edu.o
 common-obj-$(CONFIG_PCA9552) += pca9552.o
 
 common-obj-$(CONFIG_UNIMP) += unimp.o
+common-obj-$(CONFIG_EMPTY_SLOT) += empty_slot.o
 common-obj-$(CONFIG_FW_CFG_DMA) += vmcoreinfo.o
 
 # ARM devices
hw/misc/trace-events +4 -0
index a5862b2bed..0cb4c64ae7 100644
@@ -39,6 +39,10 @@ ecc_mem_readl_ecr1(uint32_t ret) "Read event count 2 0x%08x"
 ecc_diag_mem_writeb(uint64_t addr, uint32_t val) "Write diagnostic %"PRId64" = 0x%02x"
 ecc_diag_mem_readb(uint64_t addr, uint32_t ret) "Read diagnostic %"PRId64"= 0x%02x"
 
+# empty_slot.c
+empty_slot_read(uint64_t addr, unsigned width, uint64_t value, unsigned size, const char *name) "rd addr:0x%04"PRIx64" data:0x%0*"PRIx64" size %u [%s]"
+empty_slot_write(uint64_t addr, unsigned width, uint64_t value, unsigned size, const char *name) "wr addr:0x%04"PRIx64" data:0x%0*"PRIx64" size %u [%s]"
+
 # slavio_misc.c
 slavio_misc_update_irq_raise(void) "Raise IRQ"
 slavio_misc_update_irq_lower(void) "Lower IRQ"
Signature · 1 line
2.21.3
#6 lore raw

[PULL 05/16] hw/misc/empty_slot: Convert debug printf() to trace event

In reply to Philippe Mathieu-Daudé

Message-Id: <[email protected]>

---
 hw/core/empty_slot.c | 19 ++++++++-----------
 hw/core/trace-events |  4 ++++
 2 files changed, 12 insertions(+), 11 deletions(-)
hw/core/empty_slot.c +8 -11
index 576b276c4b..d28f7f99c9 100644
@@ -14,15 +14,7 @@
 #include "qemu/module.h"
 #include "hw/qdev-properties.h"
 #include "hw/empty_slot.h"
-
-//#define DEBUG_EMPTY_SLOT
-
-#ifdef DEBUG_EMPTY_SLOT
-#define DPRINTF(fmt, ...)                                       \
-    do { printf("empty_slot: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) do {} while (0)
-#endif
+#include "trace.h"
 
 #define TYPE_EMPTY_SLOT "empty_slot"
 #define EMPTY_SLOT(obj) OBJECT_CHECK(EmptySlot, (obj), TYPE_EMPTY_SLOT)
@@ -38,14 +30,19 @@ typedef struct EmptySlot {
 static uint64_t empty_slot_read(void *opaque, hwaddr addr,
                                 unsigned size)
 {
-    DPRINTF("read from " TARGET_FMT_plx "\n", addr);
+    EmptySlot *s = EMPTY_SLOT(opaque);
+
+    trace_empty_slot_write(addr, size << 1, 0, size, s->name);
+
     return 0;
 }
 
 static void empty_slot_write(void *opaque, hwaddr addr,
                              uint64_t val, unsigned size)
 {
-    DPRINTF("write 0x%x to " TARGET_FMT_plx "\n", (unsigned)val, addr);
+    EmptySlot *s = EMPTY_SLOT(opaque);
+
+    trace_empty_slot_write(addr, size << 1, val, size, s->name);
 }
 
 static const MemoryRegionOps empty_slot_ops = {
hw/core/trace-events +4 -0
index 1ac60ede6b..bbb68fb6f0 100644
@@ -34,3 +34,7 @@ clock_disconnect(const char *clk) "'%s'"
 clock_set(const char *clk, uint64_t old, uint64_t new) "'%s', ns=%"PRIu64"->%"PRIu64
 clock_propagate(const char *clk) "'%s'"
 clock_update(const char *clk, const char *src, uint64_t val, int cb) "'%s', src='%s', ns=%"PRIu64", cb=%d"
+
+# empty_slot.c
+empty_slot_read(uint64_t addr, unsigned width, uint64_t value, unsigned size, const char *name) "rd addr:0x%04"PRIx64" data:0x%0*"PRIx64" size %u [%s]"
+empty_slot_write(uint64_t addr, unsigned width, uint64_t value, unsigned size, const char *name) "wr addr:0x%04"PRIx64" data:0x%0*"PRIx64" size %u [%s]"
Signature · 1 line
2.21.3
#7 lore raw

[PULL 13/16] hw/misc/grlib_ahb_apb_pnp: Add trace events on read accesses

In reply to Philippe Mathieu-Daudé

Message-Id: <[email protected]>

---
 hw/misc/grlib_ahb_apb_pnp.c | 13 +++++++++++--
 hw/misc/trace-events        |  4 ++++
 2 files changed, 15 insertions(+), 2 deletions(-)
hw/misc/grlib_ahb_apb_pnp.c +11 -2
index d22ed00206..43e001c3c7 100644
@@ -25,6 +25,7 @@
 #include "qemu/log.h"
 #include "hw/sysbus.h"
 #include "hw/misc/grlib_ahb_apb_pnp.h"
+#include "trace.h"
 
 #define GRLIB_PNP_VENDOR_SHIFT (24)
 #define GRLIB_PNP_VENDOR_SIZE   (8)
@@ -132,8 +133,12 @@ void grlib_ahb_pnp_add_entry(AHBPnp *dev, uint32_t address, uint32_t mask,
 static uint64_t grlib_ahb_pnp_read(void *opaque, hwaddr offset, unsigned size)
 {
     AHBPnp *ahb_pnp = GRLIB_AHB_PNP(opaque);
+    uint32_t val;
 
-    return ahb_pnp->regs[offset >> 2];
+    val = ahb_pnp->regs[offset >> 2];
+    trace_grlib_ahb_pnp_read(offset, val);
+
+    return val;
 }
 
 static void grlib_ahb_pnp_write(void *opaque, hwaddr addr,
@@ -239,8 +244,12 @@ void grlib_apb_pnp_add_entry(APBPnp *dev, uint32_t address, uint32_t mask,
 static uint64_t grlib_apb_pnp_read(void *opaque, hwaddr offset, unsigned size)
 {
     APBPnp *apb_pnp = GRLIB_APB_PNP(opaque);
+    uint32_t val;
 
-    return apb_pnp->regs[offset >> 2];
+    val = apb_pnp->regs[offset >> 2];
+    trace_grlib_apb_pnp_read(offset, val);
+
+    return val;
 }
 
 static void grlib_apb_pnp_write(void *opaque, hwaddr addr,
hw/misc/trace-events +4 -0
index 0cb4c64ae7..5561746866 100644
@@ -202,3 +202,7 @@ via1_rtc_cmd_pram_read(int addr, int value) "addr=%u value=0x%02x"
 via1_rtc_cmd_pram_write(int addr, int value) "addr=%u value=0x%02x"
 via1_rtc_cmd_pram_sect_read(int sector, int offset, int addr, int value) "sector=%u offset=%u addr=%d value=0x%02x"
 via1_rtc_cmd_pram_sect_write(int sector, int offset, int addr, int value) "sector=%u offset=%u addr=%d value=0x%02x"
+
+# grlib_ahb_apb_pnp.c
+grlib_ahb_pnp_read(uint64_t addr, uint32_t value) "AHB PnP read addr:0x%03"PRIx64" data:0x%08x"
+grlib_apb_pnp_read(uint64_t addr, uint32_t value) "APB PnP read addr:0x%03"PRIx64" data:0x%08x"
Signature · 1 line
2.21.3
#8 lore raw

[PULL 16/16] target/sparc/int32_helper: Extract and use excp_name_str()

In reply to Philippe Mathieu-Daudé

Improve exception error report:

Before:

qemu: fatal: Trap 0x06 while interrupts disabled, Error state

After:

qemu: fatal: Trap 0x06 (Window Underflow) while interrupts disabled, Error state

Message-Id: <[email protected]>

---
 target/sparc/int32_helper.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
target/sparc/int32_helper.c +12 -6
index c56dd3df18..9a71e1abd8 100644
@@ -57,6 +57,14 @@ static const char * const excp_names[0x80] = {
     [TT_NCP_INSN] = "Coprocessor Disabled",
 };
 
+static const char *excp_name_str(int32_t exception_index)
+{
+    if (exception_index < 0 || exception_index >= ARRAY_SIZE(excp_names)) {
+        return "Unknown";
+    }
+    return excp_names[exception_index];
+}
+
 void sparc_cpu_do_interrupt(CPUState *cs)
 {
     SPARCCPU *cpu = SPARC_CPU(cs);
@@ -77,10 +85,7 @@ void sparc_cpu_do_interrupt(CPUState *cs)
         } else if (intno >= 0x80) {
             name = "Trap Instruction";
         } else {
-            name = excp_names[intno];
-            if (!name) {
-                name = "Unknown";
-            }
+            name = excp_name_str(intno);
         }
 
         qemu_log("%6d: %s (v=%02x)\n", count, name, intno);
@@ -106,8 +111,9 @@ void sparc_cpu_do_interrupt(CPUState *cs)
             env->def.features & CPU_FEATURE_TA0_SHUTDOWN) {
             qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN);
         } else {
-            cpu_abort(cs, "Trap 0x%02x while interrupts disabled, Error state",
-                      cs->exception_index);
+            cpu_abort(cs, "Trap 0x%02x (%s) while interrupts disabled, "
+                          "Error state",
+                      cs->exception_index, excp_name_str(cs->exception_index));
         }
         return;
     }
Signature · 1 line
2.21.3
#9 lore raw

[PULL 10/16] hw/sparc64/niagara: Remove duplicated NIAGARA_UART_BASE definition

In reply to Philippe Mathieu-Daudé

NIAGARA_UART_BASE is already defined few lines earlier.

Message-Id: <[email protected]>

---
 hw/sparc64/niagara.c | 1 -
 1 file changed, 1 deletion(-)
hw/sparc64/niagara.c +0 -1
index 148a26890e..a87d55f6bb 100644
@@ -68,7 +68,6 @@ typedef struct NiagaraBoardState {
 
 #define NIAGARA_VDISK_BASE  0x1f40000000ULL
 #define NIAGARA_RTC_BASE    0xfff0c1fff8ULL
-#define NIAGARA_UART_BASE   0x1f10000000ULL
 
 /* Firmware layout
  *
Signature · 1 line
2.21.3
#10 lore raw

[PULL 08/16] hw/sparc/leon3: Map the UART device unconditionally

In reply to Philippe Mathieu-Daudé

The UART is present on the chipset regardless there is a character device connected to it. Map it unconditionally.

Message-Id: <[email protected]>

---
 hw/sparc/leon3.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)
hw/sparc/leon3.c +8 -10
index 8f024dab7b..cc55117dec 100644
@@ -339,16 +339,14 @@ static void leon3_generic_hw_init(MachineState *machine)
                             0, LEON3_TIMER_IRQ, GRLIB_APBIO_AREA);
 
     /* Allocate uart */
-    if (serial_hd(0)) {
-        dev = qdev_create(NULL, TYPE_GRLIB_APB_UART);
-        qdev_prop_set_chr(dev, "chrdev", serial_hd(0));
-        qdev_init_nofail(dev);
-        sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, LEON3_UART_OFFSET);
-        sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, cpu_irqs[LEON3_UART_IRQ]);
-        grlib_apb_pnp_add_entry(apb_pnp, LEON3_UART_OFFSET, 0xFFF,
-                                GRLIB_VENDOR_GAISLER, GRLIB_APBUART_DEV, 1,
-                                LEON3_UART_IRQ, GRLIB_APBIO_AREA);
-    }
+    dev = qdev_create(NULL, TYPE_GRLIB_APB_UART);
+    qdev_prop_set_chr(dev, "chrdev", serial_hd(0));
+    qdev_init_nofail(dev);
+    sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, LEON3_UART_OFFSET);
+    sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, cpu_irqs[LEON3_UART_IRQ]);
+    grlib_apb_pnp_add_entry(apb_pnp, LEON3_UART_OFFSET, 0xFFF,
+                            GRLIB_VENDOR_GAISLER, GRLIB_APBUART_DEV, 1,
+                            LEON3_UART_IRQ, GRLIB_APBIO_AREA);
 }
 
 static void leon3_generic_machine_init(MachineClass *mc)
Signature · 1 line
2.21.3
#11 lore raw

[PULL 12/16] hw/misc/grlib_ahb_apb_pnp: Fix AHB PnP 8-bit accesses

In reply to Philippe Mathieu-Daudé

The Plug & Play region of the AHB/APB bridge can be accessed by various word size, however the implementation is clearly restricted to 32-bit:

  static uint64_t grlib_ahb_pnp_read(void *opaque, hwaddr offset, unsigned size)
  {
      AHBPnp *ahb_pnp = GRLIB_AHB_PNP(opaque);
      return ahb_pnp->regs[offset >> 2];

}

Similarly to commit 0fbe394a64 with the APB PnP registers, set the MemoryRegionOps::impl min/max fields to 32-bit, so memory.c::access_with_adjusted_size() can adjust when the access is not 32-bit.

Message-Id: <[email protected]>

---
 hw/misc/grlib_ahb_apb_pnp.c | 4 ++++
 1 file changed, 4 insertions(+)
hw/misc/grlib_ahb_apb_pnp.c +4 -0
index 72a8764776..d22ed00206 100644
@@ -146,6 +146,10 @@ static const MemoryRegionOps grlib_ahb_pnp_ops = {
     .read       = grlib_ahb_pnp_read,
     .write      = grlib_ahb_pnp_write,
     .endianness = DEVICE_BIG_ENDIAN,
+    .impl = {
+        .min_access_size = 4,
+        .max_access_size = 4,
+    },
 };
 
 static void grlib_ahb_pnp_realize(DeviceState *dev, Error **errp)
Signature · 1 line
2.21.3
#12 lore raw

[PULL 07/16] hw/misc/empty_slot: Name the slots when created

In reply to Philippe Mathieu-Daudé

Directly set the slot name when creating the device, to display the device name in trace events.

Message-Id: <[email protected]>

---
 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(-)
include/hw/misc/empty_slot.h +1 -1
index b023bc2d91..dec56e56ae 100644
@@ -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
hw/mips/malta.c +1 -1
index c973c76b2a..62063b2305 100644
@@ -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);
 
hw/misc/empty_slot.c +1 -1
index 54be085189..b568ae202b 100644
@@ -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. */
hw/sparc/sun4m.c +7 -3
index a16e667bee..249f7ba7ea 100644
@@ -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);
         }
     }
 
Signature · 1 line
2.21.3
#13 lore raw

[PULL 09/16] hw/sparc64/niagara: Map the UART device unconditionally

In reply to Philippe Mathieu-Daudé

The UART is present on the machine regardless there is a character device connected to it. Map it unconditionally.

Message-Id: <[email protected]>

---
 hw/sparc64/niagara.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
hw/sparc64/niagara.c +2 -4
index ab5ef8c5b3..148a26890e 100644
@@ -152,10 +152,8 @@ static void niagara_init(MachineState *machine)
             exit(1);
         }
     }
-    if (serial_hd(0)) {
-        serial_mm_init(sysmem, NIAGARA_UART_BASE, 0, NULL, 115200,
-                       serial_hd(0), DEVICE_BIG_ENDIAN);
-    }
+    serial_mm_init(sysmem, NIAGARA_UART_BASE, 0, NULL,
+                   115200, serial_hd(0), DEVICE_BIG_ENDIAN);
     create_unimplemented_device("sun4v-iob", NIAGARA_IOBBASE, NIAGARA_IOBSIZE);
     sun4v_rtc_init(NIAGARA_RTC_BASE);
 }
Signature · 1 line
2.21.3
#14 lore raw

[PULL 14/16] hw/timer/grlib_gptimer: Display frequency in decimal

In reply to Philippe Mathieu-Daudé

Message-Id: <[email protected]>

---
 hw/timer/trace-events | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/timer/trace-events +1 -1
index 80ea197594..866c9f546a 100644
@@ -19,7 +19,7 @@ slavio_timer_mem_writel_invalid(uint64_t addr) "invalid write address 0x%"PRIx64
 grlib_gptimer_enable(int id, uint32_t count) "timer:%d set count 0x%x and run"
 grlib_gptimer_disabled(int id, uint32_t config) "timer:%d Timer disable config 0x%x"
 grlib_gptimer_restart(int id, uint32_t reload) "timer:%d reload val: 0x%x"
-grlib_gptimer_set_scaler(uint32_t scaler, uint32_t freq) "scaler:0x%x freq: 0x%x"
+grlib_gptimer_set_scaler(uint32_t scaler, uint32_t freq) "scaler:0x%x freq:%uHz"
 grlib_gptimer_hit(int id) "timer:%d HIT"
 grlib_gptimer_readl(int id, uint64_t addr, uint32_t val) "timer:%d addr 0x%"PRIx64" 0x%x"
 grlib_gptimer_writel(int id, uint64_t addr, uint32_t val) "timer:%d addr 0x%"PRIx64" 0x%x"
Signature · 1 line
2.21.3
#15 lore raw

[PULL 11/16] hw/misc/grlib_ahb_apb_pnp: Avoid crash when writing to AHB PnP registers

In reply to Philippe Mathieu-Daudé

Similarly to commit 158b659451 with the APB PnP registers, guests can crash QEMU when writting to the AHB PnP registers:

  $ echo 'writeb 0xfffff042 69' | qemu-system-sparc -M leon3_generic -S -bios /etc/magic -qtest stdio
  [I 1571938309.932255] OPENED
  [R +0.063474] writeb 0xfffff042 69
  Segmentation fault (core dumped)

(gdb) bt
#0 0x0000000000000000 in ()
#1 0x0000562999110df4 in memory_region_write_with_attrs_accessor

      (mr=mr@entry=0x56299aa28ea0, addr=66, value=value@entry=0x7fff6abe13b8, size=size@entry=1, shift=<optimized out>, mask=mask@entry=255, attrs=...) at memory.c:503
  #2  0x000056299911095e in access_with_adjusted_size
      (addr=addr@entry=66, value=value@entry=0x7fff6abe13b8, size=size@entry=1, access_size_min=<optimized out>, access_size_max=<optimized out>, access_fn=access_fn@entry=
      0x562999110d70 <memory_region_write_with_attrs_accessor>, mr=0x56299aa28ea0, attrs=...) at memory.c:539
  #3  0x0000562999114fba in memory_region_dispatch_write (mr=mr@entry=0x56299aa28ea0, addr=66, data=<optimized out>, op=<optimized out>, attrs=attrs@entry=...) at memory.c:1482
  #4  0x00005629990c0860 in flatview_write_continue
      (fv=fv@entry=0x56299aa7d8a0, addr=addr@entry=4294963266, attrs=..., ptr=ptr@entry=0x7fff6abe1540, len=len@entry=1, addr1=<optimized out>, l=<optimized out>, mr=0x56299aa28ea0)
      at include/qemu/host-utils.h:164
  #5  0x00005629990c0a76 in flatview_write (fv=0x56299aa7d8a0, addr=4294963266, attrs=..., buf=0x7fff6abe1540, len=1) at exec.c:3165
  #6  0x00005629990c4c1b in address_space_write (as=<optimized out>, addr=<optimized out>, attrs=..., attrs@entry=..., buf=buf@entry=0x7fff6abe1540, len=len@entry=1) at exec.c:3256
  #7  0x000056299910f807 in qtest_process_command (chr=chr@entry=0x5629995ee920 <qtest_chr>, words=words@entry=0x56299acfcfa0) at qtest.c:437

Instead of crashing, log the access as unimplemented.

Message-Id: <[email protected]>

---
 hw/misc/grlib_ahb_apb_pnp.c | 7 +++++++
 1 file changed, 7 insertions(+)
hw/misc/grlib_ahb_apb_pnp.c +7 -0
index e230e25363..72a8764776 100644
@@ -136,8 +136,15 @@ static uint64_t grlib_ahb_pnp_read(void *opaque, hwaddr offset, unsigned size)
     return ahb_pnp->regs[offset >> 2];
 }
 
+static void grlib_ahb_pnp_write(void *opaque, hwaddr addr,
+                                uint64_t val, unsigned size)
+{
+    qemu_log_mask(LOG_UNIMP, "%s not implemented\n", __func__);
+}
+
 static const MemoryRegionOps grlib_ahb_pnp_ops = {
     .read       = grlib_ahb_pnp_read,
+    .write      = grlib_ahb_pnp_write,
     .endianness = DEVICE_BIG_ENDIAN,
 };
 
Signature · 1 line
2.21.3
#16 lore raw

[PULL 15/16] target/sparc/int32_helper: Remove DEBUG_PCALL definition

In reply to Philippe Mathieu-Daudé

We define DEBUG_PCALL since b884fc5e (2012-10-06). 7.5 years later it is safe to assume we can remove it :)

Message-Id: <[email protected]>

---
 target/sparc/int32_helper.c | 5 -----
 1 file changed, 5 deletions(-)
target/sparc/int32_helper.c +0 -5
index 813b47dbb2..c56dd3df18 100644
@@ -23,9 +23,7 @@
 #include "exec/log.h"
 #include "sysemu/runstate.h"
 
-#define DEBUG_PCALL
 
-#ifdef DEBUG_PCALL
 static const char * const excp_names[0x80] = {
     [TT_TFAULT] = "Instruction Access Fault",
     [TT_ILL_INSN] = "Illegal Instruction",
@@ -58,7 +56,6 @@ static const char * const excp_names[0x80] = {
     [TT_DIV_ZERO] = "Division By Zero",
     [TT_NCP_INSN] = "Coprocessor Disabled",
 };
-#endif
 
 void sparc_cpu_do_interrupt(CPUState *cs)
 {
@@ -71,7 +68,6 @@ void sparc_cpu_do_interrupt(CPUState *cs)
         cpu_get_psr(env);
     }
 
-#ifdef DEBUG_PCALL
     if (qemu_loglevel_mask(CPU_LOG_INT)) {
         static int count;
         const char *name;
@@ -104,7 +100,6 @@ void sparc_cpu_do_interrupt(CPUState *cs)
 #endif
         count++;
     }
-#endif
 #if !defined(CONFIG_USER_ONLY)
     if (env->psret == 0) {
         if (cs->exception_index == 0x80 &&
Signature · 1 line
2.21.3
#17 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 36 lines · Philippe Mathieu-Daudé

Hi Peter,

These are the latest SPARC patches sent to the list.

This pull request is with authorization of Artyom and Mark:
- https://www.mail-archive.com/[email protected]/msg710154.html
- https://www.mail-archive.com/[email protected]/msg710156.html

Frederic doesn't have his GPG key signed:
- https://www.mail-archive.com/[email protected]/msg706509.html

The following changes since commit 49ee11555262a256afec592dfed7c5902d5eefd2:

Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-5.1-pull-=
request' into staging (2020-06-08 11:04:57 +0100)

are available in the Git repository at:

https://gitlab.com/philmd/qemu.git tags/sparc-next-20200609

for you to fetch changes up to 86e8c353f705f14f2f2fd7a6195cefa431aa24d9:

target/sparc/int32_helper: Extract and use excp_name_str() (2020-06-09 09:2=
1:10 +0200)

----------------------------------------------------------------
SPARC patches

HW:
- Use UNIMP device instead of EMPTY_SLOT
- Make EMPTY_SLOT similar to UNIMP device
- Map UART devices unconditionally
- Pair of fixes for AHB PnP
- Add trace events to AHB PnP

Quoted 6 lines

TCG:
- Improve exception logging

CI:
- https://gitlab.com/philmd/qemu/-/pipelines/154231191
- https://travis-ci.org/github/philmd/qemu/builds/696321130

Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/5.1
for any user-visible changes.

-- PMM

#18 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 83 lines · Philippe Mathieu-Daudé

Hi Peter,

These are the latest SPARC patches sent to the list.

This pull request is with authorization of Artyom and Mark:
- https://www.mail-archive.com/[email protected]/msg710154.html
- https://www.mail-archive.com/[email protected]/msg710156.html

Frederic doesn't have his GPG key signed:
- https://www.mail-archive.com/[email protected]/msg706509.html

The following changes since commit 49ee11555262a256afec592dfed7c5902d5eefd2:

Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-5.1-pull-=
request' into staging (2020-06-08 11:04:57 +0100)

are available in the Git repository at:

https://gitlab.com/philmd/qemu.git tags/sparc-next-20200609

for you to fetch changes up to 86e8c353f705f14f2f2fd7a6195cefa431aa24d9:

target/sparc/int32_helper: Extract and use excp_name_str() (2020-06-09 09:2=
1:10 +0200)

----------------------------------------------------------------
SPARC patches

HW:
- Use UNIMP device instead of EMPTY_SLOT
- Make EMPTY_SLOT similar to UNIMP device
- Map UART devices unconditionally
- Pair of fixes for AHB PnP
- Add trace events to AHB PnP

TCG:
- Improve exception logging

CI:
- https://gitlab.com/philmd/qemu/-/pipelines/154231191
- https://travis-ci.org/github/philmd/qemu/builds/696321130

----------------------------------------------------------------

Philippe Mathieu-Daud=C3=A9 (16):
hw/sparc/sun4m: Use UnimplementedDevice for I/O devices hw/misc/empty_slot: Lower address space priority hw/misc/empty_slot: Convert 'size' field as qdev property hw/misc/empty_slot: Add a 'name' qdev property hw/misc/empty_slot: Convert debug printf() to trace event hw/misc/empty_slot: Move the 'hw/misc' and cover in MAINTAINERS hw/misc/empty_slot: Name the slots when created hw/sparc/leon3: Map the UART device unconditionally hw/sparc64/niagara: Map the UART device unconditionally hw/sparc64/niagara: Remove duplicated NIAGARA_UART_BASE definition hw/misc/grlib_ahb_apb_pnp: Avoid crash when writing to AHB PnP
registers
hw/misc/grlib_ahb_apb_pnp: Fix AHB PnP 8-bit accesses hw/misc/grlib_ahb_apb_pnp: Add trace events on read accesses hw/timer/grlib_gptimer: Display frequency in decimal target/sparc/int32_helper: Remove DEBUG_PCALL definition target/sparc/int32_helper: Extract and use excp_name_str()

 include/hw/empty_slot.h        |  9 -------
 include/hw/misc/empty_slot.h   | 19 ++++++++++++++
 hw/mips/malta.c                |  4 +--
 hw/{core =3D> misc}/empty_slot.c | 47 +++++++++++++++++++---------------
 hw/misc/grlib_ahb_apb_pnp.c    | 24 +++++++++++++++--
 hw/sparc/leon3.c               | 18 ++++++-------
 hw/sparc/sun4m.c               | 23 +++++++++++------
 hw/sparc64/niagara.c           |  7 ++---
 target/sparc/int32_helper.c    | 23 +++++++++--------
 MAINTAINERS                    |  7 +++++
 hw/core/Makefile.objs          |  1 -
 hw/misc/Makefile.objs          |  1 +
 hw/misc/trace-events           |  8 ++++++
 hw/sparc/Kconfig               |  1 +
 hw/timer/trace-events          |  2 +-
 15 files changed, 124 insertions(+), 70 deletions(-)
 delete mode 100644 include/hw/empty_slot.h
 create mode 100644 include/hw/misc/empty_slot.h
 rename hw/{core =3D> misc}/empty_slot.c (66%)
Quoted 2 lines

--=20
2.21.3

Philippe, thanks so much for handling this - things are really busy here at the moment, so the help is greatly appreciated :)

ATB,

Mark.

#19 lore raw
Quoted 85 lines · Mark Cave-Ayland
Quoted 83 lines · Philippe Mathieu-Daudé

Hi Peter,

These are the latest SPARC patches sent to the list.

This pull request is with authorization of Artyom and Mark:
- https://www.mail-archive.com/[email protected]/msg710154.html
- https://www.mail-archive.com/[email protected]/msg710156.html

Frederic doesn't have his GPG key signed:
- https://www.mail-archive.com/[email protected]/msg706509.html

The following changes since commit 49ee11555262a256afec592dfed7c5902d5eefd2:

Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-5.1-pull-=
request' into staging (2020-06-08 11:04:57 +0100)

are available in the Git repository at:

https://gitlab.com/philmd/qemu.git tags/sparc-next-20200609

for you to fetch changes up to 86e8c353f705f14f2f2fd7a6195cefa431aa24d9:

target/sparc/int32_helper: Extract and use excp_name_str() (2020-06-09 09:2=
1:10 +0200)

----------------------------------------------------------------
SPARC patches

HW:
- Use UNIMP device instead of EMPTY_SLOT
- Make EMPTY_SLOT similar to UNIMP device
- Map UART devices unconditionally
- Pair of fixes for AHB PnP
- Add trace events to AHB PnP

TCG:
- Improve exception logging

CI:
- https://gitlab.com/philmd/qemu/-/pipelines/154231191
- https://travis-ci.org/github/philmd/qemu/builds/696321130

----------------------------------------------------------------

Philippe Mathieu-Daud=C3=A9 (16):
hw/sparc/sun4m: Use UnimplementedDevice for I/O devices hw/misc/empty_slot: Lower address space priority hw/misc/empty_slot: Convert 'size' field as qdev property hw/misc/empty_slot: Add a 'name' qdev property hw/misc/empty_slot: Convert debug printf() to trace event hw/misc/empty_slot: Move the 'hw/misc' and cover in MAINTAINERS hw/misc/empty_slot: Name the slots when created hw/sparc/leon3: Map the UART device unconditionally hw/sparc64/niagara: Map the UART device unconditionally hw/sparc64/niagara: Remove duplicated NIAGARA_UART_BASE definition hw/misc/grlib_ahb_apb_pnp: Avoid crash when writing to AHB PnP
registers
hw/misc/grlib_ahb_apb_pnp: Fix AHB PnP 8-bit accesses hw/misc/grlib_ahb_apb_pnp: Add trace events on read accesses hw/timer/grlib_gptimer: Display frequency in decimal target/sparc/int32_helper: Remove DEBUG_PCALL definition target/sparc/int32_helper: Extract and use excp_name_str()

 include/hw/empty_slot.h        |  9 -------
 include/hw/misc/empty_slot.h   | 19 ++++++++++++++
 hw/mips/malta.c                |  4 +--
 hw/{core =3D> misc}/empty_slot.c | 47 +++++++++++++++++++---------------
 hw/misc/grlib_ahb_apb_pnp.c    | 24 +++++++++++++++--
 hw/sparc/leon3.c               | 18 ++++++-------
 hw/sparc/sun4m.c               | 23 +++++++++++------
 hw/sparc64/niagara.c           |  7 ++---
 target/sparc/int32_helper.c    | 23 +++++++++--------
 MAINTAINERS                    |  7 +++++
 hw/core/Makefile.objs          |  1 -
 hw/misc/Makefile.objs          |  1 +
 hw/misc/trace-events           |  8 ++++++
 hw/sparc/Kconfig               |  1 +
 hw/timer/trace-events          |  2 +-
 15 files changed, 124 insertions(+), 70 deletions(-)
 delete mode 100644 include/hw/empty_slot.h
 create mode 100644 include/hw/misc/empty_slot.h
 rename hw/{core =3D> misc}/empty_slot.c (66%)
Quoted 5 lines
Quoted 2 lines

--=20
2.21.3

Philippe, thanks so much for handling this - things are really busy here at the moment, so the help is greatly appreciated :)

I know you were busy, and the patches are just cleanups, so no problem.

Before sending, I tested with all the images I could grab from
https://wiki.qemu.org/Documentation/Platforms/SPARC
and
https://www.qemu.org/docs/master/system/target-sparc64.html

I might add more acceptance tests later to automate that.

Regards,

Phil.

#20 lore raw

чет, 11. јун 2020. у 15:30 Philippe Mathieu-Daudé <[email protected]> је написао/ла:

Quoted 87 lines · Mark Cave-Ayland
Quoted 85 lines · Philippe Mathieu-Daudé
Quoted 84 lines

Hi Peter,

These are the latest SPARC patches sent to the list.

This pull request is with authorization of Artyom and Mark:
- https://www.mail-archive.com/[email protected]/msg710154.html
- https://www.mail-archive.com/[email protected]/msg710156.html

Frederic doesn't have his GPG key signed:
- https://www.mail-archive.com/[email protected]/msg706509.html

The following changes since commit 49ee11555262a256afec592dfed7c5902d5eefd2:

Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-5.1-pull-=
request' into staging (2020-06-08 11:04:57 +0100)

are available in the Git repository at:

https://gitlab.com/philmd/qemu.git tags/sparc-next-20200609

for you to fetch changes up to 86e8c353f705f14f2f2fd7a6195cefa431aa24d9:

target/sparc/int32_helper: Extract and use excp_name_str() (2020-06-09 09:2=
1:10 +0200)

----------------------------------------------------------------
SPARC patches

HW:
- Use UNIMP device instead of EMPTY_SLOT
- Make EMPTY_SLOT similar to UNIMP device
- Map UART devices unconditionally
- Pair of fixes for AHB PnP
- Add trace events to AHB PnP

TCG:
- Improve exception logging

CI:
- https://gitlab.com/philmd/qemu/-/pipelines/154231191
- https://travis-ci.org/github/philmd/qemu/builds/696321130

----------------------------------------------------------------

Philippe Mathieu-Daud=C3=A9 (16):
hw/sparc/sun4m: Use UnimplementedDevice for I/O devices hw/misc/empty_slot: Lower address space priority hw/misc/empty_slot: Convert 'size' field as qdev property hw/misc/empty_slot: Add a 'name' qdev property hw/misc/empty_slot: Convert debug printf() to trace event hw/misc/empty_slot: Move the 'hw/misc' and cover in MAINTAINERS hw/misc/empty_slot: Name the slots when created hw/sparc/leon3: Map the UART device unconditionally hw/sparc64/niagara: Map the UART device unconditionally hw/sparc64/niagara: Remove duplicated NIAGARA_UART_BASE definition hw/misc/grlib_ahb_apb_pnp: Avoid crash when writing to AHB PnP
registers
hw/misc/grlib_ahb_apb_pnp: Fix AHB PnP 8-bit accesses hw/misc/grlib_ahb_apb_pnp: Add trace events on read accesses hw/timer/grlib_gptimer: Display frequency in decimal target/sparc/int32_helper: Remove DEBUG_PCALL definition target/sparc/int32_helper: Extract and use excp_name_str()

 include/hw/empty_slot.h        |  9 -------
 include/hw/misc/empty_slot.h   | 19 ++++++++++++++
 hw/mips/malta.c                |  4 +--
 hw/{core =3D> misc}/empty_slot.c | 47 +++++++++++++++++++---------------
 hw/misc/grlib_ahb_apb_pnp.c    | 24 +++++++++++++++--
 hw/sparc/leon3.c               | 18 ++++++-------
 hw/sparc/sun4m.c               | 23 +++++++++++------
 hw/sparc64/niagara.c           |  7 ++---
 target/sparc/int32_helper.c    | 23 +++++++++--------
 MAINTAINERS                    |  7 +++++
 hw/core/Makefile.objs          |  1 -
 hw/misc/Makefile.objs          |  1 +
 hw/misc/trace-events           |  8 ++++++
 hw/sparc/Kconfig               |  1 +
 hw/timer/trace-events          |  2 +-
 15 files changed, 124 insertions(+), 70 deletions(-)
 delete mode 100644 include/hw/empty_slot.h
 create mode 100644 include/hw/misc/empty_slot.h
 rename hw/{core =3D> misc}/empty_slot.c (66%)
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

--=20
2.21.3

Philippe, thanks so much for handling this - things are really busy here at the moment, so the help is greatly appreciated :)

I know you were busy, and the patches are just cleanups, so no problem.

I guess it is just a matter of time Philippe would ask for SPARC maintainership. Mark, would you perhaps accept Philippe as a co-maintainer?

Yours,
Aleksandar

Quoted 10 lines

Before sending, I tested with all the images I could grab from
https://wiki.qemu.org/Documentation/Platforms/SPARC
and
https://www.qemu.org/docs/master/system/target-sparc64.html

I might add more acceptance tests later to automate that.

Regards,

Phil.

#21 lore raw
Quoted 95 lines · Aleksandar Markovic

чет, 11. јун 2020. у 15:30 Philippe Mathieu-Daudé <[email protected]> је написао/ла:

Quoted 93 lines · Mark Cave-Ayland
Quoted 90 lines · Philippe Mathieu-Daudé
Quoted 84 lines

Hi Peter,

These are the latest SPARC patches sent to the list.

This pull request is with authorization of Artyom and Mark:
- https://www.mail-archive.com/[email protected]/msg710154.html
- https://www.mail-archive.com/[email protected]/msg710156.html

Frederic doesn't have his GPG key signed:
- https://www.mail-archive.com/[email protected]/msg706509.html

The following changes since commit 49ee11555262a256afec592dfed7c5902d5eefd2:

Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-5.1-pull-=
request' into staging (2020-06-08 11:04:57 +0100)

are available in the Git repository at:

https://gitlab.com/philmd/qemu.git tags/sparc-next-20200609

for you to fetch changes up to 86e8c353f705f14f2f2fd7a6195cefa431aa24d9:

target/sparc/int32_helper: Extract and use excp_name_str() (2020-06-09 09:2=
1:10 +0200)

----------------------------------------------------------------
SPARC patches

HW:
- Use UNIMP device instead of EMPTY_SLOT
- Make EMPTY_SLOT similar to UNIMP device
- Map UART devices unconditionally
- Pair of fixes for AHB PnP
- Add trace events to AHB PnP

TCG:
- Improve exception logging

CI:
- https://gitlab.com/philmd/qemu/-/pipelines/154231191
- https://travis-ci.org/github/philmd/qemu/builds/696321130

----------------------------------------------------------------

Philippe Mathieu-Daud=C3=A9 (16):
hw/sparc/sun4m: Use UnimplementedDevice for I/O devices hw/misc/empty_slot: Lower address space priority hw/misc/empty_slot: Convert 'size' field as qdev property hw/misc/empty_slot: Add a 'name' qdev property hw/misc/empty_slot: Convert debug printf() to trace event hw/misc/empty_slot: Move the 'hw/misc' and cover in MAINTAINERS hw/misc/empty_slot: Name the slots when created hw/sparc/leon3: Map the UART device unconditionally hw/sparc64/niagara: Map the UART device unconditionally hw/sparc64/niagara: Remove duplicated NIAGARA_UART_BASE definition hw/misc/grlib_ahb_apb_pnp: Avoid crash when writing to AHB PnP
registers
hw/misc/grlib_ahb_apb_pnp: Fix AHB PnP 8-bit accesses hw/misc/grlib_ahb_apb_pnp: Add trace events on read accesses hw/timer/grlib_gptimer: Display frequency in decimal target/sparc/int32_helper: Remove DEBUG_PCALL definition target/sparc/int32_helper: Extract and use excp_name_str()

 include/hw/empty_slot.h        |  9 -------
 include/hw/misc/empty_slot.h   | 19 ++++++++++++++
 hw/mips/malta.c                |  4 +--
 hw/{core =3D> misc}/empty_slot.c | 47 +++++++++++++++++++---------------
 hw/misc/grlib_ahb_apb_pnp.c    | 24 +++++++++++++++--
 hw/sparc/leon3.c               | 18 ++++++-------
 hw/sparc/sun4m.c               | 23 +++++++++++------
 hw/sparc64/niagara.c           |  7 ++---
 target/sparc/int32_helper.c    | 23 +++++++++--------
 MAINTAINERS                    |  7 +++++
 hw/core/Makefile.objs          |  1 -
 hw/misc/Makefile.objs          |  1 +
 hw/misc/trace-events           |  8 ++++++
 hw/sparc/Kconfig               |  1 +
 hw/timer/trace-events          |  2 +-
 15 files changed, 124 insertions(+), 70 deletions(-)
 delete mode 100644 include/hw/empty_slot.h
 create mode 100644 include/hw/misc/empty_slot.h
 rename hw/{core =3D> misc}/empty_slot.c (66%)
Quoted 2 lines

--=20
2.21.3

Philippe, thanks so much for handling this - things are really busy here at the moment, so the help is greatly appreciated :)

Quoted 6 lines
Quoted 2 lines

I know you were busy, and the patches are just cleanups, so no problem.

I guess it is just a matter of time Philippe would ask for SPARC maintainership. Mark, would you perhaps accept Philippe as a co-maintainer?

Don't worry Aleksandar, Mark and Artyom are experts and manage the SPARC codebase very well. I don't want to overstep, I simply wanted to give some help while they are busy.

Actually the core content here are the patches related to the empty_slot device. The discussion started with Artyom in October 2018:
https://www.mail-archive.com/[email protected]/msg564065.html

Since Artyom acked the patches, I pinged few times, Mark and him were busy, I simply asked them and they agree, but I am not interested in maintainance, neither I have the SPARC knowledge.

Regards,

Phil.

Quoted 15 lines

Yours,
Aleksandar

Quoted 10 lines

Before sending, I tested with all the images I could grab from
https://wiki.qemu.org/Documentation/Platforms/SPARC
and
https://www.qemu.org/docs/master/system/target-sparc64.html

I might add more acceptance tests later to automate that.

Regards,

Phil.