accel: Allow targets to use Kconfig
v8 cover accel: Allow targets to use Kconfig
Missing review:
- 03/10 MAINTAINERS: Cover the HAX accelerator stub
- 04/10 configure: Generate rule to calculate base arch of target
This series include generic patches I took of the KVM/ARM specific series which will follow.
- Update accelerators in MAINTAINERS
- Add accel/Kconfig
- Allow targets to use their how Kconfig
Since v7:
- Generate base-arch() (Alex)
- Do not deprecate HAXM
Since v6:
- Fixed typo 'startwith' -> 'startswith' (armbru)
Since v5:
- Fixed typo in patch #4 subject
- Added David R-b tag
- Stripped --- comments
Since v4:
- Addressed rth review comments in rules.mak
Since v3:
- Fixed base-arch() rule (rth)
- Dropped 'semihosting: Make the feature depend of TCG'
Since v2:
- Addressed Thomas review comments
- Fixed problem when including TARGET instead of BASE_TARGET
Since v1:
https://www.mail-archive.com/[email protected]/msg689024.html
- Drop HVF MAINTAINERS patch (merged elsewhere)
- Kconfig-select SEMIHOSTING (bonzini)
- Drop user-mode selection patches
- consider m68k/nios2/xtensa/riscv (pm215)
- reword Kconfig SEMIHOSTING description (pm215)
- reset some of rth R-b tags
Previous RFC for semihosting posted earlier:
https://www.mail-archive.com/[email protected]/msg631218.html
Alex Bennée (1):
configure: Generate rule to calculate the base architecture of a
target
Philippe Mathieu-Daudé (9):
MAINTAINERS: Fix KVM path expansion glob
MAINTAINERS: Add an 'overall' entry for accelerators
MAINTAINERS: Cover the HAX accelerator stub
Makefile: Remove dangerous EOL trailing backslash
Makefile: Write MINIKCONF variables as one entry per line accel/Kconfig: Extract accel selectors into their own config accel/Kconfig: Add the TCG selector
Makefile: Allow target-specific optional Kconfig accel/tcg: Add stub for probe_access()
configure | 19 +++++++++++++++++++ Makefile | 15 +++++++++++---- accel/stubs/tcg-stub.c | 7 +++++++ Kconfig.host | 7 ------- MAINTAINERS | 14 +++++++++++++- accel/Kconfig | 9 +++++++++ 6 files changed, 59 insertions(+), 12 deletions(-) create mode 100644 accel/Kconfig
Signature · 1 line
2.21.3
PATCH v8 1/10 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
@@ -362,7 +362,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.3
PATCH v8 2/10 MAINTAINERS: Add an 'overall' entry for accelerators
In reply to Philippe Mathieu-Daudé--- MAINTAINERS | 11 +++++++++++ 1 file changed, 11 insertions(+)
MAINTAINERS +11 -0
@@ -416,6 +416,17 @@ 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/accel.c +F: accel/Makefile.objs +F: accel/stubs/Makefile.objs + X86 HVF CPUs M: Roman Bolshakov <[email protected]> S: Maintained
Signature · 1 line
2.21.3
PATCH v8 3/10 MAINTAINERS: Cover the HAX accelerator stub
In reply to Philippe Mathieu-DaudéCover accel/stubs/hax-stub.c in the HAXM section.
--- MAINTAINERS | 1 + 1 file changed, 1 insertion(+)
MAINTAINERS +1 -0
@@ -474,6 +474,7 @@ M: Colin Xu <[email protected]> L: [email protected] W: https://github.com/intel/haxm/issues S: Maintained +F: accel/stubs/hax-stub.c F: include/sysemu/hax.h F: target/i386/hax-*
Signature · 1 line
2.21.3
PATCH v8 4/10 configure: Generate rule to calculate the base architecture of a target
In reply to Philippe Mathieu-DaudéFrom: Alex Bennée <[email protected]>
As we encode the base architecture in configure.sh, we can emit the base-arch() function into config-host.mak.
--- configure | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
configure +19 -0
@@ -7756,6 +7756,8 @@ if test "$linux" = "yes" ; then fi fi +target_to_base_map="" + for target in $target_list; do target_dir="$target" config_target_mak=$target_dir/config-target.mak
@@ -7984,6 +7986,7 @@ target_arch_name="$(upper $TARGET_ARCH)" echo "TARGET_$target_arch_name=y" >> $config_target_mak echo "TARGET_NAME=$target_name" >> $config_target_mak echo "TARGET_BASE_ARCH=$TARGET_BASE_ARCH" >> $config_target_mak +target_to_base_map="$target_dir,$TARGET_BASE_ARCH $target_to_base_map" if [ "$TARGET_ABI_DIR" = "" ]; then TARGET_ABI_DIR=$TARGET_ARCH fi
@@ -8199,6 +8202,22 @@ if test "$ccache_cpp2" = "yes"; then echo "export CCACHE_CPP2=y" >> $config_host_mak fi +# Export a rule for calculating base arch from target_dir for use by +# the Kconfig generator +echo "# Usage: \$(call base-arch, target-dir)" >> $config_host_mak +echo "# Return the base architecture for a target." >> $config_host_mak +echo "# e.g \$(call base-arch, aarch64-linux-user) returns 'arm'" >> $config_host_mak +echo "base-arch = \$(strip \\" >> $config_host_mak +close_braces="" +for pairs in $target_to_base_map +do + dir="${pairs%%,*}" + base="${pairs#*,}" + echo "\$(if \$(findstring $dir,\$1),$base, \\" >> $config_host_mak + close_braces="$close_braces )" +done +echo "$close_braces )" >> $config_host_mak + # If we're using a separate build tree, set it up now. # DIRS are directories which we simply mkdir in the build tree; # LINKS are things to symlink back into the source tree
Signature · 1 line
2.21.3
PATCH v8 5/10 Makefile: Remove dangerous EOL trailing backslash
In reply to Philippe Mathieu-DaudéOne might get caught trying to understand unexpected Makefile behavior. Trailing backslash can help to split very long lines, but are rather dangerous when nothing follow. Preserve other developers debugging time by removing this one.
--- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
@@ -420,7 +420,7 @@ MINIKCONF_ARGS = \ 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 \ +MINIKCONF = $(PYTHON) $(SRC_PATH)/scripts/minikconf.py $(SUBDIR_DEVICES_MAK): %/config-devices.mak: default-configs/%.mak $(MINIKCONF_DEPS) $(BUILD_DIR)/config-host.mak $(call quiet-command, $(MINIKCONF) $(MINIKCONF_ARGS) > [email protected], "GEN", "[email protected]")
Signature · 1 line
2.21.3
Re: [PATCH v8 05/10] Makefile: Remove dangerous EOL trailing backslash
Quoted 7 lines · Philippe Mathieu-Daudé
One might get caught trying to understand unexpected
Makefilebehavior. Trailing backslash can help to split very long lines, but are rather dangerous when nothing follow. Preserve other developers debugging time by removing this one.Reviewed-by Thomas Huth <[email protected]>Reviewed-by Alistair Francis <[email protected]>
I forgot here:
Quoted 20 lines
Reviewed-by Alex Bennée <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Makefile +1
-1@@ -420,7 +420,7 @@ MINIKCONF_ARGS = \ 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 \ +MINIKCONF = $(PYTHON) $(SRC_PATH)/scripts/minikconf.py $(SUBDIR_DEVICES_MAK): %/config-devices.mak: default-configs/%.mak $(MINIKCONF_DEPS) $(BUILD_DIR)/config-host.mak $(call quiet-command, $(MINIKCONF) $(MINIKCONF_ARGS) > [email protected], "GEN", "[email protected]")
PATCH v8 6/10 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 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
Makefile +6 -3
@@ -418,12 +418,15 @@ 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 - $(call quiet-command, $(MINIKCONF) $(MINIKCONF_ARGS) > [email protected], "GEN", "[email protected]") + $(call quiet-command, $(MINIKCONF) $(MINIKCONF_ARGS) \ + > [email protected], "GEN", "[email protected]") $(call quiet-command, if test -f $@; then \ if cmp -s [email protected] $@; then \ mv [email protected] $@; \
Signature · 1 line
2.21.3
PATCH v8 7/10 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.3
PATCH v8 8/10 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.3
PATCH v8 9/10 Makefile: Allow target-specific optional Kconfig
In reply to Philippe Mathieu-DaudéAllow use of target-specific Kconfig file.
--- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Makefile +3 -1
@@ -423,11 +423,13 @@ MINIKCONF_INPUTS = $(SRC_PATH)/Kconfig.host \ $(SRC_PATH)/accel/Kconfig \ $(SRC_PATH)/hw/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 $(call quiet-command, $(MINIKCONF) $(MINIKCONF_ARGS) \ + $(wildcard $(SRC_PATH)/target/$(call base-arch, $@)/Kconfig) \ > [email protected], "GEN", "[email protected]") $(call quiet-command, if test -f $@; then \ if cmp -s [email protected] $@; then \
Signature · 1 line
2.21.3
PATCH v8 10/10 accel/tcg: Add stub for probe_access()
In reply to Philippe Mathieu-DaudéFrom: Philippe Mathieu-Daudé <[email protected]>
The TCG helpers where added in b92e5a22ec3 in softmmu_template.h. probe_write() was added in there in 3b4afc9e75a to be moved out to accel/tcg/cputlb.c in 3b08f0a9254, and was later refactored as probe_access() in c25c283df0f.
Since it is a TCG specific helper, add a stub to avoid failures when building without TCG, such:
target/arm/helper.o: In function `probe_read':
include/exec/exec-all.h:362: undefined reference to `probe_access'
--- accel/stubs/tcg-stub.c | 7 +++++++ 1 file changed, 7 insertions(+)
accel/stubs/tcg-stub.c +7 -0
@@ -22,3 +22,10 @@ void tb_flush(CPUState *cpu)void tlb_set_dirty (CPUState *cpu,target_ulong vaddr) { } + +void *probe_access (CPUArchState *env,target_ulong addr,int size, +MMUAccessType access_type,int mmu_idx,uintptr_t retaddr) +{ +/* Handled by hardware accelerator. */ +g_assert_not_reached (); +}
Signature · 1 line
2.21.3
Hi Paolo,
FYI this series applies cleanly on current master (7d3660e798 merging your for-upstream 3575b0aea9).
Quoted 70 lines · Philippe Mathieu-Daudé
Missing review:
- 03/10MAINTAINERS: Cover the HAX accelerator stub
- 04/10 configure: Generate rule to calculate base arch of targetThis series include generic patches I took of the KVM/ARM specific series which will follow.
- Update accelerators in
MAINTAINERS
- Add accel/Kconfig
- Allow targets to use their howKconfigSince v7:
- Generate base-arch() (Alex)
- Do not deprecate HAXMSince v6:
- Fixed typo 'startwith' -> 'startswith' (armbru)Since v5:
- Fixed typo in patch #4 subject
- Added David R-b tag
- Stripped --- commentsSince v4:
- Addressed rth review comments in rules.makSince v3:
- Fixed base-arch() rule (rth)
- Dropped 'semihosting: Make the feature depend of TCG'Since v2:
- Addressed Thomas review comments
- Fixed problem when including TARGET instead ofBASE_TARGETSince v1:
https://www.mail-archive.com/[email protected]/msg689024.html
- Drop HVFMAINTAINERSpatch (merged elsewhere)
- Kconfig-select SEMIHOSTING (bonzini)
- Drop user-mode selection patches
- consider m68k/nios2/xtensa/riscv (pm215)
- rewordKconfigSEMIHOSTING description (pm215)
- reset some of rth R-b tagsPrevious RFC for semihosting posted earlier:
https://www.mail-archive.com/[email protected]/msg631218.htmlAlex Bennée (1):
configure: Generate rule to calculate the base architecture of a
targetPhilippe Mathieu-Daudé (9):
MAINTAINERS: Fix KVM path expansion glob
MAINTAINERS: Add an 'overall' entry for accelerators
MAINTAINERS: Cover the HAX accelerator stub
Makefile: Remove dangerous EOL trailing backslash
Makefile: Write MINIKCONF variables as one entry per line accel/Kconfig: Extract accel selectors into their own config accel/Kconfig: Add the TCG selector
Makefile: Allow target-specific optionalKconfigaccel/tcg: Add stub forprobe_access()configure | 19 +++++++++++++++++++ Makefile | 15 +++++++++++---- accel/stubs/tcg-stub.c | 7 +++++++ Kconfig.host | 7 ------- MAINTAINERS | 14 +++++++++++++- accel/Kconfig | 9 +++++++++ 6 files changed, 59 insertions(+), 12 deletions(-) create mode 100644 accel/Kconfig