mbox

[PULL,0/1] tricore queue

Message ID 20200901095924.21738-1-kbastian@mail.uni-paderborn.de (mailing list archive)
State New, archived
Headers show

Pull-request

https://github.com/bkoppelmann/qemu.git tags/pull-tricore-20200901

Message

Bastian Koppelmann Sept. 1, 2020, 9:59 a.m. UTC
The following changes since commit 2f4c51c0f384d7888a04b4815861e6d5fd244d75:

  Merge remote-tracking branch 'remotes/kraxel/tags/usb-20200831-pull-request' into staging (2020-08-31 19:39:13 +0100)

are available in the Git repository at:

  https://github.com/bkoppelmann/qemu.git tags/pull-tricore-20200901

for you to fetch changes up to 2c15af48abb71b3cddadd63c5bb416b250f53fef:

  tricore: added triboard with tc27x_soc (2020-09-01 11:54:11 +0200)

----------------------------------------------------------------
Add the Infineon Aurix D-Step board

----------------------------------------------------------------
Andreas Konopik (1):
      tricore: added triboard with tc27x_soc

 hw/tricore/Kconfig             |   8 ++
 hw/tricore/meson.build         |   2 +
 hw/tricore/tc27x_soc.c         | 246 +++++++++++++++++++++++++++++++++++++++++
 hw/tricore/triboard.c          | 102 +++++++++++++++++
 include/hw/tricore/tc27x_soc.h | 139 +++++++++++++++++++++++
 include/hw/tricore/triboard.h  |  53 +++++++++
 6 files changed, 550 insertions(+)
 create mode 100644 hw/tricore/tc27x_soc.c
 create mode 100644 hw/tricore/triboard.c
 create mode 100644 include/hw/tricore/tc27x_soc.h
 create mode 100644 include/hw/tricore/triboard.h

Comments

Peter Maydell Sept. 1, 2020, 2:18 p.m. UTC | #1
On Tue, 1 Sep 2020 at 10:59, Bastian Koppelmann
<kbastian@mail.uni-paderborn.de> wrote:
>
> The following changes since commit 2f4c51c0f384d7888a04b4815861e6d5fd244d75:
>
>   Merge remote-tracking branch 'remotes/kraxel/tags/usb-20200831-pull-request' into staging (2020-08-31 19:39:13 +0100)
>
> are available in the Git repository at:
>
>   https://github.com/bkoppelmann/qemu.git tags/pull-tricore-20200901
>
> for you to fetch changes up to 2c15af48abb71b3cddadd63c5bb416b250f53fef:
>
>   tricore: added triboard with tc27x_soc (2020-09-01 11:54:11 +0200)
>
> ----------------------------------------------------------------
> Add the Infineon Aurix D-Step board
>
> ----------------------------------------------------------------
> Andreas Konopik (1):
>       tricore: added triboard with tc27x_soc

This fails "make check" (all platforms):

OSX fails like this:

MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}
QTEST_QEMU_IMG=./qemu-img
G_TEST_DBUS_DAEMON=/Users/pm215/src/qemu-for-merges/tests/dbus-vmstate-daemon.sh
QTEST_QEMU_BINARY=./qemu-system-tricore
tests/qtest/device-introspect-test --tap -k
PASS 1 qtest-tricore: device-introspect-test /tricore/device/introspect/list
PASS 2 qtest-tricore: device-introspect-test
/tricore/device/introspect/list-fields
PASS 3 qtest-tricore: device-introspect-test /tricore/device/introspect/none
PASS 4 qtest-tricore: device-introspect-test /tricore/device/introspect/abstract
PASS 5 qtest-tricore: device-introspect-test
/tricore/device/introspect/abstract-interfaces
RAMBlock "CPU0.DSPR" already registered, abort!
Broken pipe
../../tests/qtest/libqtest.c:175: kill_qemu() detected QEMU death from
signal 6 (Abort trap: 6)
ERROR qtest-tricore: device-introspect-test - too few tests run
(expected 6, got 5)
make: *** [Makefile.mtest:1429: check-qtest] Error 1

others like this:

MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}
QTEST_QEMU_IMG=./qemu-img
G_TEST_DBUS_DAEMON=/home/pm/qemu/tests/dbus-vmstate-daemon.sh
QTEST_QEMU_BINARY=./qemu-system-tricore
tests/qtest/device-introspect-test --tap -k
PASS 1 qtest-tricore: device-introspect-test /tricore/device/introspect/list
PASS 2 qtest-tricore: device-introspect-test
/tricore/device/introspect/list-fields
PASS 3 qtest-tricore: device-introspect-test /tricore/device/introspect/none
PASS 4 qtest-tricore: device-introspect-test /tricore/device/introspect/abstract
PASS 5 qtest-tricore: device-introspect-test
/tricore/device/introspect/abstract-interfaces
Broken pipe
../../tests/qtest/libqtest.c:175: kill_qemu() detected QEMU death from
signal 11 (Segmentation fault)
Aborted
ERROR qtest-tricore: device-introspect-test - too few tests run
(expected 6, got 5)

