Skip to contentSkip to conversation

target: Provide target-specific Kconfig

PATCH In review Philippe Mathieu-Daudé 5 participants 27 messages Jan 31, 2021 – Mar 10, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover target: Provide target-specific Kconfig

Hi,

This series add a Kconfig file to each target, allowing to select target-specific features there, instead of from the hardware Kconfig.

This simplifies managing multi-arch features such semihosting.

Series organization:

1/ Some targets use the architecture symbol to select boards and peripherals (SH4 and LM32), we need to clean that first.

2/ Introduce empty target Kconfig, update meson.

3/ Move architectural features out of hardware:
- x86 SEV
- ARM v7m
- generic semihosting

[following only important to patchew, unrelated to this series]
Based-on: <[email protected]>

Philippe Mathieu-Daudé (10):
hw/sh4/Kconfig: Rename CONFIG_SH4 -> CONFIG_SH4_PERIPHERALS hw/lm32/Kconfig: Introduce CONFIG_LM32_EVR for lm32-evr/uclinux boards hw/sh4/Kconfig: Rename CONFIG_LM32 -> CONFIG_LM32_PERIPHERALS hw/lm32/Kconfig: Have MILKYMIST select LM32_PERIPHERALS
meson: Introduce target-specific Kconfig
target/i386: Move SEV feature to target Kconfig target/arm: Move V7M feature to target Kconfig
default-configs: Remove unnecessary SEMIHOSTING selection
target: Move ARM_COMPATIBLE_SEMIHOSTING feature to target Kconfig
target: Move SEMIHOSTING feature to target Kconfig

 default-configs/devices/arm-softmmu.mak       |  2 --
 default-configs/devices/lm32-softmmu.mak      |  4 +---
 default-configs/devices/m68k-softmmu.mak      |  2 --
 .../devices/mips-softmmu-common.mak           |  3 ---
 default-configs/devices/nios2-softmmu.mak     |  2 --
 default-configs/devices/riscv32-softmmu.mak   |  2 --
 default-configs/devices/riscv64-softmmu.mak   |  2 --
 default-configs/devices/unicore32-softmmu.mak |  1 -
 default-configs/devices/xtensa-softmmu.mak    |  2 --
 meson.build                                   |  3 ++-
 Kconfig                                       |  1 +
 hw/arm/Kconfig                                |  4 ----
 hw/block/meson.build                          |  2 +-
 hw/char/meson.build                           |  6 ++---
 hw/i386/Kconfig                               |  4 ----
 hw/intc/meson.build                           |  4 ++--
 hw/lm32/Kconfig                               | 10 +++++---
 hw/lm32/meson.build                           |  2 +-
 hw/sh4/Kconfig                                |  6 ++---
 hw/timer/meson.build                          |  4 ++--
 target/Kconfig                                | 23 +++++++++++++++++++
 target/alpha/Kconfig                          |  2 ++
 target/arm/Kconfig                            | 11 +++++++++
 target/avr/Kconfig                            |  2 ++
 target/cris/Kconfig                           |  2 ++
 target/hppa/Kconfig                           |  2 ++
 target/i386/Kconfig                           |  9 ++++++++
 target/lm32/Kconfig                           |  3 +++
 target/m68k/Kconfig                           |  3 +++
 target/microblaze/Kconfig                     |  2 ++
 target/mips/Kconfig                           |  7 ++++++
 target/moxie/Kconfig                          |  2 ++
 target/nios2/Kconfig                          |  3 +++
 target/openrisc/Kconfig                       |  2 ++
 target/ppc/Kconfig                            |  5 ++++
 target/riscv/Kconfig                          |  7 ++++++
 target/rx/Kconfig                             |  2 ++
 target/s390x/Kconfig                          |  2 ++
 target/sh4/Kconfig                            |  2 ++
 target/sparc/Kconfig                          |  5 ++++
 target/tilegx/Kconfig                         |  2 ++
 target/tricore/Kconfig                        |  2 ++
 target/unicore32/Kconfig                      |  3 +++
 target/xtensa/Kconfig                         |  3 +++
 44 files changed, 129 insertions(+), 43 deletions(-)
 create mode 100644 target/Kconfig
 create mode 100644 target/alpha/Kconfig
 create mode 100644 target/arm/Kconfig
 create mode 100644 target/avr/Kconfig
 create mode 100644 target/cris/Kconfig
 create mode 100644 target/hppa/Kconfig
 create mode 100644 target/i386/Kconfig
 create mode 100644 target/lm32/Kconfig
 create mode 100644 target/m68k/Kconfig
 create mode 100644 target/microblaze/Kconfig
 create mode 100644 target/mips/Kconfig
 create mode 100644 target/moxie/Kconfig
 create mode 100644 target/nios2/Kconfig
 create mode 100644 target/openrisc/Kconfig
 create mode 100644 target/ppc/Kconfig
 create mode 100644 target/riscv/Kconfig
 create mode 100644 target/rx/Kconfig
 create mode 100644 target/s390x/Kconfig
 create mode 100644 target/sh4/Kconfig
 create mode 100644 target/sparc/Kconfig
 create mode 100644 target/tilegx/Kconfig
 create mode 100644 target/tricore/Kconfig
 create mode 100644 target/unicore32/Kconfig
 create mode 100644 target/xtensa/Kconfig
Signature · 1 line
2.26.2
#1 lore raw

PATCH 1/10 hw/sh4/Kconfig: Rename CONFIG_SH4 -> CONFIG_SH4_PERIPHERALS

We want to be able to use the 'SH4' config for architecture specific features. As CONFIG_SH4 is only used to select peripherals, rename it CONFIG_SH4_PERIPHERALS.

---
 hw/block/meson.build | 2 +-
 hw/char/meson.build  | 2 +-
 hw/intc/meson.build  | 2 +-
 hw/sh4/Kconfig       | 6 +++---
 hw/timer/meson.build | 2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)
hw/block/meson.build +1 -1
index 602ca6c8541..7f24b42c283 100644
@@ -12,7 +12,7 @@
 softmmu_ss.add(when: 'CONFIG_SSI_M25P80', if_true: files('m25p80.c'))
 softmmu_ss.add(when: 'CONFIG_SWIM', if_true: files('swim.c'))
 softmmu_ss.add(when: 'CONFIG_XEN', if_true: files('xen-block.c'))
-softmmu_ss.add(when: 'CONFIG_SH4', if_true: files('tc58128.c'))
+softmmu_ss.add(when: 'CONFIG_SH4_PERIPHERALS', if_true: files('tc58128.c'))
 softmmu_ss.add(when: 'CONFIG_NVME_PCI', if_true: files('nvme.c', 'nvme-ns.c'))
 
 specific_ss.add(when: 'CONFIG_VIRTIO_BLK', if_true: files('virtio-blk.c'))
hw/char/meson.build +1 -1
index 196ac91fa29..3b8cb6a2f5b 100644
@@ -31,7 +31,7 @@
 softmmu_ss.add(when: 'CONFIG_RASPI', if_true: files('bcm2835_aux.c'))
 softmmu_ss.add(when: 'CONFIG_RENESAS_SCI', if_true: files('renesas_sci.c'))
 softmmu_ss.add(when: 'CONFIG_SIFIVE_UART', if_true: files('sifive_uart.c'))
-softmmu_ss.add(when: 'CONFIG_SH4', if_true: files('sh_serial.c'))
+softmmu_ss.add(when: 'CONFIG_SH4_PERIPHERALS', if_true: files('sh_serial.c'))
 softmmu_ss.add(when: 'CONFIG_STM32F2XX_USART', if_true: files('stm32f2xx_usart.c'))
 softmmu_ss.add(when: 'CONFIG_MCHP_PFSOC_MMUART', if_true: files('mchp_pfsoc_mmuart.c'))
 
hw/intc/meson.build +1 -1
index 53cba115690..b05bab2f4b6 100644
@@ -47,7 +47,7 @@
 specific_ss.add(when: 'CONFIG_RX_ICU', if_true: files('rx_icu.c'))
 specific_ss.add(when: 'CONFIG_S390_FLIC', if_true: files('s390_flic.c'))
 specific_ss.add(when: 'CONFIG_S390_FLIC_KVM', if_true: files('s390_flic_kvm.c'))
-specific_ss.add(when: 'CONFIG_SH4', if_true: files('sh_intc.c'))
+specific_ss.add(when: 'CONFIG_SH4_PERIPHERALS', if_true: files('sh_intc.c'))
 specific_ss.add(when: 'CONFIG_SIFIVE_CLINT', if_true: files('sifive_clint.c'))
 specific_ss.add(when: 'CONFIG_SIFIVE_PLIC', if_true: files('sifive_plic.c'))
 specific_ss.add(when: 'CONFIG_XICS', if_true: files('xics.c'))
hw/sh4/Kconfig +3 -3
index 4cbce3a0ed5..fbac8c09152 100644
@@ -9,16 +9,16 @@ config R2D
     select USB_OHCI_PCI
     select PCI
     select SM501
-    select SH4
+    select SH4_PERIPHERALS
 
 config SHIX
     bool
     select SH7750
-    select SH4
+    select SH4_PERIPHERALS
 
 config SH7750
     bool
 
-config SH4
+config SH4_PERIPHERALS
     bool
     select PTIMER
hw/timer/meson.build +1 -1
index be343f68fed..d3f53dce400 100644
@@ -30,7 +30,7 @@
 softmmu_ss.add(when: 'CONFIG_PUV3', if_true: files('puv3_ost.c'))
 softmmu_ss.add(when: 'CONFIG_PXA2XX', if_true: files('pxa2xx_timer.c'))
 softmmu_ss.add(when: 'CONFIG_RASPI', if_true: files('bcm2835_systmr.c'))
-softmmu_ss.add(when: 'CONFIG_SH4', if_true: files('sh_timer.c'))
+softmmu_ss.add(when: 'CONFIG_SH4_PERIPHERALS', if_true: files('sh_timer.c'))
 softmmu_ss.add(when: 'CONFIG_SLAVIO', if_true: files('slavio_timer.c'))
 softmmu_ss.add(when: 'CONFIG_STM32F2XX_TIMER', if_true: files('stm32f2xx_timer.c'))
 softmmu_ss.add(when: 'CONFIG_XILINX', if_true: files('xilinx_timer.c'))
