Skip to contentSkip to conversation

Xilinx queue

GIT PULL Edgar E. Iglesias 4 participants 11 messages Jan 16, 2018 Arm/Zynq architecture

lore
Share & tools
lore
#0 lore raw

From: "Edgar E. Iglesias" <[email protected]>

The following changes since commit f521eeee3bd060b460c99e605472b7e03967db43:

Merge remote-tracking branch 'remotes/juanquintela/tags/migration/20180115' into staging (2018-01-15 13:17:47 +0000)

are available in the git repository at:

[email protected]:edgarigl/qemu.git tags/edgar/xilinx-next-2018-01.for-upstream

for you to fetch changes up to e451272ac191cd3ac408bc89ea63a401e84d4224:

xlnx-zynqmp: Connect the IPI device to the ZynqMP SoC (2018-01-16 11:44:49 +0100)

----------------------------------------------------------------
Xilinx queue

----------------------------------------------------------------
Alistair Francis (8):
xlnx-zynqmp-pmu: Initial commit of the ZynqMP PMU
xlnx-zynqmp-pmu: Add the CPU and memory aarch64-softmmu.mak: Use an ARM specific config
xlnx-pmu-iomod-intc: Add the PMU Interrupt controller
xlnx-zynqmp-pmu: Connect the PMU interrupt controller
xlnx-zynqmp-ipi: Initial version of the Xilinx IPI device
xlnx-zynqmp-pmu: Connect the IPI device to the PMU
xlnx-zynqmp: Connect the IPI device to the ZynqMP SoC

 default-configs/aarch64-softmmu.mak    |   1 +
 default-configs/microblaze-softmmu.mak |   1 +
 hw/arm/Makefile.objs                   |   2 +-
 hw/arm/xlnx-zynqmp.c                   |  14 +
 hw/display/Makefile.objs               |   2 +-
 hw/dma/Makefile.objs                   |   2 +-
 hw/intc/Makefile.objs                  |   2 +
 hw/intc/xlnx-pmu-iomod-intc.c          | 554 +++++++++++++++++++++++++++++++++
 hw/intc/xlnx-zynqmp-ipi.c              | 377 ++++++++++++++++++++++
 hw/microblaze/Makefile.objs            |   1 +
 hw/microblaze/xlnx-zynqmp-pmu.c        | 204 ++++++++++++
 include/hw/arm/xlnx-zynqmp.h           |   2 +
 include/hw/intc/xlnx-pmu-iomod-intc.h  |  58 ++++
 include/hw/intc/xlnx-zynqmp-ipi.h      |  57 ++++
 14 files changed, 1274 insertions(+), 3 deletions(-)
 create mode 100644 hw/intc/xlnx-pmu-iomod-intc.c
 create mode 100644 hw/intc/xlnx-zynqmp-ipi.c
 create mode 100644 hw/microblaze/xlnx-zynqmp-pmu.c
 create mode 100644 include/hw/intc/xlnx-pmu-iomod-intc.h
 create mode 100644 include/hw/intc/xlnx-zynqmp-ipi.h

Alistair Francis (8):
xlnx-zynqmp-pmu: Initial commit of the ZynqMP PMU
xlnx-zynqmp-pmu: Add the CPU and memory aarch64-softmmu.mak: Use an ARM specific config
xlnx-pmu-iomod-intc: Add the PMU Interrupt controller
xlnx-zynqmp-pmu: Connect the PMU interrupt controller
xlnx-zynqmp-ipi: Initial version of the Xilinx IPI device
xlnx-zynqmp-pmu: Connect the IPI device to the PMU
xlnx-zynqmp: Connect the IPI device to the ZynqMP SoC

 default-configs/aarch64-softmmu.mak    |   1 +
 default-configs/microblaze-softmmu.mak |   1 +
 hw/arm/Makefile.objs                   |   2 +-
 hw/arm/xlnx-zynqmp.c                   |  14 +
 hw/display/Makefile.objs               |   2 +-
 hw/dma/Makefile.objs                   |   2 +-
 hw/intc/Makefile.objs                  |   2 +
 hw/intc/xlnx-pmu-iomod-intc.c          | 554 +++++++++++++++++++++++++++++++++
 hw/intc/xlnx-zynqmp-ipi.c              | 377 ++++++++++++++++++++++
 hw/microblaze/Makefile.objs            |   1 +
 hw/microblaze/xlnx-zynqmp-pmu.c        | 204 ++++++++++++
 include/hw/arm/xlnx-zynqmp.h           |   2 +
 include/hw/intc/xlnx-pmu-iomod-intc.h  |  58 ++++
 include/hw/intc/xlnx-zynqmp-ipi.h      |  57 ++++
 14 files changed, 1274 insertions(+), 3 deletions(-)
 create mode 100644 hw/intc/xlnx-pmu-iomod-intc.c
 create mode 100644 hw/intc/xlnx-zynqmp-ipi.c
 create mode 100644 hw/microblaze/xlnx-zynqmp-pmu.c
 create mode 100644 include/hw/intc/xlnx-pmu-iomod-intc.h
 create mode 100644 include/hw/intc/xlnx-zynqmp-ipi.h