thanks
-- PMM
Bastian Koppelmann Sept. 2, 2020, 12:55 p.m. UTC | #2
On Tue, Sep 01, 2020 at 03:18:40PM +0100, Peter Maydell wrote:
> On Tue, 1 Sep 2020 at 10:59, Bastian Koppelmann
> <kbastian@mail.uni-paderborn.de> wrote:
> >
> > The following changes since commit 2f4c51c0f384d7888a04b4815861e6d5fd244d75:
> >
> >   Merge remote-tracking branch 'remotes/kraxel/tags/usb-20200831-pull-request' into staging (2020-08-31 19:39:13 +0100)
> >
> > are available in the Git repository at:
> >
> >   https://github.com/bkoppelmann/qemu.git tags/pull-tricore-20200901
> >
> > for you to fetch changes up to 2c15af48abb71b3cddadd63c5bb416b250f53fef:
> >
> >   tricore: added triboard with tc27x_soc (2020-09-01 11:54:11 +0200)
> >
> > ----------------------------------------------------------------
> > Add the Infineon Aurix D-Step board
> >
> > ----------------------------------------------------------------
> > Andreas Konopik (1):
> >       tricore: added triboard with tc27x_soc
> 
> This fails "make check" (all platforms):
> 
> OSX fails like this:
> 
> MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}
> QTEST_QEMU_IMG=./qemu-img
> G_TEST_DBUS_DAEMON=/Users/pm215/src/qemu-for-merges/tests/dbus-vmstate-daemon.sh
> QTEST_QEMU_BINARY=./qemu-system-tricore
> tests/qtest/device-introspect-test --tap -k
> PASS 1 qtest-tricore: device-introspect-test /tricore/device/introspect/list
> PASS 2 qtest-tricore: device-introspect-test
> /tricore/device/introspect/list-fields
> PASS 3 qtest-tricore: device-introspect-test /tricore/device/introspect/none
> PASS 4 qtest-tricore: device-introspect-test /tricore/device/introspect/abstract
> PASS 5 qtest-tricore: device-introspect-test
> /tricore/device/introspect/abstract-interfaces
> RAMBlock "CPU0.DSPR" already registered, abort!
> Broken pipe
> ../../tests/qtest/libqtest.c:175: kill_qemu() detected QEMU death from
> signal 6 (Abort trap: 6)
> ERROR qtest-tricore: device-introspect-test - too few tests run
> (expected 6, got 5)
> make: *** [Makefile.mtest:1429: check-qtest] Error 1

This patch seems to fix this problem. 

diff --git a/hw/tricore/tc27x_soc.c b/hw/tricore/tc27x_soc.c
index 4f28e39c8c..2c7aa8e901 100644
--- a/hw/tricore/tc27x_soc.c
+++ b/hw/tricore/tc27x_soc.c
@@ -100,9 +100,9 @@ static void make_alias(MemoryRegion *mr, const char *name,
     memory_region_add_subregion(get_system_memory(), base, mr);
 }
 
-static void tc27x_soc_init_memory_mapping(Object *obj)
+static void tc27x_soc_init_memory_mapping(DeviceState *dev_soc)
 {
-    TC27XSoCState *s = TC27X_SOC(obj);
+    TC27XSoCState *s = TC27X_SOC(dev_soc);
     TC27XSoCClass *sc = TC27X_SOC_GET_CLASS(s);
 
     make_ram(&s->cpu0mem.dspr, "CPU0.DSPR",
@@ -192,6 +192,7 @@ static void tc27x_soc_realize(DeviceState *dev_soc, Error **errp)
         error_propagate(errp, err);
         return;
     }
+    tc27x_soc_init_memory_mapping(dev_soc);
 }
 
 static void tc27x_soc_init(Object *obj)
@@ -201,7 +202,6 @@ static void tc27x_soc_init(Object *obj)
 
     object_initialize_child(obj, "tc27x", &s->cpu, sc->cpu_type);
 
-    tc27x_soc_init_memory_mapping(obj);
 }

However, it just leads to the next one:

Running test qtest-tricore: device-introspect-test
Running test qtest-tricore: machine-none-test
Running test qtest-tricore: qmp-test
Running test qtest-tricore: qmp-cmd-test
Running test qtest-tricore: qom-test
Bad address
qemu-system-tricore: no kernel file '(null)'
Broken pipe
../tests/qtest/libqtest.c:166: kill_qemu() tried to terminate QEMU process but encountered exit status 1 (expected 0)
ERROR qtest-tricore: qom-test - too few tests run (expected 3, got 1)

Andreas, can you look into this?

Thanks,
Bastian
Konopik, Andreas (EFS-GH2) Oct. 28, 2020, 11:19 a.m. UTC | #3
Hi Bastian,

sorry for the late reply.