Signature · 1 line
2.26.2
Reviewed-by on v1 1/10
#2 lore raw

Re: [PATCH 01/10] hw/sh4/Kconfig: Rename CONFIG_SH4 -> CONFIG_SH4_PERIPHERALS

Quoted 5 lines · Philippe Mathieu-Daudé

We want to be able to use the 'SH4' config for architecture specific features. As CONFIG_SH4 is only used to select peripherals, rename it CONFIG_SH4_PERIPHERALS.

I agree with Balaton Zoltan that _DEVICES might be a bit shorter. Either way:

Signature · 1 line
Alex Bennée
#3 lore raw

PATCH 2/10 hw/lm32/Kconfig: Introduce CONFIG_LM32_EVR for lm32-evr/uclinux boards

In reply to Philippe Mathieu-Daudé

We want to be able to use the 'LM32' config for architecture specific features. Introduce CONFIG_LM32_EVR to select the lm32-evr / lm32-uclinux boards.

---
 default-configs/devices/lm32-softmmu.mak | 2 +-
 hw/lm32/Kconfig                          | 6 +++++-
 hw/lm32/meson.build                      | 2 +-
 3 files changed, 7 insertions(+), 3 deletions(-)
default-configs/devices/lm32-softmmu.mak +1 -1
index 115b3e34c98..1bce3f6e8b6 100644
@@ -8,5 +8,5 @@ CONFIG_SEMIHOSTING=y
 
 # Boards:
 #
-CONFIG_LM32=y
+CONFIG_LM32_EVR=y
 CONFIG_MILKYMIST=y
hw/lm32/Kconfig +5 -1
index ed2e3060b04..20c36edc402 100644
@@ -1,7 +1,6 @@
 config LM32
     bool
     select PTIMER
-    select PFLASH_CFI02
 
 config MILKYMIST
     bool
@@ -12,3 +11,8 @@ config MILKYMIST
     select FRAMEBUFFER
     select SD
     select USB_OHCI
+
+config LM32_EVR
+    bool
+    select LM32
+    select PFLASH_CFI02
hw/lm32/meson.build +1 -1
index 8caf0a727ff..42d6f8db3d9 100644
@@ -1,6 +1,6 @@
 lm32_ss = ss.source_set()
 # LM32 boards
-lm32_ss.add(when: 'CONFIG_LM32', if_true: files('lm32_boards.c'))
+lm32_ss.add(when: 'CONFIG_LM32_EVR', if_true: files('lm32_boards.c'))
 lm32_ss.add(when: 'CONFIG_MILKYMIST', if_true: files('milkymist.c'))
 
 hw_arch += {'lm32': lm32_ss}
Signature · 1 line
2.26.2
#5 lore raw

PATCH 3/10 hw/sh4/Kconfig: Rename CONFIG_LM32 -> CONFIG_LM32_PERIPHERALS

In reply to Philippe Mathieu-Daudé

We want to be able to use the 'LM32' config for architecture specific features. As CONFIG_LM32 is only used to select peripherals, rename it CONFIG_LM32_PERIPHERALS.

---
 hw/char/meson.build  | 4 ++--
 hw/intc/meson.build  | 2 +-
 hw/lm32/Kconfig      | 4 ++--
 hw/timer/meson.build | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)
hw/char/meson.build +2 -2
index 3b8cb6a2f5b..b05dcc41c59 100644
@@ -8,8 +8,8 @@
 softmmu_ss.add(when: 'CONFIG_IPACK', if_true: files('ipoctal232.c'))
 softmmu_ss.add(when: 'CONFIG_ISA_BUS', if_true: files('parallel-isa.c'))
 softmmu_ss.add(when: 'CONFIG_ISA_DEBUG', if_true: files('debugcon.c'))
-softmmu_ss.add(when: 'CONFIG_LM32', if_true: files('lm32_juart.c'))
-softmmu_ss.add(when: 'CONFIG_LM32', if_true: files('lm32_uart.c'))
+softmmu_ss.add(when: 'CONFIG_LM32_PERIPHERALS', if_true: files('lm32_juart.c'))
+softmmu_ss.add(when: 'CONFIG_LM32_PERIPHERALS', if_true: files('lm32_uart.c'))
 softmmu_ss.add(when: 'CONFIG_MILKYMIST', if_true: files('milkymist-uart.c'))
 softmmu_ss.add(when: 'CONFIG_NRF51_SOC', if_true: files('nrf51_uart.c'))
 softmmu_ss.add(when: 'CONFIG_PARALLEL', if_true: files('parallel.c'))
hw/intc/meson.build +1 -1
index b05bab2f4b6..bfaab908ac7 100644
@@ -14,7 +14,7 @@
 softmmu_ss.add(when: 'CONFIG_I8259', if_true: files('i8259_common.c', 'i8259.c'))
 softmmu_ss.add(when: 'CONFIG_IMX', if_true: files('imx_avic.c', 'imx_gpcv2.c'))
 softmmu_ss.add(when: 'CONFIG_IOAPIC', if_true: files('ioapic_common.c'))
-softmmu_ss.add(when: 'CONFIG_LM32', if_true: files('lm32_pic.c'))
+softmmu_ss.add(when: 'CONFIG_LM32_PERIPHERALS', if_true: files('lm32_pic.c'))
 softmmu_ss.add(when: 'CONFIG_OPENPIC', if_true: files('openpic.c'))
 softmmu_ss.add(when: 'CONFIG_PL190', if_true: files('pl190.c'))
 softmmu_ss.add(when: 'CONFIG_PUV3', if_true: files('puv3_intc.c'))
hw/lm32/Kconfig +2 -2
index 20c36edc402..5867f4db0cf 100644
@@ -1,4 +1,4 @@
-config LM32
+config LM32_PERIPHERALS
     bool
     select PTIMER
 
@@ -14,5 +14,5 @@ config MILKYMIST
 
 config LM32_EVR
     bool
-    select LM32
+    select LM32_PERIPHERALS
     select PFLASH_CFI02
hw/timer/meson.build +1 -1
index d3f53dce400..36ca0d34942 100644
@@ -19,7 +19,7 @@
 softmmu_ss.add(when: 'CONFIG_I8254', if_true: files('i8254_common.c', 'i8254.c'))
 softmmu_ss.add(when: 'CONFIG_IMX', if_true: files('imx_epit.c'))
 softmmu_ss.add(when: 'CONFIG_IMX', if_true: files('imx_gpt.c'))
-softmmu_ss.add(when: 'CONFIG_LM32', if_true: files('lm32_timer.c'))
+softmmu_ss.add(when: 'CONFIG_LM32_PERIPHERALS', if_true: files('lm32_timer.c'))
 softmmu_ss.add(when: 'CONFIG_MILKYMIST', if_true: files('milkymist-sysctl.c'))
 softmmu_ss.add(when: 'CONFIG_MIPS_CPS', if_true: files('mips_gictimer.c'))
 softmmu_ss.add(when: 'CONFIG_MSF2', if_true: files('mss-timer.c'))
Signature · 1 line
2.26.2
Reviewed-by on v1 3/10
#6 lore raw

Re: [PATCH 03/10] hw/sh4/Kconfig: Rename CONFIG_LM32 -> CONFIG_LM32_PERIPHERALS

Quoted 5 lines · Philippe Mathieu-Daudé

We want to be able to use the 'LM32' config for architecture specific features. As CONFIG_LM32 is only used to select peripherals, rename it CONFIG_LM32_PERIPHERALS.

_DEVICES if you want, either way:

Signature · 1 line
Alex Bennée
#7 lore raw

PATCH 4/10 hw/lm32/Kconfig: Have MILKYMIST select LM32_PERIPHERALS

In reply to Philippe Mathieu-Daudé

The Milkymist board requires more than the PTIMER. Directly select the LM32_PERIPHERALS. This fixes:

/usr/bin/ld:
libqemu-lm32-softmmu.fa.p/target_lm32_gdbstub.c.o: in function `lm32_cpu_gdb_read_register':
target/lm32/gdbstub.c:46: undefined reference to lm32_pic_get_im' target/lm32/gdbstub.c:48: undefined reference to lm32_pic_get_ip' libqemu-lm32-softmmu.fa.p/target_lm32_op_helper.c.o: in function `helper_wcsr_im':
target/lm32/op_helper.c:107: undefined reference to lm32_pic_set_im' libqemu-lm32-softmmu.fa.p/target_lm32_op_helper.c.o: in function helper_wcsr_ip':
target/lm32/op_helper.c:114: undefined reference to lm32_pic_set_ip' libqemu-lm32-softmmu.fa.p/target_lm32_op_helper.c.o: in function helper_wcsr_jtx':
target/lm32/op_helper.c:120: undefined reference to lm32_juart_set_jtx' libqemu-lm32-softmmu.fa.p/target_lm32_op_helper.c.o: in function helper_wcsr_jrx':
target/lm32/op_helper.c:125: undefined reference to lm32_juart_set_jrx' libqemu-lm32-softmmu.fa.p/target_lm32_translate.c.o: in function lm32_cpu_dump_state':
target/lm32/translate.c:1161: undefined reference to lm32_pic_get_ip' target/lm32/translate.c:1161: undefined reference to lm32_pic_get_im'

---
 hw/lm32/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/lm32/Kconfig +1 -1
index 5867f4db0cf..38ad22c54e4 100644
@@ -6,11 +6,11 @@ config MILKYMIST
     bool
     # FIXME: disabling it results in compile-time errors
     select MILKYMIST_TMU2 if OPENGL && X11
-    select PTIMER
     select PFLASH_CFI01
     select FRAMEBUFFER
     select SD
     select USB_OHCI
+    select LM32_PERIPHERALS
 
 config LM32_EVR
     bool
Signature · 1 line
2.26.2
Reviewed-by on v1 4/10
#8 lore raw

Re: [PATCH 04/10] hw/lm32/Kconfig: Have MILKYMIST select LM32_PERIPHERALS

Quoted 19 lines · Philippe Mathieu-Daudé

The Milkymist board requires more than the PTIMER. Directly select the LM32_PERIPHERALS. This fixes:

/usr/bin/ld:
libqemu-lm32-softmmu.fa.p/target_lm32_gdbstub.c.o: in function `lm32_cpu_gdb_read_register':
target/lm32/gdbstub.c:46: undefined reference to lm32_pic_get_im' target/lm32/gdbstub.c:48: undefined reference to lm32_pic_get_ip' libqemu-lm32-softmmu.fa.p/target_lm32_op_helper.c.o: in function `helper_wcsr_im':
target/lm32/op_helper.c:107: undefined reference to lm32_pic_set_im' libqemu-lm32-softmmu.fa.p/target_lm32_op_helper.c.o: in function helper_wcsr_ip':
target/lm32/op_helper.c:114: undefined reference to lm32_pic_set_ip' libqemu-lm32-softmmu.fa.p/target_lm32_op_helper.c.o: in function helper_wcsr_jtx':
target/lm32/op_helper.c:120: undefined reference to lm32_juart_set_jtx' libqemu-lm32-softmmu.fa.p/target_lm32_op_helper.c.o: in function helper_wcsr_jrx':
target/lm32/op_helper.c:125: undefined reference to lm32_juart_set_jrx' libqemu-lm32-softmmu.fa.p/target_lm32_translate.c.o: in function lm32_cpu_dump_state':
target/lm32/translate.c:1161: undefined reference to lm32_pic_get_ip' target/lm32/translate.c:1161: undefined reference to lm32_pic_get_im'

Quoted 1 line
Signature · 1 line
Alex Bennée
#9 lore raw

PATCH 5/10 meson: Introduce target-specific Kconfig

In reply to Philippe Mathieu-Daudé

Add a target-specific Kconfig.

Target foo now has CONFIG_FOO defined.

Two architecture have a particularity, ARM and MIPS:
their 64-bit version include the 32-bit subset.

---
I suppose X86_64 should also select I386?
No clue about PPC/RISCV.

---
 meson.build               |  3 ++-
 Kconfig                   |  1 +
 target/Kconfig            | 23 +++++++++++++++++++++++
 target/alpha/Kconfig      |  2 ++
 target/arm/Kconfig        |  6 ++++++
 target/avr/Kconfig        |  2 ++
 target/cris/Kconfig       |  2 ++
 target/hppa/Kconfig       |  2 ++
 target/i386/Kconfig       |  5 +++++
 target/lm32/Kconfig       |  2 ++
 target/m68k/Kconfig       |  2 ++
 target/microblaze/Kconfig |  2 ++
 target/mips/Kconfig       |  6 ++++++
 target/moxie/Kconfig      |  2 ++
 target/nios2/Kconfig      |  2 ++
 target/openrisc/Kconfig   |  2 ++
 target/ppc/Kconfig        |  5 +++++
 target/riscv/Kconfig      |  5 +++++
 target/rx/Kconfig         |  2 ++
 target/s390x/Kconfig      |  2 ++
 target/sh4/Kconfig        |  2 ++
 target/sparc/Kconfig      |  5 +++++
 target/tilegx/Kconfig     |  2 ++
 target/tricore/Kconfig    |  2 ++
 target/unicore32/Kconfig  |  2 ++
 target/xtensa/Kconfig     |  2 ++
 26 files changed, 92 insertions(+), 1 deletion(-)
 create mode 100644 target/Kconfig
 create mode 100644 target/alpha/Kconfig
 create mode 100644 target/arm/Kconfig
 create mode 100644 target/avr/Kconfig
 create mode 100644 target/cris/Kconfig
 create mode 100644 target/hppa/Kconfig
 create mode 100644 target/i386/Kconfig
 create mode 100644 target/lm32/Kconfig
 create mode 100644 target/m68k/Kconfig
 create mode 100644 target/microblaze/Kconfig
 create mode 100644 target/mips/Kconfig
 create mode 100644 target/moxie/Kconfig
 create mode 100644 target/nios2/Kconfig
 create mode 100644 target/openrisc/Kconfig
 create mode 100644 target/ppc/Kconfig
 create mode 100644 target/riscv/Kconfig
 create mode 100644 target/rx/Kconfig
 create mode 100644 target/s390x/Kconfig
 create mode 100644 target/sh4/Kconfig
 create mode 100644 target/sparc/Kconfig
 create mode 100644 target/tilegx/Kconfig
 create mode 100644 target/tricore/Kconfig
 create mode 100644 target/unicore32/Kconfig
 create mode 100644 target/xtensa/Kconfig
meson.build +2 -1
index f00b7754fd4..a2dda0ce95e 100644
@@ -1322,7 +1322,8 @@
       command: [minikconf,
                 get_option('default_devices') ? '--defconfig' : '--allnoconfig',
                 config_devices_mak, '@DEPFILE@', '@INPUT@',
-                host_kconfig, accel_kconfig])
+                host_kconfig, accel_kconfig,
+                'CONFIG_' + config_target['TARGET_ARCH'].to_upper() + '=y'])
 
     config_devices_data = configuration_data()
     config_devices = keyval.load(config_devices_mak)
Kconfig +1 -0
index bf694c42afe..c01e261e4e9 100644
@@ -1,4 +1,5 @@
 source Kconfig.host
 source backends/Kconfig
 source accel/Kconfig
+source target/Kconfig
 source hw/Kconfig
target/Kconfig new file +23 -0
new file mode 100644
index 00000000000..a6f719f223a
@@ -0,0 +1,23 @@
+source alpha/Kconfig
+source arm/Kconfig
+source avr/Kconfig
+source cris/Kconfig
+source hppa/Kconfig
+source i386/Kconfig
+source lm32/Kconfig
+source m68k/Kconfig
+source microblaze/Kconfig
+source mips/Kconfig
+source moxie/Kconfig
+source nios2/Kconfig
+source openrisc/Kconfig
+source ppc/Kconfig
+source riscv/Kconfig
+source rx/Kconfig
+source s390x/Kconfig
+source sh4/Kconfig
+source sparc/Kconfig
+source tilegx/Kconfig
+source tricore/Kconfig
+source unicore32/Kconfig
+source xtensa/Kconfig
target/alpha/Kconfig new file +2 -0
new file mode 100644
index 00000000000..267222c05b8
@@ -0,0 +1,2 @@
+config ALPHA
+    bool
target/arm/Kconfig new file +6 -0
new file mode 100644
index 00000000000..3f3394a22b2
@@ -0,0 +1,6 @@
+config ARM
+    bool
+
+config AARCH64
+    bool
+    select ARM
target/avr/Kconfig new file +2 -0
new file mode 100644
index 00000000000..155592d3537
@@ -0,0 +1,2 @@
+config AVR
+    bool
target/cris/Kconfig new file +2 -0
new file mode 100644
index 00000000000..3fdc309fbbd
@@ -0,0 +1,2 @@
+config CRIS
+    bool
target/hppa/Kconfig new file +2 -0
new file mode 100644
index 00000000000..395a35d799c
@@ -0,0 +1,2 @@
+config HPPA
+    bool
target/i386/Kconfig new file +5 -0
new file mode 100644
index 00000000000..ce6968906ee
@@ -0,0 +1,5 @@
+config I386
+    bool
+
+config X86_64
+    bool
target/lm32/Kconfig new file +2 -0
new file mode 100644
index 00000000000..09de5b703a3
@@ -0,0 +1,2 @@
+config LM32
+    bool
target/m68k/Kconfig new file +2 -0
new file mode 100644
index 00000000000..23debad519a
@@ -0,0 +1,2 @@
+config M68K
+    bool
target/microblaze/Kconfig new file +2 -0
new file mode 100644
index 00000000000..a5410d9218d
@@ -0,0 +1,2 @@
+config MICROBLAZE
+    bool
target/mips/Kconfig new file +6 -0
new file mode 100644
index 00000000000..6adf1453548
@@ -0,0 +1,6 @@
+config MIPS
+    bool
+
+config MIPS64
+    bool
+    select MIPS
target/moxie/Kconfig new file +2 -0
new file mode 100644
index 00000000000..52391bbd289
@@ -0,0 +1,2 @@
+config MOXIE
+    bool
target/nios2/Kconfig new file +2 -0
new file mode 100644
index 00000000000..1529ab8950d
@@ -0,0 +1,2 @@
+config NIOS2
+    bool
target/openrisc/Kconfig new file +2 -0
new file mode 100644
index 00000000000..e0da4ac1dfc
@@ -0,0 +1,2 @@
+config OPENRISC
+    bool
target/ppc/Kconfig new file +5 -0
new file mode 100644
index 00000000000..3ff152051a3
@@ -0,0 +1,5 @@
+config PPC
+    bool
+
+config PPC64
+    bool
target/riscv/Kconfig new file +5 -0
new file mode 100644
index 00000000000..b9e5932f13f
@@ -0,0 +1,5 @@
+config RISCV32
+    bool
+
+config RISCV64
+    bool
target/rx/Kconfig new file +2 -0
new file mode 100644
index 00000000000..aceb5ed28fe
@@ -0,0 +1,2 @@
+config RX
+    bool
target/s390x/Kconfig new file +2 -0
new file mode 100644
index 00000000000..72da48136c6
@@ -0,0 +1,2 @@
+config S390X
+    bool
target/sh4/Kconfig new file +2 -0
new file mode 100644
index 00000000000..2397c860280
@@ -0,0 +1,2 @@
+config SH4
+    bool
target/sparc/Kconfig new file +5 -0
new file mode 100644
index 00000000000..70cc0f3a210
@@ -0,0 +1,5 @@
+config SPARC
+    bool
+
+config SPARC64
+    bool
target/tilegx/Kconfig new file +2 -0
new file mode 100644
index 00000000000..aad882826ab
@@ -0,0 +1,2 @@
+config TILEGX
+    bool
target/tricore/Kconfig new file +2 -0
new file mode 100644
index 00000000000..93134093093
@@ -0,0 +1,2 @@
+config TRICORE
+    bool
target/unicore32/Kconfig new file +2 -0
new file mode 100644
index 00000000000..62c9d10b38f
@@ -0,0 +1,2 @@
+config UNICORE32
+    bool
target/xtensa/Kconfig new file +2 -0
new file mode 100644
index 00000000000..a3c8dc7f6d7
@@ -0,0 +1,2 @@
+config XTENSA
+    bool
Signature · 1 line
2.26.2
Acked-by on v1 5/10
#10 lore raw

