accel: Allow targets to use Kconfig, disable semihosting by default
cover accel: Allow targets to use Kconfig, disable semihosting by default
This series include generic patches I took of the KVM/ARM specific series which will follow.
- List orphan accelerators in MAINTAINERS
- Add accel/Kconfig
- Allow targets to use their how Kconfig
- Enforce semihosting on ARM/LM32/MIPS, disable it elsewhere
Previous RFC for semihosting posted earlier:
https://www.mail-archive.com/[email protected]/msg631218.html
Philippe Mathieu-Daudé (11):
MAINTAINERS: Fix KVM path expansion glob
MAINTAINERS: Add an 'overall' entry for accelerators
MAINTAINERS: Add an entry for the HAX accelerator
MAINTAINERS: Add an entry for the HVF accelerator
Makefile: Write MINIKCONF variables as one entry per line accel/Kconfig: Extract accel selectors into their own config accel/Kconfig: Add the TCG selector
target/Kconfig: Allow targets to use Kconfig
target/mips: Always enable CONFIG_SEMIHOSTING
target/arm: Always enable CONFIG_SEMIHOSTING hw/semihosting: Make the feature depend of TCG, and allow to disable
it
Makefile | 10 ++++++-- default-configs/aarch64-linux-user-common.mak | 4 ++++ default-configs/aarch64-linux-user.mak | 2 ++ default-configs/aarch64_be-linux-user.mak | 2 ++ default-configs/arm-linux-user-common.mak | 4 ++++ default-configs/arm-linux-user.mak | 2 ++ default-configs/arm-softmmu.mak | 4 +++- default-configs/armeb-linux-user.mak | 2 ++ default-configs/mips-linux-user-common.mak | 4 ++++ default-configs/mips-linux-user.mak | 2 ++ default-configs/mips64-linux-user.mak | 2 ++ default-configs/mips64el-linux-user.mak | 2 ++ default-configs/mipsel-linux-user.mak | 2 ++ default-configs/mipsn32-linux-user.mak | 2 ++ default-configs/mipsn32el-linux-user.mak | 2 ++ Kconfig.host | 7 ------ MAINTAINERS | 23 ++++++++++++++++++- accel/Kconfig | 9 ++++++++ hw/semihosting/Kconfig | 4 +++- target/Kconfig | 1 + 20 files changed, 78 insertions(+), 12 deletions(-) create mode 100644 default-configs/aarch64-linux-user-common.mak create mode 100644 default-configs/arm-linux-user-common.mak create mode 100644 default-configs/mips-linux-user-common.mak create mode 100644 accel/Kconfig create mode 100644 target/Kconfig
Signature · 1 line
2.21.1
PATCH 1/11 MAINTAINERS: Fix KVM path expansion glob
The KVM files has been moved from target-ARCH to the target/ARCH/ folder in commit fcf5ef2a. Fix the pathname expansion.
--- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
MAINTAINERS +1 -1
@@ -353,7 +353,7 @@ Overall KVM CPUs M: Paolo Bonzini <[email protected]> L: [email protected] S: Supported -F: */kvm.* +F: */*/kvm* F: accel/kvm/ F: accel/stubs/kvm-stub.c F: include/hw/kvm/
Signature · 1 line
2.21.1
Re: [PATCH 01/11] MAINTAINERS: Fix KVM path expansion glob
Quoted 8 lines · Philippe Mathieu-Daudé
The KVM files has been moved from target-ARCH to the target/ARCH/ folder in commit
fcf5ef2a. Fix the pathname expansion.Fixes fcf5ef2a ("Move target-* CPU file into a target/ folder")Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
r~
Re: [PATCH 01/11] MAINTAINERS: Fix KVM path expansion glob
Quoted 4 lines · Richard Henderson
Quoted 3 lines · Philippe Mathieu-Daudé
The KVM files has been moved from target-ARCH to the target/ARCH/ folder in commit
fcf5ef2a. Fix the pathname expansion.
Quoted 8 lines
Quoted 5 lines
Fixes fcf5ef2a ("Move target-* CPU file into a target/ folder")Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Reviewed-by Richard Henderson <[email protected]>
Paolo, do you plan to queue this trivial patch or should I ask qemu-trivial?
Re: [PATCH 01/11] MAINTAINERS: Fix KVM path expansion glob
In reply to Philippe Mathieu-DaudéQuoted 5 lines · Philippe Mathieu-Daudé
The KVM files has been moved from target-ARCH to the target/ARCH/ folder in commit
fcf5ef2a. Fix the pathname expansion.Fixes fcf5ef2a ("Move target-* CPU file into a target/ folder")Signed-off-by Philippe Mathieu-Daudé <[email protected]>
PATCH 2/11 MAINTAINERS: Add an 'overall' entry for accelerators
In reply to Philippe Mathieu-Daudé---
Cc: Richard Henderson <[email protected]>
Cc: Paolo Bonzini <[email protected]>
--- MAINTAINERS | 9 +++++++++ 1 file changed, 9 insertions(+)
MAINTAINERS +9 -0
@@ -405,6 +405,15 @@ S: Supported F: target/i386/kvm.c F: scripts/kvm/vmxcap +Guest CPU Cores (other accelerators) +------------------------------------ +Overall +M: Richard Henderson <[email protected]> +R: Paolo Bonzini <[email protected]> +S: Maintained +F: include/sysemu/accel.h +F: accel/stubs/Makefile.objs + WHPX CPUs M: Sunil Muthuswamy <[email protected]> S: Supported
Signature · 1 line
2.21.1
Re: [PATCH 02/11] MAINTAINERS: Add an 'overall' entry for accelerators
Quoted 7 lines · Philippe Mathieu-Daudé
Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
Cc: Richard Henderson <[email protected]>
Cc: Paolo Bonzini <[email protected]>--- MAINTAINERS | 9 +++++++++ 1 file changed, 9 insertions(+)
r~
PATCH 3/11 MAINTAINERS: Add an entry for the HAX accelerator
In reply to Philippe Mathieu-Daudé---
Cc: Sergio Andres Gomez Del Real <[email protected]>
Cc: Vincent Palatin <[email protected]>
Cc: Yu Ning <[email protected]>
Cc: Tao Wu <[email protected]>
Cc: [email protected]
Cc: Colin Xu <[email protected]>
Cc: Hang Yuan <[email protected]>
Cc: David Chou <[email protected]>
Cc: Wenchao Wang <[email protected]>
--- MAINTAINERS | 6 ++++++ 1 file changed, 6 insertions(+)
MAINTAINERS +6 -0
@@ -414,6 +414,12 @@ S: Maintained F: include/sysemu/accel.h F: accel/stubs/Makefile.objs +HAX Accelerator +S: Orphan +F: accel/stubs/hax-stub.c +F: target/i386/hax-all.c +F: include/sysemu/hax.h + WHPX CPUs M: Sunil Muthuswamy <[email protected]> S: Supported
Signature · 1 line
2.21.1
PATCH 4/11 MAINTAINERS: Add an entry for the HVF accelerator
In reply to Philippe Mathieu-Daudé---
Cc: Reviewed-by: Nikita Leshenko <[email protected]>
Cc: Sergio Andres Gomez Del Real <[email protected]>
Cc: Roman Bolshakov <[email protected]>
Cc: Patrick Colp <[email protected]>
Cc: Cameron Esfahani <[email protected]>
Cc: Liran Alon <[email protected]>
Cc: Heiher <[email protected]>
--- MAINTAINERS | 6 ++++++ 1 file changed, 6 insertions(+)
MAINTAINERS +6 -0
@@ -420,6 +420,12 @@ F: accel/stubs/hax-stub.c F: target/i386/hax-all.c F: include/sysemu/hax.h +HVF Accelerator +S: Orphan +F: accel/stubs/hvf-stub.c +F: target/i386/hvf/hvf.c +F: include/sysemu/hvf.h + WHPX CPUs M: Sunil Muthuswamy <[email protected]> S: Supported
Signature · 1 line
2.21.1
Re: [PATCH 04/11] MAINTAINERS: Add an entry for the HVF accelerator
Hi Philippe,
I can take the ownership if nobody wants it. At the moment I'm working on APIC for HVF to get kvm-unit-tests fixed.
Next items on the list (in no particular order):
* MMX emulation
* SSE emulation
* qxl display
* gdb stub
* virtio-gpu/virgil running on metal
* VFIO-PCI based on macOS user-space DriverKit framework
Best regards,
Roman
Quoted 33 lines · Philippe Mathieu-Daudé
Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
Cc: Reviewed-by: Nikita Leshenko <[email protected]>
Cc: Sergio Andres Gomez Del Real <[email protected]>
Cc: Roman Bolshakov <[email protected]>
Cc: Patrick Colp <[email protected]>
Cc: Cameron Esfahani <[email protected]>
Cc: Liran Alon <[email protected]>
Cc: Heiher <[email protected]>--- MAINTAINERS | 6 ++++++ 1 file changed, 6 insertions(+)MAINTAINERS +6
-0@@ -420,6 +420,12 @@ F: accel/stubs/hax-stub.c F: target/i386/hax-all.c F: include/sysemu/hax.h +HVF Accelerator +S: Orphan +F: accel/stubs/hvf-stub.c +F: target/i386/hvf/hvf.c +F: include/sysemu/hvf.h + WHPX CPUs M: Sunil Muthuswamy <[email protected]> S: SupportedSignature · 1 line
2.21.1
Re: [PATCH 04/11] MAINTAINERS: Add an entry for the HVF accelerator
Hi Roman,
Quoted 5 lines · Roman Bolshakov
Hi Philippe,
I can take the ownership if nobody wants it. At the moment I'm working on APIC for HVF to get kvm-unit-tests fixed.
Quoted 7 lines
Next items on the list (in no particular order):
* MMX emulation
* SSE emulation
* qxl display
* gdb stub
* virtio-gpu/virgil running on metal
* VFIO-PCI based on macOS user-space DriverKit framework
Glad to hear :)
I suppose Paolo will be happy to have someone caring about HVF. Do you mind sending a patch to step in?
Thanks,
Phil.
Quoted 39 lines
Best regards,
RomanQuoted 33 lines · Philippe Mathieu-Daudé
Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
Cc: Reviewed-by: Nikita Leshenko <[email protected]>
Cc: Sergio Andres Gomez Del Real <[email protected]>
Cc: Roman Bolshakov <[email protected]>
Cc: Patrick Colp <[email protected]>
Cc: Cameron Esfahani <[email protected]>
Cc: Liran Alon <[email protected]>
Cc: Heiher <[email protected]>--- MAINTAINERS | 6 ++++++ 1 file changed, 6 insertions(+)MAINTAINERS +6
-0@@ -420,6 +420,12 @@ F: accel/stubs/hax-stub.c F: target/i386/hax-all.c F: include/sysemu/hax.h +HVF Accelerator +S: Orphan +F: accel/stubs/hvf-stub.c +F: target/i386/hvf/hvf.c +F: include/sysemu/hvf.h + WHPX CPUs M: Sunil Muthuswamy <[email protected]> S: SupportedSignature · 1 line
2.21.1
Re: [PATCH 04/11] MAINTAINERS: Add an entry for the HVF accelerator
In reply to Roman BolshakovSorry I didn't see this yesterday.
We've (Apple) signed up for taking over HVF ownership. I didn't realize I needed to add to the MAINTAINERS list.
Roman, we also have a bunch of pending fixes for some of the issues you've listed. We're in the process of upstreaming them.
Cameron Esfahani
[email protected]
"All that is necessary for the triumph of evil is that good men do nothing."
Edmund Burke
Quoted 53 lines · Roman Bolshakov
Hi Philippe,
I can take the ownership if nobody wants it. At the moment I'm working on APIC for HVF to get kvm-unit-tests fixed.
Next items on the list (in no particular order):
* MMX emulation
* SSE emulation
* qxl display
* gdb stub
* virtio-gpu/virgil running on metal
* VFIO-PCI based on macOS user-space DriverKit frameworkBest regards,
RomanQuoted 33 lines · Philippe Mathieu-Daudé
Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
Cc: Reviewed-by: Nikita Leshenko <[email protected]>
Cc: Sergio Andres Gomez Del Real <[email protected]>
Cc: Roman Bolshakov <[email protected]>
Cc: Patrick Colp <[email protected]>
Cc: Cameron Esfahani <[email protected]>
Cc: Liran Alon <[email protected]>
Cc: Heiher <[email protected]>
---MAINTAINERS| 6 ++++++1 file changed, 6 insertions(+)MAINTAINERS +0
-0@@ -420,6 +420,12 @@ F: accel/stubs/hax-stub.cF:
target/i386/hax-all.c
F:include/sysemu/hax.hMAINTAINERS +6
-0+HVF Accelerator +S: Orphan +F: accel/stubs/hvf-stub.c +F: target/i386/hvf/hvf.c +F: include/sysemu/hvf.h +WHPX CPUs
M: Sunil Muthuswamy <[email protected]>
S: SupportedSignature · 1 line
2.21.1
Re: [PATCH 04/11] MAINTAINERS: Add an entry for the HVF accelerator
Quoted 6 lines · Cameron Esfahani
Sorry I didn't see this yesterday.
We've (Apple) signed up for taking over HVF ownership. I didn't realize I needed to add to the
MAINTAINERSlist.Roman, we also have a bunch of pending fixes for some of the issues you've listed. We're in the process of upstreaming them.
Hi Cameron,
That's great news. What exactly are you planning to upstream first? BTW many thanks for the fixes you made last December.
Best regards,
Roman
Re: [PATCH 04/11] MAINTAINERS: Add an entry for the HVF accelerator
In reply to Philippe Mathieu-DaudéPlease add me to the HVF maintainers as well.
Cameron Esfahani
[email protected]
"In the elder days of Art, Builders wrought with greatest care each minute and unseen part; For the gods see everywhere."
"The Builders", H. W. Longfellow
Quoted 36 lines · Philippe Mathieu-Daudé
Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
Cc: Reviewed-by: Nikita Leshenko <[email protected]>
Cc: Sergio Andres Gomez Del Real <[email protected]>
Cc: Roman Bolshakov <[email protected]>
Cc: Patrick Colp <[email protected]>
Cc: Cameron Esfahani <[email protected]>
Cc: Liran Alon <[email protected]>
Cc: Heiher <[email protected]>
---MAINTAINERS| 6 ++++++1 file changed, 6 insertions(+)MAINTAINERS +0
-0@@ -420,6 +420,12 @@ F: accel/stubs/hax-stub.cF:
target/i386/hax-all.c
F:include/sysemu/hax.hMAINTAINERS +6
-0+HVF Accelerator +S: Orphan +F: accel/stubs/hvf-stub.c +F: target/i386/hvf/hvf.c +F: include/sysemu/hvf.h +WHPX CPUs
M: Sunil Muthuswamy <[email protected]>
S: SupportedSignature · 1 line
2.21.1
PATCH 5/11 Makefile: Write MINIKCONF variables as one entry per line
In reply to Philippe Mathieu-DaudéHaving one entry per line helps reviews/refactors. As we are going to modify the MINIKCONF variables, split them now to ease further review.
--- Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
Makefile +4 -2
@@ -418,8 +418,10 @@ MINIKCONF_ARGS = \ CONFIG_LINUX=$(CONFIG_LINUX) \ CONFIG_PVRDMA=$(CONFIG_PVRDMA) -MINIKCONF_INPUTS = $(SRC_PATH)/Kconfig.host $(SRC_PATH)/hw/Kconfig -MINIKCONF_DEPS = $(MINIKCONF_INPUTS) $(wildcard $(SRC_PATH)/hw/*/Kconfig) +MINIKCONF_INPUTS = $(SRC_PATH)/Kconfig.host \ + $(SRC_PATH)/hw/Kconfig +MINIKCONF_DEPS = $(MINIKCONF_INPUTS) \ + $(wildcard $(SRC_PATH)/hw/*/Kconfig) MINIKCONF = $(PYTHON) $(SRC_PATH)/scripts/minikconf.py \ $(SUBDIR_DEVICES_MAK): %/config-devices.mak: default-configs/%.mak $(MINIKCONF_DEPS) $(BUILD_DIR)/config-host.mak
Signature · 1 line
2.21.1
Re: [PATCH 05/11] Makefile: Write MINIKCONF variables as one entry per line
Quoted 8 lines · Philippe Mathieu-Daudé
Having one entry per line helps reviews/refactors. As we are going to modify the MINIKCONF variables, split them now to ease further review.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
r~
PATCH 6/11 accel/Kconfig: Extract accel selectors into their own config
In reply to Philippe Mathieu-DaudéMove the accel selectors from the global Kconfig.host to their own Kconfig file.
--- Makefile | 1 + Kconfig.host | 7 ------- accel/Kconfig | 6 ++++++ 3 files changed, 7 insertions(+), 7 deletions(-) create mode 100644 accel/Kconfig
Makefile +1 -0
@@ -419,6 +419,7 @@ MINIKCONF_ARGS = \ CONFIG_PVRDMA=$(CONFIG_PVRDMA) MINIKCONF_INPUTS = $(SRC_PATH)/Kconfig.host \ + $(SRC_PATH)/accel/Kconfig \ $(SRC_PATH)/hw/Kconfig MINIKCONF_DEPS = $(MINIKCONF_INPUTS) \ $(wildcard $(SRC_PATH)/hw/*/Kconfig)
Kconfig.host +0 -7
@@ -2,9 +2,6 @@ # down to Kconfig. See also MINIKCONF_ARGS in the Makefile: # these two need to be kept in sync. -config KVM - bool - config LINUX bool
@@ -31,10 +28,6 @@ config VHOST_KERNEL bool select VHOST -config XEN - bool - select FSDEV_9P if VIRTFS - config VIRTFS bool
accel/Kconfig new file +6 -0
@@ -0,0 +1,6 @@ +config KVM + bool + +config XEN + bool + select FSDEV_9P if VIRTFS
Signature · 1 line
2.21.1
Re: [PATCH 06/11] accel/Kconfig: Extract accel selectors into their own config
Quoted 10 lines · Philippe Mathieu-Daudé
Move the accel selectors from the global
Kconfig.hostto their ownKconfigfile.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- Makefile | 1 + Kconfig.host | 7 ------- accel/Kconfig | 6 ++++++ 3 files changed, 7 insertions(+), 7 deletions(-) create mode 100644 accel/Kconfig
r~
PATCH 7/11 accel/Kconfig: Add the TCG selector
In reply to Philippe Mathieu-DaudéExpose the CONFIG_TCG selector to let minikconf.py uses it.
When building with --disable-tcg build, this helps to deselect devices that are TCG-dependent.
--- Makefile | 1 + accel/Kconfig | 3 +++ 2 files changed, 4 insertions(+)
Makefile +1 -0
@@ -405,6 +405,7 @@ endif MINIKCONF_ARGS = \ $(CONFIG_MINIKCONF_MODE) \ $@ $*/config-devices.mak.d $< $(MINIKCONF_INPUTS) \ + CONFIG_TCG=$(CONFIG_TCG) \ CONFIG_KVM=$(CONFIG_KVM) \ CONFIG_SPICE=$(CONFIG_SPICE) \ CONFIG_IVSHMEM=$(CONFIG_IVSHMEM) \
accel/Kconfig +3 -0
@@ -1,3 +1,6 @@ +config TCG + bool + config KVM bool
Signature · 1 line
2.21.1
Re: [PATCH 07/11] accel/Kconfig: Add the TCG selector
Quoted 10 lines · Philippe Mathieu-Daudé
Expose the
CONFIG_TCGselector to letminikconf.pyuses it.When building with --disable-tcg build, this helps to deselect devices that are TCG-dependent.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- Makefile | 1 + accel/Kconfig | 3 +++ 2 files changed, 4 insertions(+)
r~
PATCH 8/11 target/Kconfig: Allow targets to use Kconfig
In reply to Philippe Mathieu-DaudéAllow targets to select target-specific Kconfig values.
--- Makefile | 6 ++++-- target/Kconfig | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 target/Kconfig
Makefile +4 -2
@@ -421,9 +421,11 @@ MINIKCONF_ARGS = \ MINIKCONF_INPUTS = $(SRC_PATH)/Kconfig.host \ $(SRC_PATH)/accel/Kconfig \ - $(SRC_PATH)/hw/Kconfig + $(SRC_PATH)/hw/Kconfig \ + $(SRC_PATH)/target/Kconfig MINIKCONF_DEPS = $(MINIKCONF_INPUTS) \ - $(wildcard $(SRC_PATH)/hw/*/Kconfig) + $(wildcard $(SRC_PATH)/hw/*/Kconfig) \ + $(wildcard $(SRC_PATH)/target/*/Kconfig) MINIKCONF = $(PYTHON) $(SRC_PATH)/scripts/minikconf.py \ $(SUBDIR_DEVICES_MAK): %/config-devices.mak: default-configs/%.mak $(MINIKCONF_DEPS) $(BUILD_DIR)/config-host.mak
target/Kconfig new file +1 -0
@@ -0,0 +1 @@ +
Signature · 1 line
2.21.1
Re: [PATCH 08/11] target/Kconfig: Allow targets to use Kconfig
target/Kconfig line 1
Quoted 7 lines · Philippe Mathieu-Daudé
target/Kconfig new file +1
-0@@ -0,0 +1 @@ +
Does this want a
# This file intentionally left blank.
?
Otherwise,
r~
PATCH 9/11 target/mips: Always enable CONFIG_SEMIHOSTING
In reply to Philippe Mathieu-DaudéOn MIPS, the semihosting feature is always required on user-space.
--- default-configs/mips-linux-user-common.mak | 4 ++++ default-configs/mips-linux-user.mak | 2 ++ default-configs/mips64-linux-user.mak | 2 ++ default-configs/mips64el-linux-user.mak | 2 ++ default-configs/mipsel-linux-user.mak | 2 ++ default-configs/mipsn32-linux-user.mak | 2 ++ default-configs/mipsn32el-linux-user.mak | 2 ++ 7 files changed, 16 insertions(+) create mode 100644 default-configs/mips-linux-user-common.mak
default-configs/mips-linux-user-common.mak new file +4 -0
@@ -0,0 +1,4 @@ +# Common mips*-linux-user CONFIG defines + +# CONFIG_SEMIHOSTING is always required on this architecture +CONFIG_SEMIHOSTING=y
default-configs/mips-linux-user.mak +2 -0
@@ -1 +1,3 @@ # Default configuration for mips-linux-user + +include mips-linux-user-common.mak
default-configs/mips64-linux-user.mak +2 -0
@@ -1 +1,3 @@ # Default configuration for mips64-linux-user + +include mips-linux-user-common.mak
default-configs/mips64el-linux-user.mak +2 -0
@@ -1 +1,3 @@ # Default configuration for mips64el-linux-user + +include mips-linux-user-common.mak
default-configs/mipsel-linux-user.mak +2 -0
@@ -1 +1,3 @@ # Default configuration for mipsel-linux-user + +include mips-linux-user-common.mak
default-configs/mipsn32-linux-user.mak +2 -0
@@ -1 +1,3 @@ # Default configuration for mipsn32-linux-user + +include mips-linux-user-common.mak
default-configs/mipsn32el-linux-user.mak +2 -0
@@ -1 +1,3 @@ # Default configuration for mipsn32el-linux-user + +include mips-linux-user-common.mak
Signature · 1 line
2.21.1
Re: [PATCH 09/11] target/mips: Always enable CONFIG_SEMIHOSTING
Quoted 13 lines · Philippe Mathieu-Daudé
On MIPS, the semihosting feature is always required on user-space.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- default-configs/mips-linux-user-common.mak | 4 ++++ default-configs/mips-linux-user.mak | 2 ++ default-configs/mips64-linux-user.mak | 2 ++ default-configs/mips64el-linux-user.mak | 2 ++ default-configs/mipsel-linux-user.mak | 2 ++ default-configs/mipsn32-linux-user.mak | 2 ++ default-configs/mipsn32el-linux-user.mak | 2 ++ 7 files changed, 16 insertions(+) create mode 100644 default-configs/mips-linux-user-common.mak
r~
Re: [PATCH 09/11] target/mips: Always enable CONFIG_SEMIHOSTING
In reply to Philippe Mathieu-Daudédefault-configs/mips-linux-user-common.mak line 4
Quoted 10 lines · Philippe Mathieu-Daudé
default-configs/mips-linux-user-common.mak new file +4
-0@@ -0,0 +1,4 @@ +# Common mips*-linux-user CONFIG defines + +# CONFIG_SEMIHOSTING is always required on this architecture +CONFIG_SEMIHOSTING=y
If it is always required, it should be select-ed.
Same for patch 10.
Paolo
Re: [PATCH 09/11] target/mips: Always enable CONFIG_SEMIHOSTING
Hi Paolo,
TLDR "how can I select a arch-specific feature?"
Quoted 13 lines · Paolo Bonzini
default-configs/mips-linux-user-common.mak line 4
Quoted 10 lines · Philippe Mathieu-Daudé
default-configs/mips-linux-user-common.mak new file +4
-0@@ -0,0 +1,4 @@ +# Common mips*-linux-user CONFIG defines + +# CONFIG_SEMIHOSTING is always required on this architecture +CONFIG_SEMIHOSTING=yIf it is always required, it should be select-ed.
I'm not sure how to do that...
Currently we have in hw/semihosting/Kconfig:
config SEMIHOSTING
bool
depends on TCG
default n
The only per-target generic entry point is minikconf command line.
1/ The less ugly option might be to add an optional target-devices.mak:
-- >8 --
Makefile.target +1 -0
@@ -5,6 +5,7 @@ BUILD_DIR?=$(CURDIR)/.. include ../config-host.mak include config-target.mak include $(SRC_PATH)/rules.mak +-include $(SRC_PATH)/target/$(TARGET_BASE_ARCH)/target-devices.mak ifdef CONFIG_SOFTMMU include config-devices.mak
target/arm/target-devices.mak new file +1 -0
@@ -0,0 +1 @@ +CONFIG_SEMIHOSTING=y
---
2/ I can have ./configure adding in config-devices.mak:
-- >8 --
@@ -7778,6 +7778,7 @@ echo "# Automatically generated by configure - do not modify" > $config_target_m
bflt="no"
mttcg="no"
+target_require_semihosting="no"
interp_prefix1=$(echo "$interp_prefix" | sed "s/%M/$target_name/g") gdb_xml_files=""
@@ -7806,6 +7807,7 @@ case "$target_name" in
TARGET_SYSTBL_ABI=common,oabi
bflt="yes"
mttcg="yes"+ target_require_semihosting="yes"
gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml"
;;
aarch64|aarch64_be)
@@ -7813,6 +7815,7 @@ case "$target_name" in
TARGET_BASE_ARCH=arm
bflt="yes"
mttcg="yes"+ target_require_semihosting="yes"
gdb_xml_files="aarch64-core.xml aarch64-fpu.xml arm-core.xml
arm-vfp.xml arm-vfp3.xml arm-neon.xml"
;;
cris)
@@ -8031,7 +8034,10 @@ fi
if test "$target_bsd_user" = "yes" ; then
echo "CONFIG_BSD_USER=y" >> $config_target_mak
fi
+if test "$target_require_semihosting" = "yes" ; then
+ echo "$target/config-devices.mak: CONFIG_SEMIHOSTING=y" >> $config_host_mak +fi
---
3/ Or force MINIKCONF_ARGS:
---
if test "$target_require_semihosting" = "yes" ; then
echo "MINIKCONF_ARGS += CONFIG_SEMIHOSTING=y" >> $config_target_mak
fi
---
Also note for ARM all configs require it, but for MIPS we only want it for user-mode.
With 1/ this can be done as:
-- >8 --
target/mips/target-devices.mak new file +3 -0
@@ -0,0 +1,3 @@ +ifndef CONFIG_SOFTMMU +CONFIG_SEMIHOSTING=y +endif
---
Quoted 5 lines
Same for patch 10.
Paolo
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): CAP+75-W0PVH+Gmo3-4qq8Of7ss=Zr4FLVUrxc+nwwdqakHy=Uw@mail.gmail.com
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): CAP+75-XGxAnc_xVReTXicPhUAGjq_Q4D5Dpw3yd=6ayAFjSftw@mail.gmail.com
Re: [PATCH 09/11] target/mips: Always enable CONFIG_SEMIHOSTING
Quoted 5 lines · Philippe Mathieu-Daudé
Quoted 4 lines
Let's then:
1) allow multiply-defined variables (just remove the "if" from
do_declaration)Apparently not needed with 2)
Since "config SEMIHOSTING" is in hw/semihosting/Kconfig, it should be needed no?
Quoted 8 lines
Quoted 6 lines
2) do
config SEMIHOSTING
default y if TCGin target/arm/Kconfig.
You rock!
Re: [PATCH 09/11] target/mips: Always enable CONFIG_SEMIHOSTING
In reply to a message not in the archiveQuoted 27 lines · Philippe Mathieu-Daudé
Quoted 2 lines
You can add
CONFIG_SEMIHOSTING=ydirectly in theKconfigfile.I didn't know because it is not documented and no examples, but I the code is here:
#
assignment_var: ID (starting with "CONFIG_")
defparse_assignment_var(self):
if self.tok ==TOK_ID:
val = self.val
if notval.startswith("CONFIG_"):
raiseKconfigParserError(self, 'Expected identifier starting with "CONFIG_"', TOK_NONE)
self.get_token()
returnself.data.do_var(val[7:])
else:
raiseKconfigParserError(self, 'Expected identifier')# assignment: var EQUAL
y_or_n
defparse_assignment(self):
var =self.parse_assignment_var()
if self.tok !=TOK_EQUAL:
raiseKconfigParserError(self, 'Expected "="')self.get_token()self.data.do_assignment(var, self.parse_y_or_n())
Quoted 1 line
Thanks!
Well yeah, it's a bit of a hack and simply the simplest way to implement it. If it turns out that there are other ways to achieve what you need, it's better.
Paolo
PATCH 10/11 target/arm: Always enable CONFIG_SEMIHOSTING
In reply to Philippe Mathieu-DaudéOn ARM, the semihosting feature is always required on user-space, and is also used by system emulation.
--- default-configs/aarch64-linux-user-common.mak | 4 ++++ default-configs/aarch64-linux-user.mak | 2 ++ default-configs/aarch64_be-linux-user.mak | 2 ++ default-configs/arm-linux-user-common.mak | 4 ++++ default-configs/arm-linux-user.mak | 2 ++ default-configs/arm-softmmu.mak | 4 +++- default-configs/armeb-linux-user.mak | 2 ++ 7 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 default-configs/aarch64-linux-user-common.mak create mode 100644 default-configs/arm-linux-user-common.mak
default-configs/aarch64-linux-user-common.mak new file +4 -0
@@ -0,0 +1,4 @@ +# Common aarch64*-linux-user CONFIG defines + +# CONFIG_SEMIHOSTING is always required on this architecture +CONFIG_SEMIHOSTING=y
default-configs/aarch64-linux-user.mak +2 -0
@@ -1 +1,3 @@ # Default configuration for aarch64-linux-user + +include aarch64-linux-user-common.mak
default-configs/aarch64_be-linux-user.mak +2 -0
@@ -1 +1,3 @@ # Default configuration for aarch64_be-linux-user + +include aarch64-linux-user-common.mak
default-configs/arm-linux-user-common.mak new file +4 -0
@@ -0,0 +1,4 @@ +# Common arm*-linux-user CONFIG defines + +# CONFIG_SEMIHOSTING is always required on this architecture +CONFIG_SEMIHOSTING=y
default-configs/arm-linux-user.mak +2 -0
@@ -1 +1,3 @@ # Default configuration for arm-linux-user + +include arm-linux-user-common.mak
default-configs/arm-softmmu.mak +3 -1
@@ -1,5 +1,8 @@ # Default configuration for arm-softmmu +# CONFIG_SEMIHOSTING is always required on this architecture +CONFIG_SEMIHOSTING=y + # TODO: ARM_V7M is currently always required - make this more flexible! CONFIG_ARM_V7M=y
@@ -40,5 +43,4 @@ CONFIG_MICROBIT=y CONFIG_FSL_IMX25=y CONFIG_FSL_IMX7=y CONFIG_FSL_IMX6UL=y -CONFIG_SEMIHOSTING=y CONFIG_ALLWINNER_H3=y
default-configs/armeb-linux-user.mak +2 -0
@@ -1 +1,3 @@ # Default configuration for armeb-linux-user + +include arm-linux-user-common.mak
Signature · 1 line
2.21.1
Re: [PATCH 10/11] target/arm: Always enable CONFIG_SEMIHOSTING
Quoted 4 lines · Philippe Mathieu-Daudé
On ARM, the semihosting feature is always required on user-space, and is also used by system emulation.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>
Quoted 11 lines
--- default-configs/aarch64-linux-user-common.mak | 4 ++++ default-configs/aarch64-linux-user.mak | 2 ++ default-configs/aarch64_be-linux-user.mak | 2 ++ default-configs/arm-linux-user-common.mak | 4 ++++ default-configs/arm-linux-user.mak | 2 ++ default-configs/arm-softmmu.mak | 4 +++- default-configs/armeb-linux-user.mak | 2 ++ 7 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 default-configs/aarch64-linux-user-common.mak create mode 100644 default-configs/arm-linux-user-common.mak
r~
PATCH 11/11 hw/semihosting: Make the feature depend of TCG, and allow to disable it
In reply to Philippe Mathieu-DaudéThe semihosting feature is only meaningful when using TCG.
So far only the ARM/MIPS/LM32 provide the semihosting feature.
Do not enable it by default, and let the few targets requiring it to manually select it.
--- hw/semihosting/Kconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
hw/semihosting/Kconfig +3 -1
@@ -1,3 +1,5 @@ config SEMIHOSTING - bool + bool + depends on TCG + default n
Signature · 1 line
2.21.1
Re: [PATCH 11/11] hw/semihosting: Make the feature depend of TCG, and allow to disable it
Quoted 4 lines · Philippe Mathieu-Daudé
The semihosting feature is only meaningful when using TCG.
So far only the ARM/MIPS/LM32 provide the semihosting feature.
Also m68k, nios2, xtensa. riscv eventually but not yet upstream.
Quoted 14 lines
Do not enable it by default, and let the few targets requiring it to manually select it.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/semihosting/Kconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)hw/semihosting/Kconfig +0
-0
hw/semihosting/Kconfig line 5
Quoted 6 lines
hw/semihosting/Kconfig +3
-1@@ -1,3 +1,5 @@ config SEMIHOSTING - bool + bool + depends on TCG + default n
OK, this is the "do not enable by default" -- where is the "but do enable by default for the targets that use it" part of the config change ?
thanks
-- PMM
Re: [PATCH 11/11] hw/semihosting: Make the feature depend of TCG, and allow to disable it
Quoted 23 lines · Peter Maydell
Quoted 4 lines · Philippe Mathieu-Daudé
The semihosting feature is only meaningful when using TCG.
So far only the ARM/MIPS/LM32 provide the semihosting feature.
Also m68k, nios2, xtensa. riscv eventually but not yet upstream.
Quoted 15 lines
Do not enable it by default, and let the few targets requiring it to manually select it.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/semihosting/Kconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)hw/semihosting/Kconfig +0
-0@@ -1,3 +1,5 @@
Quoted 9 lines
hw/semihosting/Kconfig line 5
Quoted 5 lines
hw/semihosting/Kconfig +3
-1config SEMIHOSTING - bool + bool + depends on TCG + default nOK, this is the "do not enable by default" -- where is the "but do enable by default for the targets that use it" part of the config change ?
This is already the default for these targets, see:
commit 16932bb761e52c2ca9397b57af5bdc5bdc5ae6a4
Author: Alex Bennée <[email protected]> Date: Mon May 13 15:25:27 2019 +0100
semihosting: introduce CONFIG_SEMIHOSTING
There isn't much point building semihosting for platforms that don't support it. Introduce a new symbol and enable it only for the softmmu targets that need it.
I'll add that information in the description.
Quoted 4 lines
thanks
-- PMM
Re: [PATCH 11/11] hw/semihosting: Make the feature depend of TCG, and allow to disable it
In reply to Philippe Mathieu-DaudéQuoted 11 lines · Philippe Mathieu-Daudé
The semihosting feature is only meaningful when using TCG.
So far only the ARM/MIPS/LM32 provide the semihosting feature.
Do not enable it by default, and let the few targets requiring it to manually select it.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/semihosting/Kconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
r~