On Wed, 2 Sep 2020 at 14:56, Bastian Koppelmann
<kbastian@mail.uni-paderborn.de> wrote:
> On Tue, Sep 01, 2020 at 03:18:40PM +0100, Peter Maydell wrote:
> > On Tue, 1 Sep 2020 at 10:59, Bastian Koppelmann
> > <kbastian@mail.uni-paderborn.de> wrote:
> > >
> > > The following changes since commit
> 2f4c51c0f384d7888a04b4815861e6d5fd244d75:
> > >
> > >   Merge remote-tracking branch
> > > 'remotes/kraxel/tags/usb-20200831-pull-request' into staging
> > > (2020-08-31 19:39:13 +0100)
> > >
> > > are available in the Git repository at:
> > >
> > >   https://github.com/bkoppelmann/qemu.git tags/pull-tricore-20200901
> > >
> > > for you to fetch changes up to
> 2c15af48abb71b3cddadd63c5bb416b250f53fef:
> > >
> > >   tricore: added triboard with tc27x_soc (2020-09-01 11:54:11 +0200)
> > >
> > > ----------------------------------------------------------------
> > > Add the Infineon Aurix D-Step board
> > >
> > > ----------------------------------------------------------------
> > > Andreas Konopik (1):
> > >       tricore: added triboard with tc27x_soc
> >
> > This fails "make check" (all platforms):
> >
> > OSX fails like this:
> >
> > MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}
> > QTEST_QEMU_IMG=./qemu-img
> > G_TEST_DBUS_DAEMON=/Users/pm215/src/qemu-for-merges/tests/dbus-
> vmstate
> > -daemon.sh QTEST_QEMU_BINARY=./qemu-system-tricore
> > tests/qtest/device-introspect-test --tap -k PASS 1 qtest-tricore:
> > device-introspect-test /tricore/device/introspect/list PASS 2
> > qtest-tricore: device-introspect-test
> > /tricore/device/introspect/list-fields
> > PASS 3 qtest-tricore: device-introspect-test
> > /tricore/device/introspect/none PASS 4 qtest-tricore:
> > device-introspect-test /tricore/device/introspect/abstract
> > PASS 5 qtest-tricore: device-introspect-test
> > /tricore/device/introspect/abstract-interfaces
> > RAMBlock "CPU0.DSPR" already registered, abort!
> > Broken pipe
> > ../../tests/qtest/libqtest.c:175: kill_qemu() detected QEMU death from
> > signal 6 (Abort trap: 6) ERROR qtest-tricore: device-introspect-test -
> > too few tests run (expected 6, got 5)
> > make: *** [Makefile.mtest:1429: check-qtest] Error 1
> 
> This patch seems to fix this problem.
> 
> diff --git a/hw/tricore/tc27x_soc.c b/hw/tricore/tc27x_soc.c index
> 4f28e39c8c..2c7aa8e901 100644
> --- a/hw/tricore/tc27x_soc.c
> +++ b/hw/tricore/tc27x_soc.c
> @@ -100,9 +100,9 @@ static void make_alias(MemoryRegion *mr, const char
> *name,
>      memory_region_add_subregion(get_system_memory(), base, mr);  }
> 
> -static void tc27x_soc_init_memory_mapping(Object *obj)
> +static void tc27x_soc_init_memory_mapping(DeviceState *dev_soc)
>  {
> -    TC27XSoCState *s = TC27X_SOC(obj);
> +    TC27XSoCState *s = TC27X_SOC(dev_soc);
>      TC27XSoCClass *sc = TC27X_SOC_GET_CLASS(s);
> 
>      make_ram(&s->cpu0mem.dspr, "CPU0.DSPR", @@ -192,6 +192,7 @@ static
> void tc27x_soc_realize(DeviceState *dev_soc, Error **errp)
>          error_propagate(errp, err);
>          return;
>      }
> +    tc27x_soc_init_memory_mapping(dev_soc);
>  }
> 
>  static void tc27x_soc_init(Object *obj) @@ -201,7 +202,6 @@ static void
> tc27x_soc_init(Object *obj)
> 
>      object_initialize_child(obj, "tc27x", &s->cpu, sc->cpu_type);
> 
> -    tc27x_soc_init_memory_mapping(obj);
>  }
> 
> However, it just leads to the next one:
> 
> Running test qtest-tricore: device-introspect-test Running test qtest-tricore:
> machine-none-test Running test qtest-tricore: qmp-test Running test qtest-
> tricore: qmp-cmd-test Running test qtest-tricore: qom-test Bad address
> qemu-system-tricore: no kernel file '(null)'
> Broken pipe
> ../tests/qtest/libqtest.c:166: kill_qemu() tried to terminate QEMU process but
> encountered exit status 1 (expected 0) ERROR qtest-tricore: qom-test - too few
> tests run (expected 3, got 1)
> 
> Andreas, can you look into this?

I looked multiple times into this problem. With trial and error I found a working
patch today. I also included Thomas Huths suggestions regarding KConfig and
meson.build
(https://lists.nongnu.org/archive/html/qemu-devel/2020-09/msg00867.html),
so feel free to modify. I will send the patch as soon as possible.
 
> Thanks,
> Bastian

Kind regards,

Andreas