Re: [PATCH 05/10] meson: Introduce target-specific Kconfig

вс, 31 янв. 2021 г., 12:13 Philippe Mathieu-Daudé <[email protected]>:

Quoted 9 lines

Add a target-specific Kconfig.

Target foo now has CONFIG_FOO defined.

Two architecture have a particularity, ARM and MIPS:
their 64-bit version include the 32-bit subset.

For SPARC part:

---

Quoted 318 lines

I suppose X86_64 should also select I386?
No clue about PPC/RISCV.

---
 meson.build               |  3 ++-
 Kconfig                   |  1 +
 target/Kconfig            | 23 +++++++++++++++++++++++
 target/alpha/Kconfig      |  2 ++
 target/arm/Kconfig        |  6 ++++++
 target/avr/Kconfig        |  2 ++
 target/cris/Kconfig       |  2 ++
 target/hppa/Kconfig       |  2 ++
 target/i386/Kconfig       |  5 +++++
 target/lm32/Kconfig       |  2 ++
 target/m68k/Kconfig       |  2 ++
 target/microblaze/Kconfig |  2 ++
 target/mips/Kconfig       |  6 ++++++
 target/moxie/Kconfig      |  2 ++
 target/nios2/Kconfig      |  2 ++
 target/openrisc/Kconfig   |  2 ++
 target/ppc/Kconfig        |  5 +++++
 target/riscv/Kconfig      |  5 +++++
 target/rx/Kconfig         |  2 ++
 target/s390x/Kconfig      |  2 ++
 target/sh4/Kconfig        |  2 ++
 target/sparc/Kconfig      |  5 +++++
 target/tilegx/Kconfig     |  2 ++
 target/tricore/Kconfig    |  2 ++
 target/unicore32/Kconfig  |  2 ++
 target/xtensa/Kconfig     |  2 ++
 26 files changed, 92 insertions(+), 1 deletion(-)
 create mode 100644 target/Kconfig
 create mode 100644 target/alpha/Kconfig
 create mode 100644 target/arm/Kconfig
 create mode 100644 target/avr/Kconfig
 create mode 100644 target/cris/Kconfig
 create mode 100644 target/hppa/Kconfig
 create mode 100644 target/i386/Kconfig
 create mode 100644 target/lm32/Kconfig
 create mode 100644 target/m68k/Kconfig
 create mode 100644 target/microblaze/Kconfig
 create mode 100644 target/mips/Kconfig
 create mode 100644 target/moxie/Kconfig
 create mode 100644 target/nios2/Kconfig
 create mode 100644 target/openrisc/Kconfig
 create mode 100644 target/ppc/Kconfig
 create mode 100644 target/riscv/Kconfig
 create mode 100644 target/rx/Kconfig
 create mode 100644 target/s390x/Kconfig
 create mode 100644 target/sh4/Kconfig
 create mode 100644 target/sparc/Kconfig
 create mode 100644 target/tilegx/Kconfig
 create mode 100644 target/tricore/Kconfig
 create mode 100644 target/unicore32/Kconfig
 create mode 100644 target/xtensa/Kconfig
meson.build +2 -1
index f00b7754fd4..a2dda0ce95e 100644
@@ -1322,7 +1322,8 @@
       command: [minikconf,
                 get_option('default_devices') ? '--defconfig' :
 '--allnoconfig',
                 config_devices_mak, '@DEPFILE@', '@INPUT@',
-                host_kconfig, accel_kconfig])
+                host_kconfig, accel_kconfig,
+                'CONFIG_' + config_target['TARGET_ARCH'].to_upper() +
 '=y'])
 

config_devices_data = configuration_data() config_devices = keyval.load(config_devices_mak)

Kconfig +1 -0
index bf694c42afe..c01e261e4e9 100644
@@ -1,4 +1,5 @@
 source Kconfig.host
 source backends/Kconfig
 source accel/Kconfig
+source target/Kconfig
 source hw/Kconfig
target/Kconfig new file +23 -0
new file mode 100644
index 00000000000..a6f719f223a
@@ -0,0 +1,23 @@
+source alpha/Kconfig
+source arm/Kconfig
+source avr/Kconfig
+source cris/Kconfig
+source hppa/Kconfig
+source i386/Kconfig
+source lm32/Kconfig
+source m68k/Kconfig
+source microblaze/Kconfig
+source mips/Kconfig
+source moxie/Kconfig
+source nios2/Kconfig
+source openrisc/Kconfig
+source ppc/Kconfig
+source riscv/Kconfig
+source rx/Kconfig
+source s390x/Kconfig
+source sh4/Kconfig
+source sparc/Kconfig
+source tilegx/Kconfig
+source tricore/Kconfig
+source unicore32/Kconfig
+source xtensa/Kconfig
target/alpha/Kconfig new file +2 -0
new file mode 100644
index 00000000000..267222c05b8
@@ -0,0 +1,2 @@
+config ALPHA
+    bool
target/arm/Kconfig new file +6 -0
new file mode 100644
index 00000000000..3f3394a22b2
@@ -0,0 +1,6 @@
+config ARM
+    bool
+
+config AARCH64
+    bool
+    select ARM
target/avr/Kconfig new file +2 -0
new file mode 100644
index 00000000000..155592d3537
@@ -0,0 +1,2 @@
+config AVR
+    bool
target/cris/Kconfig new file +2 -0
new file mode 100644
index 00000000000..3fdc309fbbd
@@ -0,0 +1,2 @@
+config CRIS
+    bool
target/hppa/Kconfig new file +2 -0
new file mode 100644
index 00000000000..395a35d799c
@@ -0,0 +1,2 @@
+config HPPA
+    bool
target/i386/Kconfig new file +5 -0
new file mode 100644
index 00000000000..ce6968906ee
@@ -0,0 +1,5 @@
+config I386
+    bool
+
+config X86_64
+    bool
target/lm32/Kconfig new file +2 -0
new file mode 100644
index 00000000000..09de5b703a3
@@ -0,0 +1,2 @@
+config LM32
+    bool
target/m68k/Kconfig new file +2 -0
new file mode 100644
index 00000000000..23debad519a
@@ -0,0 +1,2 @@
+config M68K
+    bool
target/microblaze/Kconfig new file +2 -0
new file mode 100644
index 00000000000..a5410d9218d
@@ -0,0 +1,2 @@
+config MICROBLAZE
+    bool
target/mips/Kconfig new file +6 -0
new file mode 100644
index 00000000000..6adf1453548
@@ -0,0 +1,6 @@
+config MIPS
+    bool
+
+config MIPS64
+    bool
+    select MIPS
target/moxie/Kconfig new file +2 -0
new file mode 100644
index 00000000000..52391bbd289
@@ -0,0 +1,2 @@
+config MOXIE
+    bool
target/nios2/Kconfig new file +2 -0
new file mode 100644
index 00000000000..1529ab8950d
@@ -0,0 +1,2 @@
+config NIOS2
+    bool
target/openrisc/Kconfig new file +2 -0
new file mode 100644
index 00000000000..e0da4ac1dfc
@@ -0,0 +1,2 @@
+config OPENRISC
+    bool
target/ppc/Kconfig new file +5 -0
new file mode 100644
index 00000000000..3ff152051a3
@@ -0,0 +1,5 @@
+config PPC
+    bool
+
+config PPC64
+    bool
target/riscv/Kconfig new file +5 -0
new file mode 100644
index 00000000000..b9e5932f13f
@@ -0,0 +1,5 @@
+config RISCV32
+    bool
+
+config RISCV64
+    bool
target/rx/Kconfig new file +2 -0
new file mode 100644
index 00000000000..aceb5ed28fe
@@ -0,0 +1,2 @@
+config RX
+    bool
target/s390x/Kconfig new file +2 -0
new file mode 100644
index 00000000000..72da48136c6
@@ -0,0 +1,2 @@
+config S390X
+    bool
target/sh4/Kconfig new file +2 -0
new file mode 100644
index 00000000000..2397c860280
@@ -0,0 +1,2 @@
+config SH4
+    bool
target/sparc/Kconfig new file +5 -0
new file mode 100644
index 00000000000..70cc0f3a210
@@ -0,0 +1,5 @@
+config SPARC
+    bool
+
+config SPARC64
+    bool
target/tilegx/Kconfig new file +2 -0
new file mode 100644
index 00000000000..aad882826ab
@@ -0,0 +1,2 @@
+config TILEGX
+    bool
target/tricore/Kconfig new file +2 -0
new file mode 100644
index 00000000000..93134093093
@@ -0,0 +1,2 @@
+config TRICORE
+    bool
target/unicore32/Kconfig new file +2 -0
new file mode 100644
index 00000000000..62c9d10b38f
@@ -0,0 +1,2 @@
+config UNICORE32
+    bool
target/xtensa/Kconfig new file +2 -1
new file mode 100644
index 00000000000..a3c8dc7f6d7
@@ -0,0 +1,2 @@
+config XTENSA
+    bool
--

2.26.2

#11 lore raw

Re: [PATCH 05/10] meson: Introduce target-specific Kconfig

In reply to Philippe Mathieu-Daudé
Quoted 9 lines · Philippe Mathieu-Daudé

Add a target-specific Kconfig.

Target foo now has CONFIG_FOO defined.

Two architecture have a particularity, ARM and MIPS:
their 64-bit version include the 32-bit subset.

---

...

Quoted 59 lines
meson.build +2 -1
index f00b7754fd4..a2dda0ce95e 100644
@@ -1322,7 +1322,8 @@
       command: [minikconf,
                 get_option('default_devices') ? '--defconfig' : '--allnoconfig',
                 config_devices_mak, '@DEPFILE@', '@INPUT@',
-                host_kconfig, accel_kconfig])
+                host_kconfig, accel_kconfig,
+                'CONFIG_' + config_target['TARGET_ARCH'].to_upper() + '=y'])
 
     config_devices_data = configuration_data()
     config_devices = keyval.load(config_devices_mak)
Kconfig +1 -0
index bf694c42afe..c01e261e4e9 100644
@@ -1,4 +1,5 @@
 source Kconfig.host
 source backends/Kconfig
 source accel/Kconfig
+source target/Kconfig
 source hw/Kconfig