Signature · 1 line
2.7.4
#1 lore raw

[Qemu-devel] [PULL v1 3/8] aarch64-softmmu.mak: Use an ARM specific config

From: Alistair Francis <[email protected]>

In preperation for having an ARM and MicroBlaze ZynqMP machine let's split out the current ARM specific config options.

---
 default-configs/aarch64-softmmu.mak | 1 +
 hw/arm/Makefile.objs                | 2 +-
 hw/display/Makefile.objs            | 2 +-
 hw/dma/Makefile.objs                | 2 +-
 4 files changed, 4 insertions(+), 3 deletions(-)
default-configs/aarch64-softmmu.mak +1 -0
index 2449483..9ddccf8 100644
@@ -7,3 +7,4 @@ CONFIG_AUX=y
 CONFIG_DDC=y
 CONFIG_DPCD=y
 CONFIG_XLNX_ZYNQMP=y
+CONFIG_XLNX_ZYNQMP_ARM=y
hw/arm/Makefile.objs +1 -1
index 2794e08..1c896ba 100644
@@ -13,7 +13,7 @@ obj-y += omap1.o omap2.o strongarm.o
 obj-$(CONFIG_ALLWINNER_A10) += allwinner-a10.o cubieboard.o
 obj-$(CONFIG_RASPI) += bcm2835_peripherals.o bcm2836.o raspi.o
 obj-$(CONFIG_STM32F205_SOC) += stm32f205_soc.o
-obj-$(CONFIG_XLNX_ZYNQMP) += xlnx-zynqmp.o xlnx-zcu102.o
+obj-$(CONFIG_XLNX_ZYNQMP_ARM) += xlnx-zynqmp.o xlnx-zcu102.o
 obj-$(CONFIG_FSL_IMX25) += fsl-imx25.o imx25_pdk.o
 obj-$(CONFIG_FSL_IMX31) += fsl-imx31.o kzm.o
 obj-$(CONFIG_FSL_IMX6) += fsl-imx6.o sabrelite.o
hw/display/Makefile.objs +1 -1
index 551c050..d3a4cb3 100644
@@ -40,4 +40,4 @@ virtio-gpu.o-libs += $(VIRGL_LIBS)
 virtio-gpu-3d.o-cflags := $(VIRGL_CFLAGS)
 virtio-gpu-3d.o-libs += $(VIRGL_LIBS)
 obj-$(CONFIG_DPCD) += dpcd.o
-obj-$(CONFIG_XLNX_ZYNQMP) += xlnx_dp.o
+obj-$(CONFIG_XLNX_ZYNQMP_ARM) += xlnx_dp.o
hw/dma/Makefile.objs +1 -1
index 0b3a009..5adf385 100644
@@ -8,7 +8,7 @@ common-obj-$(CONFIG_XILINX_AXI) += xilinx_axidma.o
 common-obj-$(CONFIG_ZYNQ_DEVCFG) += xlnx-zynq-devcfg.o
 common-obj-$(CONFIG_ETRAXFS) += etraxfs_dma.o
 common-obj-$(CONFIG_STP2000) += sparc32_dma.o
