[PATCH 0/2] hw/sparc: Kconfig fixes to build with/without the leon3 machine

Philippe Mathieu-Daudé posted 2 patches 3 years ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20210427192658.266933-1-f4bug@amsat.org
There is a newer version of this series
target/sparc/cpu.h          |  6 ----
hw/sparc/irq.c              | 61 +++++++++++++++++++++++++++++++++++++
hw/sparc/leon3.c            | 37 +++++++++++++++++++++-
hw/sparc/sun4m.c            | 32 -------------------
target/sparc/int32_helper.c | 37 ----------------------
hw/sparc/meson.build        |  1 +
hw/sparc/trace-events       |  2 ++
target/sparc/trace-events   |  4 ---
8 files changed, 100 insertions(+), 80 deletions(-)
create mode 100644 hw/sparc/irq.c
[PATCH 0/2] hw/sparc: Kconfig fixes to build with/without the leon3 machine
Posted by Philippe Mathieu-Daudé 3 years ago
This series fixes link failure when building either the leon3
machine or the sun4m ones.

The problem is we have hardware specific code in the architectural
translation code. Move this code to hw/sparc/.

The link failures can be reproduced doing:

  $ echo CONFIG_LEON3=y > default-configs/devices/sparc-softmmu.mak
  $ configure --without-default-devices
  $ ninja qemu-system-sparc
  $ ./qemu-system-sparc -M leon3 -S

or:

  $ echo CONFIG_SUN4M=y > default-configs/devices/sparc-softmmu.mak

Philippe Mathieu-Daudé (2):
  hw/sparc: Allow building the leon3 machine stand-alone
  hw/sparc: Allow building without the leon3 machine

 target/sparc/cpu.h          |  6 ----
 hw/sparc/irq.c              | 61 +++++++++++++++++++++++++++++++++++++
 hw/sparc/leon3.c            | 37 +++++++++++++++++++++-
 hw/sparc/sun4m.c            | 32 -------------------
 target/sparc/int32_helper.c | 37 ----------------------
 hw/sparc/meson.build        |  1 +
 hw/sparc/trace-events       |  2 ++
 target/sparc/trace-events   |  4 ---
 8 files changed, 100 insertions(+), 80 deletions(-)
 create mode 100644 hw/sparc/irq.c

-- 
2.26.3

Re: [PATCH 0/2] hw/sparc: Kconfig fixes to build with/without the leon3 machine
Posted by Mark Cave-Ayland 3 years ago
On 27/04/2021 20:26, Philippe Mathieu-Daudé wrote:

> This series fixes link failure when building either the leon3
> machine or the sun4m ones.
> 
> The problem is we have hardware specific code in the architectural
> translation code. Move this code to hw/sparc/.
> 
> The link failures can be reproduced doing:
> 
>    $ echo CONFIG_LEON3=y > default-configs/devices/sparc-softmmu.mak
>    $ configure --without-default-devices
>    $ ninja qemu-system-sparc
>    $ ./qemu-system-sparc -M leon3 -S
> 
> or:
> 
>    $ echo CONFIG_SUN4M=y > default-configs/devices/sparc-softmmu.mak
> 
> Philippe Mathieu-Daudé (2):
>    hw/sparc: Allow building the leon3 machine stand-alone
>    hw/sparc: Allow building without the leon3 machine
> 
>   target/sparc/cpu.h          |  6 ----
>   hw/sparc/irq.c              | 61 +++++++++++++++++++++++++++++++++++++
>   hw/sparc/leon3.c            | 37 +++++++++++++++++++++-
>   hw/sparc/sun4m.c            | 32 -------------------
>   target/sparc/int32_helper.c | 37 ----------------------
>   hw/sparc/meson.build        |  1 +
>   hw/sparc/trace-events       |  2 ++
>   target/sparc/trace-events   |  4 ---
>   8 files changed, 100 insertions(+), 80 deletions(-)
>   create mode 100644 hw/sparc/irq.c

Just one comment from me but other than that seems fine: if Frederic and/or Fabien 
could give a R-B tag then I'm happy to queue it via qemu-sparc.


ATB,

Mark.

Re: [PATCH 0/2] hw/sparc: Kconfig fixes to build with/without the leon3 machine
Posted by Fred Konrad 3 years ago

Le 4/27/21 à 9:26 PM, Philippe Mathieu-Daudé a écrit :
> This series fixes link failure when building either the leon3
> machine or the sun4m ones.
> 
> The problem is we have hardware specific code in the architectural
> translation code. Move this code to hw/sparc/.
> 
> The link failures can be reproduced doing:
> 
>    $ echo CONFIG_LEON3=y > default-configs/devices/sparc-softmmu.mak
>    $ configure --without-default-devices
>    $ ninja qemu-system-sparc

Indeed:

libqemu-sparc-softmmu.fa.p/target_sparc_win_helper.c.o: \
In function `cpu_put_psr':
xxx/qemu/build/../target/sparc/win_helper.c:91: \
   undefined reference to `cpu_check_irqs'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

>    $ ./qemu-system-sparc -M leon3 -S
> 
> or:
> 
>    $ echo CONFIG_SUN4M=y > default-configs/devices/sparc-softmmu.mak
> 
> Philippe Mathieu-Daudé (2):
>    hw/sparc: Allow building the leon3 machine stand-alone
>    hw/sparc: Allow building without the leon3 machine
> 
>   target/sparc/cpu.h          |  6 ----
>   hw/sparc/irq.c              | 61 +++++++++++++++++++++++++++++++++++++
>   hw/sparc/leon3.c            | 37 +++++++++++++++++++++-
>   hw/sparc/sun4m.c            | 32 -------------------
>   target/sparc/int32_helper.c | 37 ----------------------
>   hw/sparc/meson.build        |  1 +
>   hw/sparc/trace-events       |  2 ++
>   target/sparc/trace-events   |  4 ---
>   8 files changed, 100 insertions(+), 80 deletions(-)
>   create mode 100644 hw/sparc/irq.c
>