target/Kconfig new file +23 -0
new file mode 100644
index 00000000000..a6f719f223a
@@ -0,0 +1,23 @@
+source alpha/Kconfig
+source arm/Kconfig
+source avr/Kconfig
+source cris/Kconfig
+source hppa/Kconfig
+source i386/Kconfig
+source lm32/Kconfig
+source m68k/Kconfig
+source microblaze/Kconfig
+source mips/Kconfig
+source moxie/Kconfig
+source nios2/Kconfig
+source openrisc/Kconfig
+source ppc/Kconfig
+source riscv/Kconfig
+source rx/Kconfig
+source s390x/Kconfig
+source sh4/Kconfig
+source sparc/Kconfig
+source tilegx/Kconfig
+source tricore/Kconfig
+source unicore32/Kconfig
+source xtensa/Kconfig
target/arm/Kconfig new file +0 -0
new file mode 100644
index 00000000000..3f3394a22b2

target/arm/Kconfig line 6

Quoted 6 lines
target/arm/Kconfig new file +6 -0
@@ -0,0 +1,6 @@
+config ARM
+    bool
+
+config AARCH64
+    bool
+    select ARM

This isn't correct yet, as Kconfig is primarly designed for devices, and per docs/devel/kconfig.rst:

"devices are usually ``default y`` if and only if they have at
least one ``depends on``;"

So having one machine "depends on AARCH64" selects AARCH64 on ARM :/ I'll see if explicit each arch as 'default n' helps...

#12 lore raw

Re: [PATCH 05/10] meson: Introduce target-specific Kconfig

Quoted 81 lines · Philippe Mathieu-Daudé
Quoted 9 lines · Philippe Mathieu-Daudé

Add a target-specific Kconfig.

Target foo now has CONFIG_FOO defined.

Two architecture have a particularity, ARM and MIPS:
their 64-bit version include the 32-bit subset.

---

...

Quoted 59 lines
meson.build +2 -1
index f00b7754fd4..a2dda0ce95e 100644
@@ -1322,7 +1322,8 @@
       command: [minikconf,
                 get_option('default_devices') ? '--defconfig' : '--allnoconfig',
                 config_devices_mak, '@DEPFILE@', '@INPUT@',
-                host_kconfig, accel_kconfig])
+                host_kconfig, accel_kconfig,
+                'CONFIG_' + config_target['TARGET_ARCH'].to_upper() + '=y'])
 
     config_devices_data = configuration_data()
     config_devices = keyval.load(config_devices_mak)
Kconfig +1 -0
index bf694c42afe..c01e261e4e9 100644
@@ -1,4 +1,5 @@
 source Kconfig.host
 source backends/Kconfig
 source accel/Kconfig
+source target/Kconfig
 source hw/Kconfig
target/Kconfig new file +23 -0
new file mode 100644
index 00000000000..a6f719f223a
@@ -0,0 +1,23 @@
+source alpha/Kconfig
+source arm/Kconfig
+source avr/Kconfig
+source cris/Kconfig
+source hppa/Kconfig
+source i386/Kconfig
+source lm32/Kconfig
+source m68k/Kconfig
+source microblaze/Kconfig
+source mips/Kconfig
+source moxie/Kconfig
+source nios2/Kconfig
+source openrisc/Kconfig
+source ppc/Kconfig
+source riscv/Kconfig
+source rx/Kconfig
+source s390x/Kconfig
+source sh4/Kconfig
+source sparc/Kconfig
+source tilegx/Kconfig
+source tricore/Kconfig
+source unicore32/Kconfig
+source xtensa/Kconfig
target/arm/Kconfig new file +0 -0
new file mode 100644
index 00000000000..3f3394a22b2

target/arm/Kconfig line 6

Quoted 6 lines
target/arm/Kconfig new file +6 -0
@@ -0,0 +1,6 @@
+config ARM
+    bool
+
+config AARCH64
+    bool
+    select ARM

This isn't correct yet, as Kconfig is primarly designed for devices, and per docs/devel/kconfig.rst:

Quoted 5 lines

"devices are usually ``default y`` if and only if they have at
least one ``depends on``;"

So having one machine "depends on AARCH64" selects AARCH64 on ARM :/ I'll see if explicit each arch as 'default n' helps...

Taking this comment back, the approach works but is fragile, as an incorrect dependency can select the wrong arch and it is hard to detect.

#13 lore raw

Re: [PATCH 05/10] meson: Introduce target-specific Kconfig

In reply to Philippe Mathieu-Daudé
Quoted 8 lines · Philippe Mathieu-Daudé

Add a target-specific Kconfig.

Target foo now has CONFIG_FOO defined.

Two architecture have a particularity, ARM and MIPS:
their 64-bit version include the 32-bit subset.

Quoted 8 lines

---
I suppose X86_64 should also select I386?
No clue about PPC/RISCV.

---
 meson.build               |  3 ++-
 Kconfig                   |  1 +
 target/Kconfig            | 23 +++++++++++++++++++++++
 target/alpha/Kconfig      |  2 ++

Repeating myself through the magic of copy and paste:

In docs/devel/kconfig.rst we make the distinction between:

**subsystems**, of which **buses** are a special case **devices**
**device groups**
**boards**
**internal elements**