-obj-$(CONFIG_XLNX_ZYNQMP) += xlnx_dpdma.o
+obj-$(CONFIG_XLNX_ZYNQMP_ARM) += xlnx_dpdma.o
 
 obj-$(CONFIG_OMAP) += omap_dma.o soc_dma.o
 obj-$(CONFIG_PXA2XX) += pxa2xx_dma.o
Signature · 1 line
2.7.4
#2 lore raw

[Qemu-devel] [PULL v1 1/8] xlnx-zynqmp-pmu: Initial commit of the ZynqMP PMU

In reply to Edgar E. Iglesias

From: Alistair Francis <[email protected]>

The Xilinx ZynqMP SoC has two main processing systems in it. The ARM processing system (which is already modeled in QEMU) and the MicroBlaze Power Management Unit (PMU). This is the inital work for adding support for the PMU.

The PMU susbsystem runs along side the ARM system on hardware, but due to architecture limitations in QEMU the two instances are seperate for the time being.

Let's follow the same setup we do with the ARM system, where there is an SoC device and a ZCU102 board. Although the PMU is less board specific we are still going to follow the same split as maybe in future we can connect the PMU device to the ARM ZCU102 board. As the machine will be fairly small let's keep them both together in one file.

---
 hw/microblaze/Makefile.objs     |  1 +
 hw/microblaze/xlnx-zynqmp-pmu.c | 83 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 84 insertions(+)
 create mode 100644 hw/microblaze/xlnx-zynqmp-pmu.c
hw/microblaze/Makefile.objs +1 -0
index b2517d8..ae9fd40 100644
@@ -1,3 +1,4 @@
 obj-y += petalogix_s3adsp1800_mmu.o
 obj-y += petalogix_ml605_mmu.o
+obj-y += xlnx-zynqmp-pmu.o
 obj-y += boot.o
hw/microblaze/xlnx-zynqmp-pmu.c new file +83 -0

83 lines not on this page · raw message

Signature · 1 line
2.7.4
#3 lore raw

[Qemu-devel] [PULL v1 4/8] xlnx-pmu-iomod-intc: Add the PMU Interrupt controller

In reply to Edgar E. Iglesias

From: Alistair Francis <[email protected]>

Add the PMU IO Module Interrupt controller device.

---
 default-configs/microblaze-softmmu.mak |   1 +
 hw/intc/Makefile.objs                  |   1 +
 hw/intc/xlnx-pmu-iomod-intc.c          | 554 +++++++++++++++++++++++++++++++++
 include/hw/intc/xlnx-pmu-iomod-intc.h  |  58 ++++
 4 files changed, 614 insertions(+)
 create mode 100644 hw/intc/xlnx-pmu-iomod-intc.c
 create mode 100644 include/hw/intc/xlnx-pmu-iomod-intc.h
default-configs/microblaze-softmmu.mak +1 -0
index ce26308..7fca8e4 100644
@@ -9,3 +9,4 @@ CONFIG_XILINX_SPI=y
 CONFIG_XILINX_ETHLITE=y
 CONFIG_SSI=y
 CONFIG_SSI_M25P80=y
+CONFIG_XLNX_ZYNQMP=y
hw/intc/Makefile.objs +1 -0
index ae35856..2116550 100644
@@ -3,6 +3,7 @@ common-obj-$(CONFIG_I8259) += i8259_common.o i8259.o
 common-obj-$(CONFIG_PL190) += pl190.o
 common-obj-$(CONFIG_PUV3) += puv3_intc.o
 common-obj-$(CONFIG_XILINX) += xilinx_intc.o
+common-obj-$(CONFIG_XLNX_ZYNQMP) += xlnx-pmu-iomod-intc.o
 common-obj-$(CONFIG_ETRAXFS) += etraxfs_pic.o
 common-obj-$(CONFIG_IMX) += imx_avic.o
 common-obj-$(CONFIG_LM32) += lm32_pic.o
hw/intc/xlnx-pmu-iomod-intc.c new file +554 -0

554 lines not on this page · raw message

include/hw/intc/xlnx-pmu-iomod-intc.h new file +58 -0

58 lines not on this page · raw message

Signature · 1 line
2.7.4
#4 lore raw

[Qemu-devel] [PULL v1 2/8] xlnx-zynqmp-pmu: Add the CPU and memory

In reply to Edgar E. Iglesias

From: Alistair Francis <[email protected]>

Connect the MicroBlaze CPU and the ROM and RAM memory regions.

---
 hw/microblaze/xlnx-zynqmp-pmu.c | 70 +++++++++++++++++++++++++++++++++++++++--
 1 file changed, 68 insertions(+), 2 deletions(-)
hw/microblaze/xlnx-zynqmp-pmu.c +68 -2
index ac0f789..c6a0b3b 100644
@@ -18,8 +18,11 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "qemu-common.h"
+#include "exec/address-spaces.h"
 #include "hw/boards.h"
+#include "hw/qdev-properties.h"
 #include "cpu.h"
+#include "boot.h"
 
 /* Define the PMU device */
 
@@ -27,21 +30,56 @@
 #define XLNX_ZYNQMP_PMU_SOC(obj) OBJECT_CHECK(XlnxZynqMPPMUSoCState, (obj), \
                                               TYPE_XLNX_ZYNQMP_PMU_SOC)
 
+#define XLNX_ZYNQMP_PMU_ROM_SIZE    0x8000
+#define XLNX_ZYNQMP_PMU_ROM_ADDR    0xFFD00000
+#define XLNX_ZYNQMP_PMU_RAM_ADDR    0xFFDC0000
+
 typedef struct XlnxZynqMPPMUSoCState {
     /*< private >*/
     DeviceState parent_obj;
 
     /*< public >*/
+    MicroBlazeCPU cpu;
 }  XlnxZynqMPPMUSoCState;
 
 static void xlnx_zynqmp_pmu_soc_init(Object *obj)
 {
+    XlnxZynqMPPMUSoCState *s = XLNX_ZYNQMP_PMU_SOC(obj);
 
+    object_initialize(&s->cpu, sizeof(s->cpu),
+                      TYPE_MICROBLAZE_CPU);
+    object_property_add_child(obj, "pmu-cpu", OBJECT(&s->cpu),
+                              &error_abort);
 }
 
 static void xlnx_zynqmp_pmu_soc_realize(DeviceState *dev, Error **errp)
 {
-
+    XlnxZynqMPPMUSoCState *s = XLNX_ZYNQMP_PMU_SOC(dev);
+    Error *err = NULL;
+
+    object_property_set_uint(OBJECT(&s->cpu), XLNX_ZYNQMP_PMU_ROM_ADDR,
+                             "base-vectors", &error_abort);
+    object_property_set_bool(OBJECT(&s->cpu), true, "use-stack-protection",
+                             &error_abort);
+    object_property_set_uint(OBJECT(&s->cpu), 0, "use-fpu", &error_abort);
+    object_property_set_uint(OBJECT(&s->cpu), 0, "use-hw-mul", &error_abort);
+    object_property_set_bool(OBJECT(&s->cpu), true, "use-barrel",
+                             &error_abort);
+    object_property_set_bool(OBJECT(&s->cpu), true, "use-msr-instr",
+                             &error_abort);
+    object_property_set_bool(OBJECT(&s->cpu), true, "use-pcmp-instr",
+                             &error_abort);
+    object_property_set_bool(OBJECT(&s->cpu), false, "use-mmu", &error_abort);
+    object_property_set_bool(OBJECT(&s->cpu), true, "endianness",
+                             &error_abort);
+    object_property_set_str(OBJECT(&s->cpu), "8.40.b", "version",
+                            &error_abort);
+    object_property_set_uint(OBJECT(&s->cpu), 0, "pvr", &error_abort);
+    object_property_set_bool(OBJECT(&s->cpu), true, "realized", &err);
+    if (err) {
+        error_propagate(errp, err);
+        return;
+    }
 }
 
 static void xlnx_zynqmp_pmu_soc_class_init(ObjectClass *oc, void *data)