I think we need to document the target/* Kconfigs in kconfig.rst at the same time as adding all of these.

Quoted 305 lines
 target/arm/Kconfig        |  6 ++++++
 target/avr/Kconfig        |  2 ++
 target/cris/Kconfig       |  2 ++
 target/hppa/Kconfig       |  2 ++
 target/i386/Kconfig       |  5 +++++
 target/lm32/Kconfig       |  2 ++
 target/m68k/Kconfig       |  2 ++
 target/microblaze/Kconfig |  2 ++
 target/mips/Kconfig       |  6 ++++++
 target/moxie/Kconfig      |  2 ++
 target/nios2/Kconfig      |  2 ++
 target/openrisc/Kconfig   |  2 ++
 target/ppc/Kconfig        |  5 +++++
 target/riscv/Kconfig      |  5 +++++
 target/rx/Kconfig         |  2 ++
 target/s390x/Kconfig      |  2 ++
 target/sh4/Kconfig        |  2 ++
 target/sparc/Kconfig      |  5 +++++
 target/tilegx/Kconfig     |  2 ++
 target/tricore/Kconfig    |  2 ++
 target/unicore32/Kconfig  |  2 ++
 target/xtensa/Kconfig     |  2 ++
 26 files changed, 92 insertions(+), 1 deletion(-)
 create mode 100644 target/Kconfig
 create mode 100644 target/alpha/Kconfig
 create mode 100644 target/arm/Kconfig
 create mode 100644 target/avr/Kconfig
 create mode 100644 target/cris/Kconfig
 create mode 100644 target/hppa/Kconfig
 create mode 100644 target/i386/Kconfig
 create mode 100644 target/lm32/Kconfig
 create mode 100644 target/m68k/Kconfig
 create mode 100644 target/microblaze/Kconfig
 create mode 100644 target/mips/Kconfig
 create mode 100644 target/moxie/Kconfig
 create mode 100644 target/nios2/Kconfig
 create mode 100644 target/openrisc/Kconfig
 create mode 100644 target/ppc/Kconfig
 create mode 100644 target/riscv/Kconfig
 create mode 100644 target/rx/Kconfig
 create mode 100644 target/s390x/Kconfig
 create mode 100644 target/sh4/Kconfig
 create mode 100644 target/sparc/Kconfig
 create mode 100644 target/tilegx/Kconfig
 create mode 100644 target/tricore/Kconfig
 create mode 100644 target/unicore32/Kconfig
 create mode 100644 target/xtensa/Kconfig
meson.build +2 -1
index f00b7754fd4..a2dda0ce95e 100644
@@ -1322,7 +1322,8 @@
       command: [minikconf,
                 get_option('default_devices') ? '--defconfig' : '--allnoconfig',
                 config_devices_mak, '@DEPFILE@', '@INPUT@',
-                host_kconfig, accel_kconfig])
+                host_kconfig, accel_kconfig,
+                'CONFIG_' + config_target['TARGET_ARCH'].to_upper() + '=y'])
 
     config_devices_data = configuration_data()
     config_devices = keyval.load(config_devices_mak)
Kconfig +1 -0
index bf694c42afe..c01e261e4e9 100644
@@ -1,4 +1,5 @@
 source Kconfig.host
 source backends/Kconfig
 source accel/Kconfig
+source target/Kconfig
 source hw/Kconfig
target/Kconfig new file +23 -0
new file mode 100644
index 00000000000..a6f719f223a
@@ -0,0 +1,23 @@
+source alpha/Kconfig
+source arm/Kconfig
+source avr/Kconfig
+source cris/Kconfig
+source hppa/Kconfig
+source i386/Kconfig
+source lm32/Kconfig
+source m68k/Kconfig
+source microblaze/Kconfig
+source mips/Kconfig
+source moxie/Kconfig
+source nios2/Kconfig
+source openrisc/Kconfig
+source ppc/Kconfig
+source riscv/Kconfig
+source rx/Kconfig
+source s390x/Kconfig
+source sh4/Kconfig
+source sparc/Kconfig
+source tilegx/Kconfig
+source tricore/Kconfig
+source unicore32/Kconfig
+source xtensa/Kconfig
target/alpha/Kconfig new file +2 -0
new file mode 100644
index 00000000000..267222c05b8
@@ -0,0 +1,2 @@
+config ALPHA
+    bool
target/arm/Kconfig new file +6 -0
new file mode 100644
index 00000000000..3f3394a22b2
@@ -0,0 +1,6 @@
+config ARM
+    bool
+
+config AARCH64
+    bool
+    select ARM
target/avr/Kconfig new file +2 -0
new file mode 100644
index 00000000000..155592d3537
@@ -0,0 +1,2 @@
+config AVR
+    bool
target/cris/Kconfig new file +2 -0
new file mode 100644
index 00000000000..3fdc309fbbd
@@ -0,0 +1,2 @@
+config CRIS
+    bool
target/hppa/Kconfig new file +2 -0
new file mode 100644
index 00000000000..395a35d799c
@@ -0,0 +1,2 @@
+config HPPA
+    bool
target/i386/Kconfig new file +5 -0
new file mode 100644
index 00000000000..ce6968906ee
@@ -0,0 +1,5 @@
+config I386
+    bool
+
+config X86_64
+    bool
target/lm32/Kconfig new file +2 -0
new file mode 100644
index 00000000000..09de5b703a3
@@ -0,0 +1,2 @@
+config LM32
+    bool
target/m68k/Kconfig new file +2 -0
new file mode 100644
index 00000000000..23debad519a
@@ -0,0 +1,2 @@
+config M68K
+    bool
target/microblaze/Kconfig new file +2 -0
new file mode 100644
index 00000000000..a5410d9218d
@@ -0,0 +1,2 @@
+config MICROBLAZE
+    bool
target/mips/Kconfig new file +6 -0
new file mode 100644
index 00000000000..6adf1453548
@@ -0,0 +1,6 @@
+config MIPS
+    bool
+
+config MIPS64
+    bool
+    select MIPS
target/moxie/Kconfig new file +2 -0
new file mode 100644
index 00000000000..52391bbd289
@@ -0,0 +1,2 @@
+config MOXIE
+    bool
target/nios2/Kconfig new file +2 -0
new file mode 100644
index 00000000000..1529ab8950d
@@ -0,0 +1,2 @@
+config NIOS2
+    bool
target/openrisc/Kconfig new file +2 -0
new file mode 100644
index 00000000000..e0da4ac1dfc
@@ -0,0 +1,2 @@
+config OPENRISC
+    bool
target/ppc/Kconfig new file +5 -0
new file mode 100644
index 00000000000..3ff152051a3
@@ -0,0 +1,5 @@
+config PPC
+    bool
+
+config PPC64
+    bool
target/riscv/Kconfig new file +5 -0
new file mode 100644
index 00000000000..b9e5932f13f
@@ -0,0 +1,5 @@
+config RISCV32
+    bool
+
+config RISCV64
+    bool
target/rx/Kconfig new file +2 -0
new file mode 100644
index 00000000000..aceb5ed28fe
@@ -0,0 +1,2 @@
+config RX
+    bool
target/s390x/Kconfig new file +2 -0
new file mode 100644
index 00000000000..72da48136c6
@@ -0,0 +1,2 @@
+config S390X
+    bool
target/sh4/Kconfig new file +2 -0
new file mode 100644
index 00000000000..2397c860280
@@ -0,0 +1,2 @@
+config SH4
+    bool
target/sparc/Kconfig new file +5 -0
new file mode 100644
index 00000000000..70cc0f3a210
@@ -0,0 +1,5 @@
+config SPARC
+    bool
+
+config SPARC64
+    bool
target/tilegx/Kconfig new file +2 -0
new file mode 100644
index 00000000000..aad882826ab
@@ -0,0 +1,2 @@
+config TILEGX
+    bool
target/tricore/Kconfig new file +2 -0
new file mode 100644
index 00000000000..93134093093
@@ -0,0 +1,2 @@
+config TRICORE
+    bool
target/unicore32/Kconfig new file +2 -0
new file mode 100644
index 00000000000..62c9d10b38f
@@ -0,0 +1,2 @@
+config UNICORE32
+    bool
target/xtensa/Kconfig new file +2 -0
new file mode 100644
index 00000000000..a3c8dc7f6d7
@@ -0,0 +1,2 @@
+config XTENSA
+    bool
Signature · 1 line
Alex Bennée
#14 lore raw

PATCH 6/10 target/i386: Move SEV feature to target Kconfig

In reply to Philippe Mathieu-Daudé

SEV is an architecture feature, move its declaration to target/i386/.

---
 hw/i386/Kconfig     | 4 ----
 target/i386/Kconfig | 4 ++++
 2 files changed, 4 insertions(+), 4 deletions(-)
hw/i386/Kconfig +0 -4
index 7f91f30877f..3d67c172dab 100644
@@ -1,7 +1,3 @@
-config SEV
-    bool
-    depends on KVM
-
 config PC
     bool
     imply APPLESMC
target/i386/Kconfig +4 -0
index ce6968906ee..27c76c554c7 100644
@@ -3,3 +3,7 @@ config I386
 
 config X86_64
     bool
+
+config SEV
+    bool
+    depends on KVM && I386
Signature · 1 line
2.26.2
Reviewed-by on v1 6/10
#15 lore raw

Re: [PATCH 06/10] target/i386: Move SEV feature to target Kconfig

Quoted 1 line · Philippe Mathieu-Daudé

SEV is an architecture feature, move its declaration to target/i386/.

In docs/devel/kconfig.rst we make the distinction between:

**subsystems**, of which **buses** are a special case **devices**
**device groups**
**boards**
**internal elements**

Are we treating architecture features as internal elements or should we add some additional words to the kconfig document before we starting to move stuff there. In fact I realise this is better directed at 5/10 so for this patch:

Quoted 31 lines
---
 hw/i386/Kconfig     | 4 ----
 target/i386/Kconfig | 4 ++++
 2 files changed, 4 insertions(+), 4 deletions(-)
hw/i386/Kconfig +0 -4
index 7f91f30877f..3d67c172dab 100644
@@ -1,7 +1,3 @@
-config SEV
-    bool
-    depends on KVM
-
 config PC
     bool
     imply APPLESMC
target/i386/Kconfig +4 -0
index ce6968906ee..27c76c554c7 100644
@@ -3,3 +3,7 @@ config I386
 
 config X86_64
     bool
+
+config SEV
+    bool
+    depends on KVM && I386
Signature · 1 line
Alex Bennée
#16 lore raw

PATCH 7/10 target/arm: Move V7M feature to target Kconfig

In reply to Philippe Mathieu-Daudé

V7M is an architecture feature, move its declaration to target/arm/.

---
 hw/arm/Kconfig     | 4 ----
 target/arm/Kconfig | 4 ++++
 2 files changed, 4 insertions(+), 4 deletions(-)
hw/arm/Kconfig +0 -4
index 09298881f2f..f3ecb73a3d8 100644
@@ -292,10 +292,6 @@ config ZYNQ
     select XILINX_SPIPS
     select ZYNQ_DEVCFG
 
-config ARM_V7M
-    bool
-    select PTIMER
-
 config ALLWINNER_A10
     bool
     select AHCI
target/arm/Kconfig +4 -0
index 3f3394a22b2..1f05de47ca6 100644
@@ -4,3 +4,7 @@ config ARM
 config AARCH64
     bool
     select ARM
+
+config ARM_V7M
+    bool
+    select PTIMER
Signature · 1 line
2.26.2
#18 lore raw

PATCH 8/10 default-configs: Remove unnecessary SEMIHOSTING selection

In reply to Philippe Mathieu-Daudé

Commit 56b5170c87e ("semihosting: Move ARM semihosting code to shared directories") selected ARM_COMPATIBLE_SEMIHOSTING which already selects SEMIHOSTING. No need to select it again.

---
 default-configs/devices/arm-softmmu.mak     | 1 -
 default-configs/devices/riscv32-softmmu.mak | 1 -
 default-configs/devices/riscv64-softmmu.mak | 1 -
 3 files changed, 3 deletions(-)
default-configs/devices/arm-softmmu.mak +0 -1
index 0500156a0c7..341d439de6f 100644
@@ -41,6 +41,5 @@ CONFIG_MICROBIT=y
 CONFIG_FSL_IMX25=y
 CONFIG_FSL_IMX7=y
 CONFIG_FSL_IMX6UL=y
-CONFIG_SEMIHOSTING=y
 CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y
 CONFIG_ALLWINNER_H3=y
default-configs/devices/riscv32-softmmu.mak +0 -1
index d847bd5692e..5c9ad2590ef 100644
@@ -3,7 +3,6 @@
 # Uncomment the following lines to disable these optional devices:
 #
 #CONFIG_PCI_DEVICES=n
-CONFIG_SEMIHOSTING=y
 CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y
 
 # Boards:
default-configs/devices/riscv64-softmmu.mak +0 -1
index d5eec75f05e..d5b2e25b6df 100644
@@ -3,7 +3,6 @@
 # Uncomment the following lines to disable these optional devices:
 #
 #CONFIG_PCI_DEVICES=n
-CONFIG_SEMIHOSTING=y
 CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y
 
 # Boards:
Signature · 1 line
2.26.2
Reviewed-by on v1 8/10
#19 lore raw

Re: [PATCH 08/10] default-configs: Remove unnecessary SEMIHOSTING selection

Quoted 5 lines · Philippe Mathieu-Daudé

Commit 56b5170c87e ("semihosting: Move ARM semihosting code to shared directories") selected ARM_COMPATIBLE_SEMIHOSTING which already selects SEMIHOSTING. No need to select it again.

Signature · 1 line
Alex Bennée
Reviewed-by on v1 8/10
#20 lore raw

Re: [PATCH 08/10] default-configs: Remove unnecessary SEMIHOSTING selection

In reply to Philippe Mathieu-Daudé
Quoted 6 lines · Philippe Mathieu-Daudé

Commit 56b5170c87e ("semihosting: Move ARM semihosting code to shared directories") selected ARM_COMPATIBLE_SEMIHOSTING which already selects SEMIHOSTING. No need to select it again.

Alistair

Quoted 45 lines
---
 default-configs/devices/arm-softmmu.mak     | 1 -
 default-configs/devices/riscv32-softmmu.mak | 1 -
 default-configs/devices/riscv64-softmmu.mak | 1 -
 3 files changed, 3 deletions(-)
default-configs/devices/arm-softmmu.mak +0 -1
index 0500156a0c7..341d439de6f 100644
@@ -41,6 +41,5 @@ CONFIG_MICROBIT=y
 CONFIG_FSL_IMX25=y
 CONFIG_FSL_IMX7=y
 CONFIG_FSL_IMX6UL=y
-CONFIG_SEMIHOSTING=y
 CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y
 CONFIG_ALLWINNER_H3=y
default-configs/devices/riscv32-softmmu.mak +0 -1
index d847bd5692e..5c9ad2590ef 100644
@@ -3,7 +3,6 @@
 # Uncomment the following lines to disable these optional devices:
 #
 #CONFIG_PCI_DEVICES=n
-CONFIG_SEMIHOSTING=y
 CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y
 
 # Boards:
default-configs/devices/riscv64-softmmu.mak +0 -2
index d5eec75f05e..d5b2e25b6df 100644
@@ -3,7 +3,6 @@
 # Uncomment the following lines to disable these optional devices:
 #
 #CONFIG_PCI_DEVICES=n
-CONFIG_SEMIHOSTING=y
 CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y
 
 # Boards:
--

2.26.2

#21 lore raw

PATCH 9/10 target: Move ARM_COMPATIBLE_SEMIHOSTING feature to target Kconfig

In reply to Philippe Mathieu-Daudé

ARM_COMPATIBLE_SEMIHOSTING is an architecture feature, move its declaration to each target/ARCH/.

Note, we do not modify the linux-user targets, as user-mode builds don't use Kconfig.

---
 default-configs/devices/arm-softmmu.mak     | 1 -
 default-configs/devices/riscv32-softmmu.mak | 1 -
 default-configs/devices/riscv64-softmmu.mak | 1 -
 target/arm/Kconfig                          | 1 +
 target/riscv/Kconfig                        | 2 ++
 5 files changed, 3 insertions(+), 3 deletions(-)
default-configs/devices/arm-softmmu.mak +0 -1
index 341d439de6f..0824e9be795 100644
@@ -41,5 +41,4 @@ CONFIG_MICROBIT=y
 CONFIG_FSL_IMX25=y
 CONFIG_FSL_IMX7=y
 CONFIG_FSL_IMX6UL=y
-CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y
 CONFIG_ALLWINNER_H3=y
default-configs/devices/riscv32-softmmu.mak +0 -1
index 5c9ad2590ef..94a236c9c25 100644
@@ -3,7 +3,6 @@
 # Uncomment the following lines to disable these optional devices:
 #
 #CONFIG_PCI_DEVICES=n
-CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y
 
 # Boards:
 #
default-configs/devices/riscv64-softmmu.mak +0 -1
index d5b2e25b6df..76b61956489 100644
@@ -3,7 +3,6 @@
 # Uncomment the following lines to disable these optional devices:
 #
 #CONFIG_PCI_DEVICES=n
-CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y
 
 # Boards:
 #
target/arm/Kconfig +1 -0
index 1f05de47ca6..ae89d05c7e5 100644
@@ -1,5 +1,6 @@
 config ARM
     bool
+    select ARM_COMPATIBLE_SEMIHOSTING
 
 config AARCH64
     bool
target/riscv/Kconfig +2 -0
index b9e5932f13f..c3b9d8a1cf1 100644
@@ -1,5 +1,7 @@
 config RISCV32
     bool
+    select ARM_COMPATIBLE_SEMIHOSTING
 
 config RISCV64
     bool
+    select ARM_COMPATIBLE_SEMIHOSTING
Signature · 1 line
2.26.2
Reviewed-by on v1 9/10
#22 lore raw

Re: [PATCH 09/10] target: Move ARM_COMPATIBLE_SEMIHOSTING feature to target Kconfig

Quoted 7 lines · Philippe Mathieu-Daudé

ARM_COMPATIBLE_SEMIHOSTING is an architecture feature, move its declaration to each target/ARCH/.

Note, we do not modify the linux-user targets, as user-mode builds don't use Kconfig.

Signature · 1 line
Alex Bennée
Reviewed-by on v1 9/10
#23 lore raw

Re: [PATCH 09/10] target: Move ARM_COMPATIBLE_SEMIHOSTING feature to target Kconfig

In reply to Philippe Mathieu-Daudé
Quoted 8 lines · Philippe Mathieu-Daudé

ARM_COMPATIBLE_SEMIHOSTING is an architecture feature, move its declaration to each target/ARCH/.

Note, we do not modify the linux-user targets, as user-mode builds don't use Kconfig.

Alistair

Quoted 69 lines
---
 default-configs/devices/arm-softmmu.mak     | 1 -
 default-configs/devices/riscv32-softmmu.mak | 1 -
 default-configs/devices/riscv64-softmmu.mak | 1 -
 target/arm/Kconfig                          | 1 +
 target/riscv/Kconfig                        | 2 ++
 5 files changed, 3 insertions(+), 3 deletions(-)
default-configs/devices/arm-softmmu.mak +0 -1
index 341d439de6f..0824e9be795 100644
@@ -41,5 +41,4 @@ CONFIG_MICROBIT=y
 CONFIG_FSL_IMX25=y
 CONFIG_FSL_IMX7=y
 CONFIG_FSL_IMX6UL=y
-CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y
 CONFIG_ALLWINNER_H3=y
default-configs/devices/riscv32-softmmu.mak +0 -1
index 5c9ad2590ef..94a236c9c25 100644
@@ -3,7 +3,6 @@
 # Uncomment the following lines to disable these optional devices:
 #
 #CONFIG_PCI_DEVICES=n
-CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y
 
 # Boards:
 #
default-configs/devices/riscv64-softmmu.mak +0 -1
index d5b2e25b6df..76b61956489 100644
@@ -3,7 +3,6 @@
 # Uncomment the following lines to disable these optional devices:
 #
 #CONFIG_PCI_DEVICES=n
-CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y
 
 # Boards:
 #
target/arm/Kconfig +1 -0
index 1f05de47ca6..ae89d05c7e5 100644
@@ -1,5 +1,6 @@
 config ARM
     bool
+    select ARM_COMPATIBLE_SEMIHOSTING
 
 config AARCH64
     bool
target/riscv/Kconfig +2 -1
index b9e5932f13f..c3b9d8a1cf1 100644
@@ -1,5 +1,7 @@
 config RISCV32
     bool
+    select ARM_COMPATIBLE_SEMIHOSTING
 
 config RISCV64
     bool
+    select ARM_COMPATIBLE_SEMIHOSTING
--

2.26.2

#24 lore raw

PATCH 10/10 target: Move SEMIHOSTING feature to target Kconfig

In reply to Philippe Mathieu-Daudé

SEMIHOSTING is an architecture feature, move its declaration to each target/ARCH/.

---
 default-configs/devices/lm32-softmmu.mak        | 2 --
 default-configs/devices/m68k-softmmu.mak        | 2 --
 default-configs/devices/mips-softmmu-common.mak | 3 ---
 default-configs/devices/nios2-softmmu.mak       | 2 --
 default-configs/devices/unicore32-softmmu.mak   | 1 -
 default-configs/devices/xtensa-softmmu.mak      | 2 --
 target/lm32/Kconfig                             | 1 +
 target/m68k/Kconfig                             | 1 +
 target/mips/Kconfig                             | 1 +
 target/nios2/Kconfig                            | 1 +
 target/unicore32/Kconfig                        | 1 +
 target/xtensa/Kconfig                           | 1 +
 12 files changed, 6 insertions(+), 12 deletions(-)
default-configs/devices/lm32-softmmu.mak +0 -2
index 1bce3f6e8b6..1f69795b749 100644
@@ -4,8 +4,6 @@
 #
 #CONFIG_MILKYMIST_TMU2=n        # disabling it actually causes compile-time failures
 
-CONFIG_SEMIHOSTING=y
-
 # Boards:
 #
 CONFIG_LM32_EVR=y
default-configs/devices/m68k-softmmu.mak +0 -2
index 6629fd2aa33..4fef4bd731d 100644
@@ -1,7 +1,5 @@
 # Default configuration for m68k-softmmu
 
-CONFIG_SEMIHOSTING=y
-
 # Boards:
 #
 CONFIG_AN5206=y
default-configs/devices/mips-softmmu-common.mak +0 -3
index ea78fe72759..af652ec7bdd 100644
@@ -1,8 +1,5 @@
 # Common mips*-softmmu CONFIG defines
 
-# CONFIG_SEMIHOSTING is always required on this architecture
-CONFIG_SEMIHOSTING=y
-
 CONFIG_ISA_BUS=y
 CONFIG_PCI=y
 CONFIG_PCI_DEVICES=y
default-configs/devices/nios2-softmmu.mak +0 -2
index 1bc4082ea99..e130d024e62 100644
@@ -1,7 +1,5 @@
 # Default configuration for nios2-softmmu
 
-CONFIG_SEMIHOSTING=y
-
 # Boards:
 #
 CONFIG_NIOS2_10M50=y
default-configs/devices/unicore32-softmmu.mak +0 -1
index 899288e3d71..0bfce48c6da 100644
@@ -3,4 +3,3 @@
 # Boards:
 #
 CONFIG_PUV3=y
-CONFIG_SEMIHOSTING=y
default-configs/devices/xtensa-softmmu.mak +0 -2
index 4fe1bf00c94..49e4c9da88c 100644
@@ -1,7 +1,5 @@
 # Default configuration for Xtensa
 
-CONFIG_SEMIHOSTING=y
-
 # Boards:
 #
 CONFIG_XTENSA_SIM=y
target/lm32/Kconfig +1 -0
index 09de5b703a3..286710fd47b 100644
@@ -1,2 +1,3 @@
 config LM32
     bool
+    select SEMIHOSTING
target/m68k/Kconfig +1 -0
index 23debad519a..9eae71486ff 100644
@@ -1,2 +1,3 @@
 config M68K
     bool
+    select SEMIHOSTING
target/mips/Kconfig +1 -0
index 6adf1453548..eb19c94c7d4 100644
@@ -1,5 +1,6 @@
 config MIPS
     bool
+    select SEMIHOSTING
 
 config MIPS64
     bool
target/nios2/Kconfig +1 -0
index 1529ab8950d..c65550c861a 100644
@@ -1,2 +1,3 @@
 config NIOS2
     bool
+    select SEMIHOSTING
target/unicore32/Kconfig +1 -0
index 62c9d10b38f..c699d5238ea 100644
@@ -1,2 +1,3 @@
 config UNICORE32
     bool
+    select SEMIHOSTING
target/xtensa/Kconfig +1 -0
index a3c8dc7f6d7..5e46049262d 100644
@@ -1,2 +1,3 @@
 config XTENSA
     bool
+    select SEMIHOSTING
Signature · 1 line
2.26.2
#25 lore raw

Re: [PATCH 10/10] target: Move SEMIHOSTING feature to target Kconfig

Quoted 2 lines · Philippe Mathieu-Daudé

SEMIHOSTING is an architecture feature, move its declaration to each target/ARCH/.

I'm going to punt on this one and leave it to the arch maintainers to opine because AIUI in a lot of cases semihosting is more of a "useful hack" than something mandated by the architecture.

Quoted 139 lines
---
 default-configs/devices/lm32-softmmu.mak        | 2 --
 default-configs/devices/m68k-softmmu.mak        | 2 --
 default-configs/devices/mips-softmmu-common.mak | 3 ---
 default-configs/devices/nios2-softmmu.mak       | 2 --
 default-configs/devices/unicore32-softmmu.mak   | 1 -
 default-configs/devices/xtensa-softmmu.mak      | 2 --
 target/lm32/Kconfig                             | 1 +
 target/m68k/Kconfig                             | 1 +
 target/mips/Kconfig                             | 1 +
 target/nios2/Kconfig                            | 1 +
 target/unicore32/Kconfig                        | 1 +
 target/xtensa/Kconfig                           | 1 +
 12 files changed, 6 insertions(+), 12 deletions(-)
default-configs/devices/lm32-softmmu.mak +0 -2
index 1bce3f6e8b6..1f69795b749 100644
@@ -4,8 +4,6 @@
 #
 #CONFIG_MILKYMIST_TMU2=n        # disabling it actually causes compile-time failures
 
-CONFIG_SEMIHOSTING=y
-
 # Boards:
 #
 CONFIG_LM32_EVR=y
default-configs/devices/m68k-softmmu.mak +0 -2
index 6629fd2aa33..4fef4bd731d 100644
@@ -1,7 +1,5 @@
 # Default configuration for m68k-softmmu
 
-CONFIG_SEMIHOSTING=y
-
 # Boards:
 #
 CONFIG_AN5206=y
default-configs/devices/mips-softmmu-common.mak +0 -3
index ea78fe72759..af652ec7bdd 100644
@@ -1,8 +1,5 @@
 # Common mips*-softmmu CONFIG defines
 
-# CONFIG_SEMIHOSTING is always required on this architecture
-CONFIG_SEMIHOSTING=y
-
 CONFIG_ISA_BUS=y
 CONFIG_PCI=y
 CONFIG_PCI_DEVICES=y
default-configs/devices/nios2-softmmu.mak +0 -2
index 1bc4082ea99..e130d024e62 100644
@@ -1,7 +1,5 @@
 # Default configuration for nios2-softmmu
 
-CONFIG_SEMIHOSTING=y
-
 # Boards:
 #
 CONFIG_NIOS2_10M50=y
default-configs/devices/unicore32-softmmu.mak +0 -1
index 899288e3d71..0bfce48c6da 100644
@@ -3,4 +3,3 @@
 # Boards:
 #
 CONFIG_PUV3=y
-CONFIG_SEMIHOSTING=y
default-configs/devices/xtensa-softmmu.mak +0 -2
index 4fe1bf00c94..49e4c9da88c 100644
@@ -1,7 +1,5 @@
 # Default configuration for Xtensa
 
-CONFIG_SEMIHOSTING=y
-
 # Boards:
 #
 CONFIG_XTENSA_SIM=y
target/lm32/Kconfig +1 -0
index 09de5b703a3..286710fd47b 100644
@@ -1,2 +1,3 @@
 config LM32
     bool
+    select SEMIHOSTING
target/m68k/Kconfig +1 -0
index 23debad519a..9eae71486ff 100644
@@ -1,2 +1,3 @@
 config M68K
     bool
+    select SEMIHOSTING
target/mips/Kconfig +1 -0
index 6adf1453548..eb19c94c7d4 100644
@@ -1,5 +1,6 @@
 config MIPS
     bool
+    select SEMIHOSTING
 
 config MIPS64
     bool
target/nios2/Kconfig +1 -0
index 1529ab8950d..c65550c861a 100644
@@ -1,2 +1,3 @@
 config NIOS2
     bool
+    select SEMIHOSTING
target/unicore32/Kconfig +1 -0
index 62c9d10b38f..c699d5238ea 100644
@@ -1,2 +1,3 @@
 config UNICORE32
     bool
+    select SEMIHOSTING
target/xtensa/Kconfig +1 -0
index a3c8dc7f6d7..5e46049262d 100644
@@ -1,2 +1,3 @@
 config XTENSA
     bool
+    select SEMIHOSTING
Signature · 1 line
Alex Bennée
#26 lore raw
In reply to Philippe Mathieu-Daudé

Hi all, where are we with this series?

I am trying to figure out how to apply the whole thing,
in order to build only compatible ARM boards and devices for KVM-only builds.

Ie, I would like to combine this with:

"arm cleanup experiment for kvm-only build"

https://lists.gnu.org/archive/html/qemu-devel/2021-03/msg02790.html

My series there gets us to a buildable and working KVM-only ARM target, with all make check tests passing.

However, in order to be able to remove more code, remove stubs etc,
I found the presence of incompatible ARM boards and devices as blocking additional cleanups.

Therefore, in order to proceed with additional cleanup in arm, and adding the accel-specific extensions to the cpu class, I see being able to disable incompatible boards for KVM as necessary.

IIUC there are:

* This series "target: Provide target-specific Kconfig"
* Support disabling TCG on ARM ?
* Support disabling TCG on ARM (part 2) ?

What is the current state here?

Thanks,

Claudio

Quoted 105 lines · Philippe Mathieu-Daudé

Hi,

This series add a Kconfig file to each target, allowing to select target-specific features there, instead of from the hardware Kconfig.

This simplifies managing multi-arch features such semihosting.

Series organization:

1/ Some targets use the architecture symbol to select boards and peripherals (SH4 and LM32), we need to clean that first.

2/ Introduce empty target Kconfig, update meson.

3/ Move architectural features out of hardware:
- x86 SEV
- ARM v7m
- generic semihosting

[following only important to patchew, unrelated to this series]
Based-on: <[email protected]>

Philippe Mathieu-Daudé (10):
hw/sh4/Kconfig: Rename CONFIG_SH4 -> CONFIG_SH4_PERIPHERALS hw/lm32/Kconfig: Introduce CONFIG_LM32_EVR for lm32-evr/uclinux boards hw/sh4/Kconfig: Rename CONFIG_LM32 -> CONFIG_LM32_PERIPHERALS hw/lm32/Kconfig: Have MILKYMIST select LM32_PERIPHERALS
meson: Introduce target-specific Kconfig
target/i386: Move SEV feature to target Kconfig target/arm: Move V7M feature to target Kconfig
default-configs: Remove unnecessary SEMIHOSTING selection
target: Move ARM_COMPATIBLE_SEMIHOSTING feature to target Kconfig
target: Move SEMIHOSTING feature to target Kconfig

 default-configs/devices/arm-softmmu.mak       |  2 --
 default-configs/devices/lm32-softmmu.mak      |  4 +---
 default-configs/devices/m68k-softmmu.mak      |  2 --
 .../devices/mips-softmmu-common.mak           |  3 ---
 default-configs/devices/nios2-softmmu.mak     |  2 --
 default-configs/devices/riscv32-softmmu.mak   |  2 --
 default-configs/devices/riscv64-softmmu.mak   |  2 --
 default-configs/devices/unicore32-softmmu.mak |  1 -
 default-configs/devices/xtensa-softmmu.mak    |  2 --
 meson.build                                   |  3 ++-
 Kconfig                                       |  1 +
 hw/arm/Kconfig                                |  4 ----
 hw/block/meson.build                          |  2 +-
 hw/char/meson.build                           |  6 ++---
 hw/i386/Kconfig                               |  4 ----
 hw/intc/meson.build                           |  4 ++--
 hw/lm32/Kconfig                               | 10 +++++---
 hw/lm32/meson.build                           |  2 +-
 hw/sh4/Kconfig                                |  6 ++---
 hw/timer/meson.build                          |  4 ++--
 target/Kconfig                                | 23 +++++++++++++++++++
 target/alpha/Kconfig                          |  2 ++
 target/arm/Kconfig                            | 11 +++++++++
 target/avr/Kconfig                            |  2 ++
 target/cris/Kconfig                           |  2 ++
 target/hppa/Kconfig                           |  2 ++
 target/i386/Kconfig                           |  9 ++++++++
 target/lm32/Kconfig                           |  3 +++
 target/m68k/Kconfig                           |  3 +++
 target/microblaze/Kconfig                     |  2 ++
 target/mips/Kconfig                           |  7 ++++++
 target/moxie/Kconfig                          |  2 ++
 target/nios2/Kconfig                          |  3 +++
 target/openrisc/Kconfig                       |  2 ++
 target/ppc/Kconfig                            |  5 ++++
 target/riscv/Kconfig                          |  7 ++++++
 target/rx/Kconfig                             |  2 ++
 target/s390x/Kconfig                          |  2 ++
 target/sh4/Kconfig                            |  2 ++
 target/sparc/Kconfig                          |  5 ++++
 target/tilegx/Kconfig                         |  2 ++
 target/tricore/Kconfig                        |  2 ++
 target/unicore32/Kconfig                      |  3 +++
 target/xtensa/Kconfig                         |  3 +++
 44 files changed, 129 insertions(+), 43 deletions(-)
 create mode 100644 target/Kconfig
 create mode 100644 target/alpha/Kconfig
 create mode 100644 target/arm/Kconfig
 create mode 100644 target/avr/Kconfig
 create mode 100644 target/cris/Kconfig
 create mode 100644 target/hppa/Kconfig
 create mode 100644 target/i386/Kconfig
 create mode 100644 target/lm32/Kconfig
 create mode 100644 target/m68k/Kconfig
 create mode 100644 target/microblaze/Kconfig
 create mode 100644 target/mips/Kconfig
 create mode 100644 target/moxie/Kconfig
 create mode 100644 target/nios2/Kconfig
 create mode 100644 target/openrisc/Kconfig
 create mode 100644 target/ppc/Kconfig
 create mode 100644 target/riscv/Kconfig
 create mode 100644 target/rx/Kconfig
 create mode 100644 target/s390x/Kconfig
 create mode 100644 target/sh4/Kconfig
 create mode 100644 target/sparc/Kconfig
 create mode 100644 target/tilegx/Kconfig
 create mode 100644 target/tricore/Kconfig
 create mode 100644 target/unicore32/Kconfig
 create mode 100644 target/xtensa/Kconfig