@@ -70,7 +108,35 @@ type_init(xlnx_zynqmp_pmu_soc_register_types)
 
 static void xlnx_zynqmp_pmu_init(MachineState *machine)
 {
-
+    XlnxZynqMPPMUSoCState *pmu = g_new0(XlnxZynqMPPMUSoCState, 1);
+    MemoryRegion *address_space_mem = get_system_memory();
+    MemoryRegion *pmu_rom = g_new(MemoryRegion, 1);
+    MemoryRegion *pmu_ram = g_new(MemoryRegion, 1);
+
+    /* Create the ROM */
+    memory_region_init_rom(pmu_rom, NULL, "xlnx-zynqmp-pmu.rom",
+                           XLNX_ZYNQMP_PMU_ROM_SIZE, &error_fatal);
+    memory_region_add_subregion(address_space_mem, XLNX_ZYNQMP_PMU_ROM_ADDR,
+                                pmu_rom);
+
+    /* Create the RAM */
+    memory_region_init_ram(pmu_ram, NULL, "xlnx-zynqmp-pmu.ram",
+                           machine->ram_size, &error_fatal);
+    memory_region_add_subregion(address_space_mem, XLNX_ZYNQMP_PMU_RAM_ADDR,
+                                pmu_ram);
+
+    /* Create the PMU device */
+    object_initialize(pmu, sizeof(XlnxZynqMPPMUSoCState), TYPE_XLNX_ZYNQMP_PMU_SOC);
+    object_property_add_child(OBJECT(machine), "pmu", OBJECT(pmu),
+                              &error_abort);
+    object_property_set_bool(OBJECT(pmu), true, "realized", &error_fatal);
+
+    /* Load the kernel */
+    microblaze_load_kernel(&pmu->cpu, XLNX_ZYNQMP_PMU_RAM_ADDR,
+                           machine->ram_size,
+                           machine->kernel_filename,
+                           machine->dtb,
+                           NULL);
 }
 
 static void xlnx_zynqmp_pmu_machine_init(MachineClass *mc)
Signature · 1 line
2.7.4
#5 lore raw

[Qemu-devel] [PULL v1 6/8] xlnx-zynqmp-ipi: Initial version of the Xilinx IPI device

In reply to Edgar E. Iglesias

From: Alistair Francis <[email protected]>

This is the initial version of the Inter Processor Interrupt device.

---
 hw/intc/Makefile.objs             |   1 +
 hw/intc/xlnx-zynqmp-ipi.c         | 377 ++++++++++++++++++++++++++++++++++++++
 include/hw/intc/xlnx-zynqmp-ipi.h |  57 ++++++
 3 files changed, 435 insertions(+)
 create mode 100644 hw/intc/xlnx-zynqmp-ipi.c
 create mode 100644 include/hw/intc/xlnx-zynqmp-ipi.h
hw/intc/Makefile.objs +1 -0
index 2116550..571e094 100644
@@ -4,6 +4,7 @@ common-obj-$(CONFIG_PL190) += pl190.o
 common-obj-$(CONFIG_PUV3) += puv3_intc.o
 common-obj-$(CONFIG_XILINX) += xilinx_intc.o
 common-obj-$(CONFIG_XLNX_ZYNQMP) += xlnx-pmu-iomod-intc.o
+common-obj-$(CONFIG_XLNX_ZYNQMP) += xlnx-zynqmp-ipi.o
 common-obj-$(CONFIG_ETRAXFS) += etraxfs_pic.o
 common-obj-$(CONFIG_IMX) += imx_avic.o
 common-obj-$(CONFIG_LM32) += lm32_pic.o
hw/intc/xlnx-zynqmp-ipi.c new file +377 -0

377 lines not on this page · raw message

include/hw/intc/xlnx-zynqmp-ipi.h new file +57 -0

57 lines not on this page · raw message

Signature · 1 line
2.7.4
#6 lore raw

[Qemu-devel] [PULL v1 7/8] xlnx-zynqmp-pmu: Connect the IPI device to the PMU

In reply to Edgar E. Iglesias

From: Alistair Francis <[email protected]>

---
 hw/microblaze/xlnx-zynqmp-pmu.c | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
hw/microblaze/xlnx-zynqmp-pmu.c +31 -0
index 828eeed..14b8ed4 100644
@@ -24,6 +24,7 @@
 #include "cpu.h"
 #include "boot.h"
 
+#include "hw/intc/xlnx-zynqmp-ipi.h"
 #include "hw/intc/xlnx-pmu-iomod-intc.h"
 
 /* Define the PMU device */
@@ -38,6 +39,15 @@
 
 #define XLNX_ZYNQMP_PMU_INTC_ADDR   0xFFD40000
 
+#define XLNX_ZYNQMP_PMU_NUM_IPIS    4
+
+static const uint64_t ipi_addr[XLNX_ZYNQMP_PMU_NUM_IPIS] = {
+    0xFF340000, 0xFF350000, 0xFF360000, 0xFF370000,
+};
+static const uint64_t ipi_irq[XLNX_ZYNQMP_PMU_NUM_IPIS] = {
+    19, 20, 21, 22,
+};
+
 typedef struct XlnxZynqMPPMUSoCState {
     /*< private >*/
     DeviceState parent_obj;
@@ -136,6 +146,9 @@ static void xlnx_zynqmp_pmu_init(MachineState *machine)
     MemoryRegion *address_space_mem = get_system_memory();
     MemoryRegion *pmu_rom = g_new(MemoryRegion, 1);
     MemoryRegion *pmu_ram = g_new(MemoryRegion, 1);
+    XlnxZynqMPIPI *ipi[XLNX_ZYNQMP_PMU_NUM_IPIS];
+    qemu_irq irq[32];
+    int i;
 
     /* Create the ROM */
     memory_region_init_rom(pmu_rom, NULL, "xlnx-zynqmp-pmu.rom",
@@ -155,6 +168,24 @@ static void xlnx_zynqmp_pmu_init(MachineState *machine)
                               &error_abort);
     object_property_set_bool(OBJECT(pmu), true, "realized", &error_fatal);
 
+    for (i = 0; i < 32; i++) {
+        irq[i] = qdev_get_gpio_in(DEVICE(&pmu->intc), i);
+    }
+
+    /* Create and connect the IPI device */
+    for (i = 0; i < XLNX_ZYNQMP_PMU_NUM_IPIS; i++) {
+        ipi[i] = g_new0(XlnxZynqMPIPI, 1);
+        object_initialize(ipi[i], sizeof(XlnxZynqMPIPI), TYPE_XLNX_ZYNQMP_IPI);
+        qdev_set_parent_bus(DEVICE(ipi[i]), sysbus_get_default());
+    }
+
+    for (i = 0; i < XLNX_ZYNQMP_PMU_NUM_IPIS; i++) {
+        object_property_set_bool(OBJECT(ipi[i]), true, "realized",
+                                 &error_abort);
+        sysbus_mmio_map(SYS_BUS_DEVICE(ipi[i]), 0, ipi_addr[i]);
+        sysbus_connect_irq(SYS_BUS_DEVICE(ipi[i]), 0, irq[ipi_irq[i]]);
+    }
+
     /* Load the kernel */
     microblaze_load_kernel(&pmu->cpu, XLNX_ZYNQMP_PMU_RAM_ADDR,
                            machine->ram_size,
Signature · 1 line
2.7.4
#7 lore raw
In reply to Edgar E. Iglesias
Quoted 17 lines · Edgar E. Iglesias

From: "Edgar E. Iglesias" <[email protected]>

The following changes since commit f521eeee3bd060b460c99e605472b7e03967db43:

Merge remote-tracking branch 'remotes/juanquintela/tags/migration/20180115' into staging (2018-01-15 13:17:47 +0000)

are available in the git repository at:

[email protected]:edgarigl/qemu.git tags/edgar/xilinx-next-2018-01.for-upstream

for you to fetch changes up to e451272ac191cd3ac408bc89ea63a401e84d4224:

xlnx-zynqmp: Connect the IPI device to the ZynqMP SoC (2018-01-16 11:44:49 +0100)

----------------------------------------------------------------
Xilinx queue

Quoted 11 lines

----------------------------------------------------------------
Alistair Francis (8):
xlnx-zynqmp-pmu: Initial commit of the ZynqMP PMU
xlnx-zynqmp-pmu: Add the CPU and memory aarch64-softmmu.mak: Use an ARM specific config
xlnx-pmu-iomod-intc: Add the PMU Interrupt controller
xlnx-zynqmp-pmu: Connect the PMU interrupt controller
xlnx-zynqmp-ipi: Initial version of the Xilinx IPI device
xlnx-zynqmp-pmu: Connect the IPI device to the PMU
xlnx-zynqmp: Connect the IPI device to the ZynqMP SoC

Hi -- this trips some new runtime sanitizer warnings:

GTESTER check-qtest-microblaze
/home/petmay01/linaro/qemu-for-merges/vl.c:2279:16: runtime error:
null pointer passed as argument 1, which is declared to never be null /usr/include/unistd.h:290:60: note: nonnull attribute specified here /home/petmay01/linaro/qemu-for-merges/vl.c:2279:16: runtime error:
null pointer passed as argument 1, which is declared to never be null /usr/include/unistd.h:290:60: note: nonnull attribute specified here
make: Leaving directory '/home/petmay01/linaro/qemu-for-merges/build/clang'
make: Entering directory '/home/petmay01/linaro/qemu-for-merges/build/clang'
GTESTER check-qtest-microblazeel
/home/petmay01/linaro/qemu-for-merges/vl.c:2279:16: runtime error:
null pointer passed as argument 1, which is declared to never be null /usr/include/unistd.h:290:60: note: nonnull attribute specified here /home/petmay01/linaro/qemu-for-merges/vl.c:2279:16: runtime error:
null pointer passed as argument 1, which is declared to never be null /usr/include/unistd.h:290:60: note: nonnull attribute specified here

This is because you've called qemu_find_file() with a NULL pointer (which it then passes to access(), which it isn't valid to call with a NULL pathname argument). Backtrace:

#0 0x0000555555e446c1 in qemu_find_file (type=0, name=0x0)

    at /home/petmay01/linaro/qemu-for-merges/vl.c:2279

#1 0x0000555555dfd693 in microblaze_load_kernel (cpu=0x55555824da28, ddr_base=<optimised out>, ramsize=0, initrd_filename=<optimised out>, dtb_filename=0x0, machine_cpu_reset=0x0)
at /home/petmay01/linaro/qemu-for-merges/hw/microblaze/boot.c:128
#2 0x0000555555dfd519 in xlnx_zynqmp_pmu_init (machine=<optimised out>)
at /home/petmay01/linaro/qemu-for-merges/hw/microblaze/xlnx-zynqmp-pmu.c:190
#3 0x0000555555f2fd5d in machine_run_board_init (machine=<optimised out>)

    at /home/petmay01/linaro/qemu-for-merges/hw/core/machine.c:792
#4  0x0000555555e4a357 in main (argc=<optimised out>, argv=<optimised
out>, envp=<optimised out>)
    at /home/petmay01/linaro/qemu-for-merges/vl.c:4622

thanks
-- PMM

#8 lore raw
Quoted 30 lines · Peter Maydell
Quoted 17 lines · Edgar E. Iglesias

From: "Edgar E. Iglesias" <[email protected]>

The following changes since commit f521eeee3bd060b460c99e605472b7e03967db43:

Merge remote-tracking branch 'remotes/juanquintela/tags/migration/20180115' into staging (2018-01-15 13:17:47 +0000)

are available in the git repository at:

[email protected]:edgarigl/qemu.git tags/edgar/xilinx-next-2018-01.for-upstream

for you to fetch changes up to e451272ac191cd3ac408bc89ea63a401e84d4224:

xlnx-zynqmp: Connect the IPI device to the ZynqMP SoC (2018-01-16 11:44:49 +0100)

----------------------------------------------------------------
Xilinx queue

Quoted 11 lines

----------------------------------------------------------------
Alistair Francis (8):
xlnx-zynqmp-pmu: Initial commit of the ZynqMP PMU
xlnx-zynqmp-pmu: Add the CPU and memory aarch64-softmmu.mak: Use an ARM specific config
xlnx-pmu-iomod-intc: Add the PMU Interrupt controller
xlnx-zynqmp-pmu: Connect the PMU interrupt controller
xlnx-zynqmp-ipi: Initial version of the Xilinx IPI device
xlnx-zynqmp-pmu: Connect the IPI device to the PMU
xlnx-zynqmp: Connect the IPI device to the ZynqMP SoC

Quoted 1 line

Hi -- this trips some new runtime sanitizer warnings:

Hi Peter,

This didn't show up on my clang testing, do you mind sharing configure line and clang version you use?

@Alistair, it does seem like the call to microblaze_load_kernel is passing wrong arguments. Can you have a look?

Cheers,
Edgar

Quoted 38 lines

GTESTER check-qtest-microblaze
/home/petmay01/linaro/qemu-for-merges/vl.c:2279:16: runtime error:
null pointer passed as argument 1, which is declared to never be null /usr/include/unistd.h:290:60: note: nonnull attribute specified here /home/petmay01/linaro/qemu-for-merges/vl.c:2279:16: runtime error:
null pointer passed as argument 1, which is declared to never be null /usr/include/unistd.h:290:60: note: nonnull attribute specified here
make: Leaving directory '/home/petmay01/linaro/qemu-for-merges/build/clang'
make: Entering directory '/home/petmay01/linaro/qemu-for-merges/build/clang'
GTESTER check-qtest-microblazeel
/home/petmay01/linaro/qemu-for-merges/vl.c:2279:16: runtime error:
null pointer passed as argument 1, which is declared to never be null /usr/include/unistd.h:290:60: note: nonnull attribute specified here /home/petmay01/linaro/qemu-for-merges/vl.c:2279:16: runtime error:
null pointer passed as argument 1, which is declared to never be null /usr/include/unistd.h:290:60: note: nonnull attribute specified here

This is because you've called qemu_find_file() with a NULL pointer (which it then passes to access(), which it isn't valid to call with a NULL pathname argument). Backtrace:

#0 0x0000555555e446c1 in qemu_find_file (type=0, name=0x0)

    at /home/petmay01/linaro/qemu-for-merges/vl.c:2279

#1 0x0000555555dfd693 in microblaze_load_kernel (cpu=0x55555824da28, ddr_base=<optimised out>, ramsize=0, initrd_filename=<optimised out>, dtb_filename=0x0, machine_cpu_reset=0x0)
at /home/petmay01/linaro/qemu-for-merges/hw/microblaze/boot.c:128
#2 0x0000555555dfd519 in xlnx_zynqmp_pmu_init (machine=<optimised out>)
at /home/petmay01/linaro/qemu-for-merges/hw/microblaze/xlnx-zynqmp-pmu.c:190
#3 0x0000555555f2fd5d in machine_run_board_init (machine=<optimised out>)

    at /home/petmay01/linaro/qemu-for-merges/hw/core/machine.c:792
#4  0x0000555555e4a357 in main (argc=<optimised out>, argv=<optimised
out>, envp=<optimised out>)
    at /home/petmay01/linaro/qemu-for-merges/vl.c:4622

thanks
-- PMM

#9 lore raw
Quoted 4 lines · Edgar E. Iglesias

This didn't show up on my clang testing, do you mind sharing configure line and clang version you use?

@Alistair, it does seem like the call to microblaze_load_kernel is passing wrong arguments. Can you have a look?

exec '../../configure' '--cc=clang' '--cxx=clang++' '--enable-gtk' '--extra-cflags=-fsanitize=undefined -fno-sanitize=shift-base -Werror' "$@"

with clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final) on ubuntu xenial.

thanks
-- PMM

#10 lore raw
Quoted 7 lines · Peter Maydell
Quoted 4 lines · Edgar E. Iglesias

This didn't show up on my clang testing, do you mind sharing configure line and clang version you use?

@Alistair, it does seem like the call to microblaze_load_kernel is passing wrong arguments. Can you have a look?

Quoted 6 lines

exec '../../configure' '--cc=clang' '--cxx=clang++' '--enable-gtk' '--extra-cflags=-fsanitize=undefined -fno-sanitize=shift-base -Werror' "$@"

with clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final) on ubuntu xenial.

Ok, should be fixed in v5, just running though one more test then I'll send the patches out.

Alistair

Quoted 4 lines

thanks
-- PMM