diff --git a/.travis.yml b/.travis.yml index 519e62432d..1054ec5d29 100644 --- a/.travis.yml +++ b/.travis.yml @@ -226,14 +226,6 @@ jobs: - TEST_CMD="" - # Check the TCG interpreter (TCI) - - name: "GCC TCI" - env: - - CONFIG="--enable-debug-tcg --enable-tcg-interpreter --disable-kvm --disable-containers - --target-list=alpha-softmmu,arm-softmmu,hppa-softmmu,m68k-softmmu,microblaze-softmmu,moxie-softmmu,ppc-softmmu,s390x-softmmu,x86_64-softmmu" - - TEST_CMD="make check-qtest check-tcg V=1" - - # We don't need to exercise every backend with every front-end - name: "GCC trace log,simple,syslog (user)" env: diff --git a/configure b/configure index f46f433649..66641099fc 100755 --- a/configure +++ b/configure @@ -219,108 +219,6 @@ glob() { eval test -z '"${1#'"$2"'}"' } -supported_hax_target() { - test "$hax" = "yes" || return 1 - glob "$1" "*-softmmu" || return 1 - case "${1%-softmmu}" in - i386|x86_64) - return 0 - ;; - esac - return 1 -} - -supported_kvm_target() { - test "$kvm" = "yes" || return 1 - glob "$1" "*-softmmu" || return 1 - case "${1%-softmmu}:$cpu" in - aarch64:aarch64 | \ - i386:i386 | i386:x86_64 | i386:x32 | \ - x86_64:i386 | x86_64:x86_64 | x86_64:x32 | \ - mips:mips | mipsel:mips | mips64:mips | mips64el:mips | \ - ppc:ppc | ppc64:ppc | ppc:ppc64 | ppc64:ppc64 | ppc64:ppc64le | \ - s390x:s390x) - return 0 - ;; - esac - return 1 -} - -supported_xen_target() { - test "$xen" = "yes" || return 1 - glob "$1" "*-softmmu" || return 1 - # Only i386 and x86_64 provide the xenpv machine. - case "${1%-softmmu}" in - i386|x86_64) - return 0 - ;; - esac - return 1 -} - -supported_hvf_target() { - test "$hvf" = "yes" || return 1 - glob "$1" "*-softmmu" || return 1 - case "${1%-softmmu}" in - x86_64) - return 0 - ;; - esac - return 1 -} - -supported_whpx_target() { - test "$whpx" = "yes" || return 1 - glob "$1" "*-softmmu" || return 1 - case "${1%-softmmu}" in - i386|x86_64) - return 0 - ;; - esac - return 1 -} - -deprecated_targets_list=ppc64abi32-linux-user,tilegx-linux-user,lm32-softmmu,unicore32-softmmu -deprecated_features="" - -supported_target() { - case "$1" in - *-softmmu) - ;; - *-linux-user) - if test "$linux" != "yes"; then - print_error "Target '$target' is only available on a Linux host" - return 1 - fi - ;; - *-bsd-user) - if test "$bsd" != "yes"; then - print_error "Target '$target' is only available on a BSD host" - return 1 - fi - ;; - *) - print_error "Invalid target name '$target'" - return 1 - ;; - esac - - # if a deprecated target is enabled we note it here - if echo "$deprecated_targets_list" | grep -q "$1"; then - add_to deprecated_features $1 - fi - - test "$tcg" = "yes" && return 0 - supported_kvm_target "$1" && return 0 - supported_xen_target "$1" && return 0 - supported_hax_target "$1" && return 0 - supported_hvf_target "$1" && return 0 - supported_whpx_target "$1" && return 0 - print_error "TCG disabled, but hardware accelerator not available for '$target'" - return 1 -} - - ld_has() { $ld --help 2>/dev/null | grep ".$1" >/dev/null 2>&1 } @@ -405,7 +303,7 @@ sdl_image="auto" virtfs="" mpath="auto" vnc="enabled" -sparse="no" +sparse="auto" vde="" vnc_sasl="auto" vnc_jpeg="auto" @@ -413,14 +311,14 @@ vnc_png="auto" xkbcommon="auto" xen="" xen_ctrl_version="" -xen_pci_passthrough="" +xen_pci_passthrough="auto" linux_aio="" linux_io_uring="" cap_ng="" attr="" libattr="" xfs="" -tcg="yes" +tcg="enabled" membarrier="" vhost_net="" vhost_crypto="" @@ -428,10 +326,10 @@ vhost_scsi="" vhost_vsock="" vhost_user="" vhost_user_fs="" -kvm="no" -hax="no" -hvf="no" -whpx="no" +kvm="auto" +hax="auto" +hvf="auto" +whpx="auto" rdma="" pvrdma="" gprof="no" @@ -811,14 +709,9 @@ fi # OS specific -# host *BSD for user mode -HOST_VARIANT_DIR="" - case $targetos in MINGW32*) mingw32="yes" - hax="yes" - whpx="" vhost_user="no" audio_possible_drivers="dsound sdl" if check_include dsound.h; then @@ -841,36 +734,29 @@ FreeBSD) audio_possible_drivers="oss sdl pa" # needed for kinfo_getvmmap(3) in libutil.h netmap="" # enable netmap autodetect - HOST_VARIANT_DIR="freebsd" ;; DragonFly) bsd="yes" make="${MAKE-gmake}" audio_drv_list="oss try-sdl" audio_possible_drivers="oss sdl pa" - HOST_VARIANT_DIR="dragonfly" ;; NetBSD) bsd="yes" - hax="yes" make="${MAKE-gmake}" audio_drv_list="oss try-sdl" audio_possible_drivers="oss sdl" oss_lib="-lossaudio" - HOST_VARIANT_DIR="netbsd" ;; OpenBSD) bsd="yes" make="${MAKE-gmake}" audio_drv_list="try-sdl" audio_possible_drivers="sdl" - HOST_VARIANT_DIR="openbsd" ;; Darwin) bsd="yes" darwin="yes" - hax="yes" - hvf="" if [ "$cpu" = "x86_64" ] ; then QEMU_CFLAGS="-arch x86_64 $QEMU_CFLAGS" QEMU_LDFLAGS="-arch x86_64 $QEMU_LDFLAGS" @@ -882,7 +768,6 @@ Darwin) # Disable attempts to use ObjectiveC features in os/object.h since they # won't work when we're compiling with gcc as a C compiler. QEMU_CFLAGS="-DOS_OBJECT_USE_OBJC=0 $QEMU_CFLAGS" - HOST_VARIANT_DIR="darwin" ;; SunOS) solaris="yes" @@ -906,7 +791,6 @@ Linux) audio_possible_drivers="oss alsa sdl pa" linux="yes" linux_user="yes" - kvm="yes" QEMU_INCLUDES="-isystem ${source_path}/linux-headers -Ilinux-headers $QEMU_INCLUDES" ;; esac @@ -1156,9 +1040,9 @@ for opt do ;; --disable-tsan) tsan="no" ;; - --enable-sparse) sparse="yes" + --enable-sparse) sparse="enabled" ;; - --disable-sparse) sparse="no" + --disable-sparse) sparse="disabled" ;; --disable-strip) strip_opt="no" ;; @@ -1188,33 +1072,33 @@ for opt do ;; --enable-netmap) netmap="yes" ;; - --disable-xen) xen="no" + --disable-xen) xen="disabled" ;; - --enable-xen) xen="yes" + --enable-xen) xen="enabled" ;; - --disable-xen-pci-passthrough) xen_pci_passthrough="no" + --disable-xen-pci-passthrough) xen_pci_passthrough="disabled" ;; - --enable-xen-pci-passthrough) xen_pci_passthrough="yes" + --enable-xen-pci-passthrough) xen_pci_passthrough="enabled" ;; --disable-brlapi) brlapi="no" ;; --enable-brlapi) brlapi="yes" ;; - --disable-kvm) kvm="no" + --disable-kvm) kvm="disabled" ;; - --enable-kvm) kvm="yes" + --enable-kvm) kvm="enabled" ;; - --disable-hax) hax="no" + --disable-hax) hax="disabled" ;; - --enable-hax) hax="yes" + --enable-hax) hax="enabled" ;; - --disable-hvf) hvf="no" + --disable-hvf) hvf="disabled" ;; - --enable-hvf) hvf="yes" + --enable-hvf) hvf="enabled" ;; - --disable-whpx) whpx="no" + --disable-whpx) whpx="disabled" ;; - --enable-whpx) whpx="yes" + --enable-whpx) whpx="enabled" ;; --disable-tcg-interpreter) tcg_interpreter="no" ;; @@ -1224,9 +1108,9 @@ for opt do ;; --enable-cap-ng) cap_ng="yes" ;; - --disable-tcg) tcg="no" + --disable-tcg) tcg="disabled" ;; - --enable-tcg) tcg="yes" + --enable-tcg) tcg="enabled" ;; --disable-malloc-trim) malloc_trim="disabled" ;; @@ -1710,22 +1594,19 @@ if [ "$ARCH" = "unknown" ]; then linux_user="no" fi -if [ "$bsd_user" = "no" -a "$linux_user" = "no" -a "$softmmu" = "no" ] ; then - tcg="no" -fi - default_target_list="" - +deprecated_targets_list=ppc64abi32-linux-user,tilegx-linux-user,lm32-softmmu,unicore32-softmmu +deprecated_features="" mak_wilds="" if [ "$softmmu" = "yes" ]; then - mak_wilds="${mak_wilds} $source_path/default-configs/*-softmmu.mak" + mak_wilds="${mak_wilds} $source_path/default-configs/targets/*-softmmu.mak" fi if [ "$linux_user" = "yes" ]; then - mak_wilds="${mak_wilds} $source_path/default-configs/*-linux-user.mak" + mak_wilds="${mak_wilds} $source_path/default-configs/targets/*-linux-user.mak" fi if [ "$bsd_user" = "yes" ]; then - mak_wilds="${mak_wilds} $source_path/default-configs/*-bsd-user.mak" + mak_wilds="${mak_wilds} $source_path/default-configs/targets/*-bsd-user.mak" fi # If the user doesn't explicitly specify a deprecated target we will @@ -2043,16 +1924,6 @@ if ! compile_prog ; then error_exit "\"$cc\" cannot build an executable (is your linker broken?)" fi -# Now we have handled --enable-tcg-interpreter and know we're not just -# printing the help message, bail out if the host CPU isn't supported. -if test "$ARCH" = "unknown"; then - if test "$tcg_interpreter" = "yes" ; then - echo "Unsupported CPU = $cpu, will use TCG with TCI (experimental)" - else - error_exit "Unsupported CPU = $cpu, try --enable-tcg-interpreter" - fi -fi - # Consult white-list to determine whether to enable werror # by default. Only enable by default for git builds if test -z "$werror" ; then @@ -2304,12 +2175,13 @@ if test "$solaris" = "yes" ; then fi if test -z "${target_list+xxx}" ; then + default_targets=yes for target in $default_target_list; do - supported_target $target 2>/dev/null && \ - target_list="$target_list $target" + target_list="$target_list $target" done target_list="${target_list# }" else + default_targets=no target_list=$(echo "$target_list" | sed -e 's/,/ /g') for target in $target_list; do # Check that we recognised the target name; this allows a more @@ -2321,10 +2193,16 @@ else error_exit "Unknown target name '$target'" ;; esac - supported_target $target || exit 1 done fi +for target in $target_list; do + # if a deprecated target is enabled we note it here + if echo "$deprecated_targets_list" | grep -q "$target"; then + add_to deprecated_features $target + fi +done + # see if system emulation was really requested case " $target_list " in *"-softmmu "*) softmmu=yes @@ -2665,10 +2543,11 @@ if test "$seccomp" != "no" ; then seccomp="no" fi fi + ########################################## # xen probe -if test "$xen" != "no" ; then +if test "$xen" != "disabled" ; then # Check whether Xen library path is specified via --extra-ldflags to avoid # overriding this setting with pkg-config output. If not, try pkg-config # to obtain all needed flags. @@ -2677,7 +2556,7 @@ if test "$xen" != "no" ; then $pkg_config --exists xencontrol ; then xen_ctrl_version="$(printf '%d%02d%02d' \ $($pkg_config --modversion xencontrol | sed 's/\./ /g') )" - xen=yes + xen=enabled xen_pc="xencontrol xenstore xenguest xenforeignmemory xengnttab" xen_pc="$xen_pc xenevtchn xendevicemodel" if $pkg_config --exists xentoolcore; then @@ -2703,10 +2582,10 @@ int main(void) { EOF if ! compile_prog "" "$xen_libs" ; then # Xen not found - if test "$xen" = "yes" ; then + if test "$xen" = "enabled" ; then feature_not_found "xen" "Install xen devel" fi - xen=no + xen=disabled # Xen unstable elif @@ -2732,7 +2611,7 @@ EOF then xen_stable_libs="-lxendevicemodel $xen_stable_libs -lxentoolcore" xen_ctrl_version=41100 - xen=yes + xen=enabled elif cat > $TMPC < $TMPC < $TMPC < $TMPC < $TMPC < $TMPC << EOF -#include -int main() { return 0;} -EOF - if ! compile_object ""; then - if test "$hvf" = "yes"; then - error_exit "Hypervisor.framework not available" - fi - hvf='no' - else - hvf='yes' - fi -fi - -########################################## # check for sysmacros.h have_sysmacros=no @@ -6151,17 +5984,6 @@ if test "$mingw32" = "yes" ; then done fi -# Disable OpenBSD W^X if available -if test "$tcg" = "yes" && test "$targetos" = "OpenBSD"; then - cat > $TMPC <> $config_host_mak echo "VIRGL_LIBS=$virgl_libs" >> $config_host_mak fi -if test "$xen" = "yes" ; then +if test "$xen" = "enabled" ; then echo "CONFIG_XEN_BACKEND=y" >> $config_host_mak echo "CONFIG_XEN_CTRL_INTERFACE_VERSION=$xen_ctrl_version" >> $config_host_mak echo "XEN_CFLAGS=$xen_cflags" >> $config_host_mak @@ -6783,8 +6605,7 @@ fi if test "$optreset" = "yes" ; then echo "HAVE_OPTRESET=y" >> $config_host_mak fi -if test "$tcg" = "yes"; then - echo "CONFIG_TCG=y" >> $config_host_mak +if test "$tcg" = "enabled"; then if test "$tcg_interpreter" = "yes" ; then echo "CONFIG_TCG_INTERPRETER=y" >> $config_host_mak fi @@ -7248,9 +7069,6 @@ echo "QEMU_CXXFLAGS=$QEMU_CXXFLAGS" >> $config_host_mak echo "QEMU_INCLUDES=$QEMU_INCLUDES" >> $config_host_mak echo "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak echo "GLIB_LIBS=$glib_libs" >> $config_host_mak -if test "$sparse" = "yes" ; then - echo "SPARSE_CFLAGS = -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_host_mak -fi echo "QEMU_LDFLAGS=$QEMU_LDFLAGS" >> $config_host_mak echo "LDFLAGS_NOPIE=$LDFLAGS_NOPIE" >> $config_host_mak echo "LD_I386_EMULATION=$ld_i386_emulation" >> $config_host_mak @@ -7308,317 +7126,22 @@ if test "$linux" = "yes" ; then fi for target in $target_list; do -target_dir="$target" -config_target_mak=$target_dir/config-target.mak -target_name=$(echo $target | cut -d '-' -f 1) -target_aligned_only="no" -case "$target_name" in - alpha|hppa|mips64el|mips64|mipsel|mips|mipsn32|mipsn32el|sh4|sh4eb|sparc|sparc64|sparc32plus|xtensa|xtensaeb) - target_aligned_only="yes" - ;; -esac -target_bigendian="no" -case "$target_name" in - armeb|aarch64_be|hppa|lm32|m68k|microblaze|mips|mipsn32|mips64|moxie|or1k|ppc|ppc64|ppc64abi32|s390x|sh4eb|sparc|sparc64|sparc32plus|xtensaeb) - target_bigendian="yes" - ;; -esac -target_softmmu="no" -target_user_only="no" -target_linux_user="no" -target_bsd_user="no" -case "$target" in - ${target_name}-softmmu) - target_softmmu="yes" - ;; - ${target_name}-linux-user) - target_user_only="yes" - target_linux_user="yes" - ;; - ${target_name}-bsd-user) - target_user_only="yes" - target_bsd_user="yes" - ;; - *) - error_exit "Target '$target' not recognised" - exit 1 - ;; -esac - -mkdir -p $target_dir -echo "# Automatically generated by configure - do not modify" > $config_target_mak - -bflt="no" -mttcg="no" -interp_prefix1=$(echo "$interp_prefix" | sed "s/%M/$target_name/g") -gdb_xml_files="" - -TARGET_ARCH="$target_name" -TARGET_BASE_ARCH="" -TARGET_ABI_DIR="" -TARGET_SYSTBL_ABI="" -TARGET_SYSTBL="" - -case "$target_name" in - i386) - mttcg="yes" - gdb_xml_files="i386-32bit.xml" - TARGET_SYSTBL_ABI=i386 - TARGET_SYSTBL=syscall_32.tbl - ;; - x86_64) - TARGET_BASE_ARCH=i386 - TARGET_SYSTBL_ABI=common,64 - TARGET_SYSTBL=syscall_64.tbl - mttcg="yes" - gdb_xml_files="i386-64bit.xml" - ;; - alpha) - mttcg="yes" - TARGET_SYSTBL_ABI=common - ;; - arm|armeb) - TARGET_ARCH=arm - TARGET_SYSTBL_ABI=common,oabi - bflt="yes" - mttcg="yes" - gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml arm-m-profile.xml" - ;; - aarch64|aarch64_be) - TARGET_ARCH=aarch64 - TARGET_BASE_ARCH=arm - bflt="yes" - mttcg="yes" - gdb_xml_files="aarch64-core.xml aarch64-fpu.xml arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml arm-m-profile.xml" - ;; - avr) - gdb_xml_files="avr-cpu.xml" - target_compiler=$cross_cc_avr - ;; - cris) - ;; - hppa) - mttcg="yes" - TARGET_SYSTBL_ABI=common,32 - ;; - lm32) - ;; - m68k) - bflt="yes" - gdb_xml_files="cf-core.xml cf-fp.xml m68k-core.xml m68k-fp.xml" - TARGET_SYSTBL_ABI=common - ;; - microblaze|microblazeel) - TARGET_ARCH=microblaze - TARGET_SYSTBL_ABI=common - mttcg="yes" - bflt="yes" - ;; - mips|mipsel) - mttcg="yes" - TARGET_ARCH=mips - echo "TARGET_ABI_MIPSO32=y" >> $config_target_mak - TARGET_SYSTBL_ABI=o32 - TARGET_SYSTBL=syscall_o32.tbl - ;; - mipsn32|mipsn32el) - mttcg="yes" - TARGET_ARCH=mips64 - TARGET_BASE_ARCH=mips - echo "TARGET_ABI_MIPSN32=y" >> $config_target_mak - echo "TARGET_ABI32=y" >> $config_target_mak - TARGET_SYSTBL_ABI=n32 - TARGET_SYSTBL=syscall_n32.tbl - ;; - mips64|mips64el) - mttcg="no" - TARGET_ARCH=mips64 - TARGET_BASE_ARCH=mips - echo "TARGET_ABI_MIPSN64=y" >> $config_target_mak - TARGET_SYSTBL_ABI=n64 - TARGET_SYSTBL=syscall_n64.tbl - ;; - moxie) - ;; - nios2) - ;; - or1k) - TARGET_ARCH=openrisc - TARGET_BASE_ARCH=openrisc - ;; - ppc) - gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml" - TARGET_SYSTBL_ABI=common,nospu,32 - ;; - ppc64) - TARGET_BASE_ARCH=ppc - TARGET_ABI_DIR=ppc - TARGET_SYSTBL_ABI=common,nospu,64 - mttcg=yes - gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml power-vsx.xml" - ;; - ppc64le) - TARGET_ARCH=ppc64 - TARGET_BASE_ARCH=ppc - TARGET_ABI_DIR=ppc - TARGET_SYSTBL_ABI=common,nospu,64 - mttcg=yes - gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml power-vsx.xml" - ;; - ppc64abi32) - TARGET_ARCH=ppc64 - TARGET_BASE_ARCH=ppc - TARGET_ABI_DIR=ppc - TARGET_SYSTBL_ABI=common,nospu,32 - echo "TARGET_ABI32=y" >> $config_target_mak - gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml power-vsx.xml" - ;; - riscv32) - TARGET_BASE_ARCH=riscv - TARGET_ABI_DIR=riscv - mttcg=yes - gdb_xml_files="riscv-32bit-cpu.xml riscv-32bit-fpu.xml riscv-64bit-fpu.xml riscv-32bit-csr.xml riscv-32bit-virtual.xml" - ;; - riscv64) - TARGET_BASE_ARCH=riscv - TARGET_ABI_DIR=riscv - mttcg=yes - gdb_xml_files="riscv-64bit-cpu.xml riscv-32bit-fpu.xml riscv-64bit-fpu.xml riscv-64bit-csr.xml riscv-64bit-virtual.xml" - ;; - rx) - TARGET_ARCH=rx - bflt="yes" - target_compiler=$cross_cc_rx - gdb_xml_files="rx-core.xml" - ;; - sh4|sh4eb) - TARGET_ARCH=sh4 - TARGET_SYSTBL_ABI=common - bflt="yes" - ;; - sparc) - TARGET_SYSTBL_ABI=common,32 - ;; - sparc64) - TARGET_BASE_ARCH=sparc - TARGET_SYSTBL_ABI=common,64 - ;; - sparc32plus) - TARGET_ARCH=sparc64 - TARGET_BASE_ARCH=sparc - TARGET_ABI_DIR=sparc - TARGET_SYSTBL_ABI=common,32 - echo "TARGET_ABI32=y" >> $config_target_mak - ;; - s390x) - TARGET_SYSTBL_ABI=common,64 - mttcg=yes - gdb_xml_files="s390x-core64.xml s390-acr.xml s390-fpr.xml s390-vx.xml s390-cr.xml s390-virt.xml s390-gs.xml" - ;; - tilegx) - ;; - tricore) - ;; - unicore32) - ;; - xtensa|xtensaeb) - TARGET_ARCH=xtensa - TARGET_SYSTBL_ABI=common - bflt="yes" - mttcg="yes" - ;; - *) - error_exit "Unsupported target CPU" - ;; -esac -# TARGET_BASE_ARCH needs to be defined after TARGET_ARCH -if [ "$TARGET_BASE_ARCH" = "" ]; then - TARGET_BASE_ARCH=$TARGET_ARCH -fi -if [ "$TARGET_SYSTBL_ABI" != "" ] && [ "$TARGET_SYSTBL" = "" ]; then - TARGET_SYSTBL=syscall.tbl -fi - -upper() { - echo "$@"| LC_ALL=C tr '[a-z]' '[A-Z]' -} - -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 -if [ "$TARGET_ABI_DIR" = "" ]; then - TARGET_ABI_DIR=$TARGET_ARCH -fi -echo "TARGET_ABI_DIR=$TARGET_ABI_DIR" >> $config_target_mak -if [ "$HOST_VARIANT_DIR" != "" ]; then - echo "HOST_VARIANT_DIR=$HOST_VARIANT_DIR" >> $config_target_mak -fi -if [ "$TARGET_SYSTBL_ABI" != "" ]; then - echo "TARGET_SYSTBL_ABI=$TARGET_SYSTBL_ABI" >> $config_target_mak - echo "TARGET_SYSTBL=$TARGET_SYSTBL" >> $config_target_mak -fi - -if supported_xen_target $target; then - echo "CONFIG_XEN=y" >> $config_target_mak - if test "$xen_pci_passthrough" = yes; then - echo "CONFIG_XEN_PCI_PASSTHROUGH=y" >> "$config_target_mak" - fi -fi -if supported_kvm_target $target; then - echo "CONFIG_KVM=y" >> $config_target_mak -fi -if supported_hax_target $target; then - echo "CONFIG_HAX=y" >> $config_target_mak -fi -if supported_hvf_target $target; then - echo "CONFIG_HVF=y" >> $config_target_mak -fi -if supported_whpx_target $target; then - echo "CONFIG_WHPX=y" >> $config_target_mak -fi -if test "$target_aligned_only" = "yes" ; then - echo "TARGET_ALIGNED_ONLY=y" >> $config_target_mak -fi -if test "$target_bigendian" = "yes" ; then - echo "TARGET_WORDS_BIGENDIAN=y" >> $config_target_mak -fi -if test "$target_softmmu" = "yes" ; then - echo "CONFIG_SOFTMMU=y" >> $config_target_mak - if test "$mttcg" = "yes" ; then - echo "TARGET_SUPPORTS_MTTCG=y" >> $config_target_mak - fi -fi -if test "$target_user_only" = "yes" ; then - echo "CONFIG_USER_ONLY=y" >> $config_target_mak - echo "CONFIG_QEMU_INTERP_PREFIX=\"$interp_prefix1\"" >> $config_target_mak - symlink "../qemu-$target_name" "$target_dir/qemu-$target_name" -else - symlink "../qemu-system-$target_name" "$target_dir/qemu-system-$target_name" -fi -if test "$target_linux_user" = "yes" ; then - echo "CONFIG_LINUX_USER=y" >> $config_target_mak -fi -list="" -if test ! -z "$gdb_xml_files" ; then - for x in $gdb_xml_files; do - list="$list gdb-xml/$x" - done - echo "TARGET_XML_FILES=$list" >> $config_target_mak -fi - -if test "$target_user_only" = "yes" && test "$bflt" = "yes"; then - echo "TARGET_HAS_BFLT=y" >> $config_target_mak -fi -if test "$target_bsd_user" = "yes" ; then - echo "CONFIG_BSD_USER=y" >> $config_target_mak -fi - -done # for target in $targets + target_dir="$target" + target_name=$(echo $target | cut -d '-' -f 1) + mkdir -p $target_dir + case $target in + *-user) symlink "../qemu-$target_name" "$target_dir/qemu-$target_name" ;; + *) symlink "../qemu-system-$target_name" "$target_dir/qemu-system-$target_name" ;; + esac +done if [ "$fdt" = "git" ]; then subdirs="$subdirs dtc" fi +echo "CONFIG_QEMU_INTERP_PREFIX=$interp_prefix" | sed 's/%M/@0@/' >> $config_host_mak +if test "$default_targets" = "yes"; then + echo "CONFIG_DEFAULT_TARGETS=y" >> $config_host_mak +fi echo "SUBDIRS=$subdirs" >> $config_host_mak if test "$numa" = "yes"; then @@ -7792,7 +7315,9 @@ NINJA=${ninja:-$PWD/ninjatool} $meson setup \ -Dstrip=$(if test "$strip_opt" = yes; then echo true; else echo false; fi) \ -Db_pie=$(if test "$pie" = yes; then echo true; else echo false; fi) \ -Db_coverage=$(if test "$gcov" = yes; then echo true; else echo false; fi) \ - -Dmalloc=$malloc -Dmalloc_trim=$malloc_trim \ + -Dmalloc=$malloc -Dmalloc_trim=$malloc_trim -Dsparse=$sparse \ + -Dkvm=$kvm -Dhax=$hax -Dwhpx=$whpx -Dhvf=$hvf \ + -Dxen=$xen -Dxen_pci_passthrough=$xen_pci_passthrough -Dtcg=$tcg \ -Dcocoa=$cocoa -Dmpath=$mpath -Dsdl=$sdl -Dsdl_image=$sdl_image \ -Dvnc=$vnc -Dvnc_sasl=$vnc_sasl -Dvnc_jpeg=$vnc_jpeg -Dvnc_png=$vnc_png \ -Dgettext=$gettext -Dxkbcommon=$xkbcommon -Du2f=$u2f \ diff --git a/default-configs/aarch64-linux-user.mak b/default-configs/aarch64-linux-user.mak deleted file mode 100644 index 0a5b08a007..0000000000 --- a/default-configs/aarch64-linux-user.mak +++ /dev/null @@ -1 +0,0 @@ -# Default configuration for aarch64-linux-user diff --git a/default-configs/aarch64_be-linux-user.mak b/default-configs/aarch64_be-linux-user.mak deleted file mode 100644 index a69d9d2e41..0000000000 --- a/default-configs/aarch64_be-linux-user.mak +++ /dev/null @@ -1 +0,0 @@ -# Default configuration for aarch64_be-linux-user diff --git a/default-configs/alpha-linux-user.mak b/default-configs/alpha-linux-user.mak deleted file mode 100644 index 7956e29898..0000000000 --- a/default-configs/alpha-linux-user.mak +++ /dev/null @@ -1 +0,0 @@ -# Default configuration for alpha-linux-user diff --git a/default-configs/arm-linux-user.mak b/default-configs/arm-linux-user.mak deleted file mode 100644 index 413361a022..0000000000 --- a/default-configs/arm-linux-user.mak +++ /dev/null @@ -1 +0,0 @@ -# Default configuration for arm-linux-user diff --git a/default-configs/armeb-linux-user.mak b/default-configs/armeb-linux-user.mak deleted file mode 100644 index bf2ffe7038..0000000000 --- a/default-configs/armeb-linux-user.mak +++ /dev/null @@ -1 +0,0 @@ -# Default configuration for armeb-linux-user diff --git a/default-configs/cris-linux-user.mak b/default-configs/cris-linux-user.mak deleted file mode 100644 index e3aec7b864..0000000000 --- a/default-configs/cris-linux-user.mak +++ /dev/null @@ -1 +0,0 @@ -# Default configuration for cris-linux-user diff --git a/default-configs/aarch64-softmmu.mak b/default-configs/devices/aarch64-softmmu.mak similarity index 100% rename from default-configs/aarch64-softmmu.mak rename to default-configs/devices/aarch64-softmmu.mak diff --git a/default-configs/alpha-softmmu.mak b/default-configs/devices/alpha-softmmu.mak similarity index 100% rename from default-configs/alpha-softmmu.mak rename to default-configs/devices/alpha-softmmu.mak diff --git a/default-configs/arm-softmmu.mak b/default-configs/devices/arm-softmmu.mak similarity index 100% rename from default-configs/arm-softmmu.mak rename to default-configs/devices/arm-softmmu.mak diff --git a/default-configs/avr-softmmu.mak b/default-configs/devices/avr-softmmu.mak similarity index 100% rename from default-configs/avr-softmmu.mak rename to default-configs/devices/avr-softmmu.mak diff --git a/default-configs/cris-softmmu.mak b/default-configs/devices/cris-softmmu.mak similarity index 100% rename from default-configs/cris-softmmu.mak rename to default-configs/devices/cris-softmmu.mak diff --git a/default-configs/hppa-softmmu.mak b/default-configs/devices/hppa-softmmu.mak similarity index 100% rename from default-configs/hppa-softmmu.mak rename to default-configs/devices/hppa-softmmu.mak diff --git a/default-configs/i386-softmmu.mak b/default-configs/devices/i386-softmmu.mak similarity index 100% rename from default-configs/i386-softmmu.mak rename to default-configs/devices/i386-softmmu.mak diff --git a/default-configs/lm32-softmmu.mak b/default-configs/devices/lm32-softmmu.mak similarity index 100% rename from default-configs/lm32-softmmu.mak rename to default-configs/devices/lm32-softmmu.mak diff --git a/default-configs/m68k-softmmu.mak b/default-configs/devices/m68k-softmmu.mak similarity index 100% rename from default-configs/m68k-softmmu.mak rename to default-configs/devices/m68k-softmmu.mak diff --git a/default-configs/microblaze-softmmu.mak b/default-configs/devices/microblaze-softmmu.mak similarity index 100% rename from default-configs/microblaze-softmmu.mak rename to default-configs/devices/microblaze-softmmu.mak diff --git a/default-configs/microblazeel-softmmu.mak b/default-configs/devices/microblazeel-softmmu.mak similarity index 100% rename from default-configs/microblazeel-softmmu.mak rename to default-configs/devices/microblazeel-softmmu.mak diff --git a/default-configs/mips-softmmu-common.mak b/default-configs/devices/mips-softmmu-common.mak similarity index 100% rename from default-configs/mips-softmmu-common.mak rename to default-configs/devices/mips-softmmu-common.mak diff --git a/default-configs/mips-softmmu.mak b/default-configs/devices/mips-softmmu.mak similarity index 100% rename from default-configs/mips-softmmu.mak rename to default-configs/devices/mips-softmmu.mak diff --git a/default-configs/mips64-softmmu.mak b/default-configs/devices/mips64-softmmu.mak similarity index 100% rename from default-configs/mips64-softmmu.mak rename to default-configs/devices/mips64-softmmu.mak diff --git a/default-configs/mips64el-softmmu.mak b/default-configs/devices/mips64el-softmmu.mak similarity index 100% rename from default-configs/mips64el-softmmu.mak rename to default-configs/devices/mips64el-softmmu.mak diff --git a/default-configs/mipsel-softmmu.mak b/default-configs/devices/mipsel-softmmu.mak similarity index 100% rename from default-configs/mipsel-softmmu.mak rename to default-configs/devices/mipsel-softmmu.mak diff --git a/default-configs/moxie-softmmu.mak b/default-configs/devices/moxie-softmmu.mak similarity index 100% rename from default-configs/moxie-softmmu.mak rename to default-configs/devices/moxie-softmmu.mak diff --git a/default-configs/nios2-softmmu.mak b/default-configs/devices/nios2-softmmu.mak similarity index 100% rename from default-configs/nios2-softmmu.mak rename to default-configs/devices/nios2-softmmu.mak diff --git a/default-configs/or1k-softmmu.mak b/default-configs/devices/or1k-softmmu.mak similarity index 100% rename from default-configs/or1k-softmmu.mak rename to default-configs/devices/or1k-softmmu.mak diff --git a/default-configs/ppc-softmmu.mak b/default-configs/devices/ppc-softmmu.mak similarity index 100% rename from default-configs/ppc-softmmu.mak rename to default-configs/devices/ppc-softmmu.mak diff --git a/default-configs/ppc64-softmmu.mak b/default-configs/devices/ppc64-softmmu.mak similarity index 100% rename from default-configs/ppc64-softmmu.mak rename to default-configs/devices/ppc64-softmmu.mak diff --git a/default-configs/riscv32-softmmu.mak b/default-configs/devices/riscv32-softmmu.mak similarity index 100% rename from default-configs/riscv32-softmmu.mak rename to default-configs/devices/riscv32-softmmu.mak diff --git a/default-configs/riscv64-softmmu.mak b/default-configs/devices/riscv64-softmmu.mak similarity index 100% rename from default-configs/riscv64-softmmu.mak rename to default-configs/devices/riscv64-softmmu.mak diff --git a/default-configs/rx-softmmu.mak b/default-configs/devices/rx-softmmu.mak similarity index 100% rename from default-configs/rx-softmmu.mak rename to default-configs/devices/rx-softmmu.mak diff --git a/default-configs/s390x-softmmu.mak b/default-configs/devices/s390x-softmmu.mak similarity index 100% rename from default-configs/s390x-softmmu.mak rename to default-configs/devices/s390x-softmmu.mak diff --git a/default-configs/sh4-softmmu.mak b/default-configs/devices/sh4-softmmu.mak similarity index 100% rename from default-configs/sh4-softmmu.mak rename to default-configs/devices/sh4-softmmu.mak diff --git a/default-configs/sh4eb-softmmu.mak b/default-configs/devices/sh4eb-softmmu.mak similarity index 100% rename from default-configs/sh4eb-softmmu.mak rename to default-configs/devices/sh4eb-softmmu.mak diff --git a/default-configs/sparc-softmmu.mak b/default-configs/devices/sparc-softmmu.mak similarity index 100% rename from default-configs/sparc-softmmu.mak rename to default-configs/devices/sparc-softmmu.mak diff --git a/default-configs/sparc64-softmmu.mak b/default-configs/devices/sparc64-softmmu.mak similarity index 100% rename from default-configs/sparc64-softmmu.mak rename to default-configs/devices/sparc64-softmmu.mak diff --git a/default-configs/tricore-softmmu.mak b/default-configs/devices/tricore-softmmu.mak similarity index 100% rename from default-configs/tricore-softmmu.mak rename to default-configs/devices/tricore-softmmu.mak diff --git a/default-configs/unicore32-softmmu.mak b/default-configs/devices/unicore32-softmmu.mak similarity index 100% rename from default-configs/unicore32-softmmu.mak rename to default-configs/devices/unicore32-softmmu.mak diff --git a/default-configs/x86_64-softmmu.mak b/default-configs/devices/x86_64-softmmu.mak similarity index 100% rename from default-configs/x86_64-softmmu.mak rename to default-configs/devices/x86_64-softmmu.mak diff --git a/default-configs/xtensa-softmmu.mak b/default-configs/devices/xtensa-softmmu.mak similarity index 100% rename from default-configs/xtensa-softmmu.mak rename to default-configs/devices/xtensa-softmmu.mak diff --git a/default-configs/xtensaeb-softmmu.mak b/default-configs/devices/xtensaeb-softmmu.mak similarity index 100% rename from default-configs/xtensaeb-softmmu.mak rename to default-configs/devices/xtensaeb-softmmu.mak diff --git a/default-configs/hppa-linux-user.mak b/default-configs/hppa-linux-user.mak deleted file mode 100644 index 796393940b..0000000000 --- a/default-configs/hppa-linux-user.mak +++ /dev/null @@ -1 +0,0 @@ -# Default configuration for hppa-linux-user diff --git a/default-configs/i386-bsd-user.mak b/default-configs/i386-bsd-user.mak deleted file mode 100644 index af1b31a59a..0000000000 --- a/default-configs/i386-bsd-user.mak +++ /dev/null @@ -1 +0,0 @@ -# Default configuration for i386-bsd-user diff --git a/default-configs/i386-linux-user.mak b/default-configs/i386-linux-user.mak deleted file mode 100644 index 8657e68627..0000000000 --- a/default-configs/i386-linux-user.mak +++ /dev/null @@ -1 +0,0 @@ -# Default configuration for i386-linux-user diff --git a/default-configs/m68k-linux-user.mak b/default-configs/m68k-linux-user.mak deleted file mode 100644 index 06cd5ed7ed..0000000000 --- a/default-configs/m68k-linux-user.mak +++ /dev/null @@ -1 +0,0 @@ -# Default configuration for m68k-linux-user diff --git a/default-configs/microblaze-linux-user.mak b/default-configs/microblaze-linux-user.mak deleted file mode 100644 index 566fdc01c4..0000000000 --- a/default-configs/microblaze-linux-user.mak +++ /dev/null @@ -1 +0,0 @@ -# Default configuration for microblaze-linux-user diff --git a/default-configs/microblazeel-linux-user.mak b/default-configs/microblazeel-linux-user.mak deleted file mode 100644 index 378c6ddcb0..0000000000 --- a/default-configs/microblazeel-linux-user.mak +++ /dev/null @@ -1 +0,0 @@ -# Default configuration for microblazeel-linux-user diff --git a/default-configs/mips-linux-user.mak b/default-configs/mips-linux-user.mak deleted file mode 100644 index 31df57021e..0000000000 --- a/default-configs/mips-linux-user.mak +++ /dev/null @@ -1 +0,0 @@ -# Default configuration for mips-linux-user diff --git a/default-configs/mips64-linux-user.mak b/default-configs/mips64-linux-user.mak deleted file mode 100644 index 1598bfcf7d..0000000000 --- a/default-configs/mips64-linux-user.mak +++ /dev/null @@ -1 +0,0 @@ -# Default configuration for mips64-linux-user diff --git a/default-configs/mips64el-linux-user.mak b/default-configs/mips64el-linux-user.mak deleted file mode 100644 index 629f084086..0000000000 --- a/default-configs/mips64el-linux-user.mak +++ /dev/null @@ -1 +0,0 @@ -# Default configuration for mips64el-linux-user diff --git a/default-configs/mipsel-linux-user.mak b/default-configs/mipsel-linux-user.mak deleted file mode 100644 index 4d0e4afb69..0000000000 --- a/default-configs/mipsel-linux-user.mak +++ /dev/null @@ -1 +0,0 @@ -# Default configuration for mipsel-linux-user diff --git a/default-configs/mipsn32-linux-user.mak b/default-configs/mipsn32-linux-user.mak deleted file mode 100644 index 5b97919794..0000000000 --- a/default-configs/mipsn32-linux-user.mak +++ /dev/null @@ -1 +0,0 @@ -# Default configuration for mipsn32-linux-user diff --git a/default-configs/mipsn32el-linux-user.mak b/default-configs/mipsn32el-linux-user.mak deleted file mode 100644 index d6367ff987..0000000000 --- a/default-configs/mipsn32el-linux-user.mak +++ /dev/null @@ -1 +0,0 @@ -# Default configuration for mipsn32el-linux-user diff --git a/default-configs/nios2-linux-user.mak b/default-configs/nios2-linux-user.mak deleted file mode 100644 index 5be3eb795d..0000000000 --- a/default-configs/nios2-linux-user.mak +++ /dev/null @@ -1 +0,0 @@ -# Default configuration for nios2-linux-user diff --git a/default-configs/or1k-linux-user.mak b/default-configs/or1k-linux-user.mak deleted file mode 100644 index 20e03c1317..0000000000 --- a/default-configs/or1k-linux-user.mak +++ /dev/null @@ -1 +0,0 @@ -# Default configuration for or1k-linux-user diff --git a/default-configs/ppc-linux-user.mak b/default-configs/ppc-linux-user.mak deleted file mode 100644 index 6273df2930..0000000000 --- a/default-configs/ppc-linux-user.mak +++ /dev/null @@ -1 +0,0 @@ -# Default configuration for ppc-linux-user diff --git a/default-configs/ppc64-linux-user.mak b/default-configs/ppc64-linux-user.mak deleted file mode 100644 index 422d3fbaeb..0000000000 --- a/default-configs/ppc64-linux-user.mak +++ /dev/null @@ -1 +0,0 @@ -# Default configuration for ppc64-linux-user diff --git a/default-configs/ppc64abi32-linux-user.mak b/default-configs/ppc64abi32-linux-user.mak deleted file mode 100644 index 1c657ec9bb..0000000000 --- a/default-configs/ppc64abi32-linux-user.mak +++ /dev/null @@ -1 +0,0 @@ -# Default configuration for ppc64abi32-linux-user diff --git a/default-configs/ppc64le-linux-user.mak b/default-configs/ppc64le-linux-user.mak deleted file mode 100644 index 63f4269023..0000000000 --- a/default-configs/ppc64le-linux-user.mak +++ /dev/null @@ -1 +0,0 @@ -# Default configuration for ppc64le-linux-user diff --git a/default-configs/riscv32-linux-user.mak b/default-configs/riscv32-linux-user.mak deleted file mode 100644 index 865b362f5a..0000000000 --- a/default-configs/riscv32-linux-user.mak +++ /dev/null @@ -1 +0,0 @@ -# Default configuration for riscv-linux-user diff --git a/default-configs/riscv64-linux-user.mak b/default-configs/riscv64-linux-user.mak deleted file mode 100644 index 865b362f5a..0000000000 --- a/default-configs/riscv64-linux-user.mak +++ /dev/null @@ -1 +0,0 @@ -# Default configuration for riscv-linux-user diff --git a/default-configs/s390x-linux-user.mak b/default-configs/s390x-linux-user.mak deleted file mode 100644 index a243c99874..0000000000 --- a/default-configs/s390x-linux-user.mak +++ /dev/null @@ -1 +0,0 @@ -# Default configuration for s390x-linux-user diff --git a/default-configs/sh4-linux-user.mak b/default-configs/sh4-linux-user.mak deleted file mode 100644 index a469e19ac6..0000000000 --- a/default-configs/sh4-linux-user.mak +++ /dev/null @@ -1 +0,0 @@ -# Default configuration for sh4-linux-user diff --git a/default-configs/sh4eb-linux-user.mak b/default-configs/sh4eb-linux-user.mak deleted file mode 100644 index be08ca1002..0000000000 --- a/default-configs/sh4eb-linux-user.mak +++ /dev/null @@ -1 +0,0 @@ -# Default configuration for sh4eb-linux-user diff --git a/default-configs/sparc-bsd-user.mak b/default-configs/sparc-bsd-user.mak deleted file mode 100644 index 21e09508d8..0000000000 --- a/default-configs/sparc-bsd-user.mak +++ /dev/null @@ -1 +0,0 @@ -# Default configuration for sparc-bsd-user diff --git a/default-configs/sparc-linux-user.mak b/default-configs/sparc-linux-user.mak deleted file mode 100644 index 9c716d1f92..0000000000 --- a/default-configs/sparc-linux-user.mak +++ /dev/null @@ -1 +0,0 @@ -# Default configuration for sparc-linux-user diff --git a/default-configs/sparc32plus-linux-user.mak b/default-configs/sparc32plus-linux-user.mak deleted file mode 100644 index 432e88011e..0000000000 --- a/default-configs/sparc32plus-linux-user.mak +++ /dev/null @@ -1 +0,0 @@ -# Default configuration for sparc32plus-linux-user diff --git a/default-configs/sparc64-bsd-user.mak b/default-configs/sparc64-bsd-user.mak deleted file mode 100644 index b8b9eea7f6..0000000000 --- a/default-configs/sparc64-bsd-user.mak +++ /dev/null @@ -1 +0,0 @@ -# Default configuration for sparc64-bsd-user diff --git a/default-configs/sparc64-linux-user.mak b/default-configs/sparc64-linux-user.mak deleted file mode 100644 index bf1bdd6aa4..0000000000 --- a/default-configs/sparc64-linux-user.mak +++ /dev/null @@ -1 +0,0 @@ -# Default configuration for sparc64-linux-user diff --git a/default-configs/targets/aarch64-linux-user.mak b/default-configs/targets/aarch64-linux-user.mak new file mode 100644 index 0000000000..163c9209f4 --- /dev/null +++ b/default-configs/targets/aarch64-linux-user.mak @@ -0,0 +1,4 @@ +TARGET_ARCH=aarch64 +TARGET_BASE_ARCH=arm +TARGET_XML_FILES= gdb-xml/aarch64-core.xml gdb-xml/aarch64-fpu.xml gdb-xml/arm-core.xml gdb-xml/arm-vfp.xml gdb-xml/arm-vfp3.xml gdb-xml/arm-neon.xml gdb-xml/arm-m-profile.xml +TARGET_HAS_BFLT=y diff --git a/default-configs/targets/aarch64-softmmu.mak b/default-configs/targets/aarch64-softmmu.mak new file mode 100644 index 0000000000..a8c0174fc3 --- /dev/null +++ b/default-configs/targets/aarch64-softmmu.mak @@ -0,0 +1,4 @@ +TARGET_ARCH=aarch64 +TARGET_BASE_ARCH=arm +TARGET_SUPPORTS_MTTCG=y +TARGET_XML_FILES= gdb-xml/aarch64-core.xml gdb-xml/aarch64-fpu.xml gdb-xml/arm-core.xml gdb-xml/arm-vfp.xml gdb-xml/arm-vfp3.xml gdb-xml/arm-neon.xml gdb-xml/arm-m-profile.xml diff --git a/default-configs/targets/aarch64_be-linux-user.mak b/default-configs/targets/aarch64_be-linux-user.mak new file mode 100644 index 0000000000..4c953cf8c5 --- /dev/null +++ b/default-configs/targets/aarch64_be-linux-user.mak @@ -0,0 +1,5 @@ +TARGET_ARCH=aarch64 +TARGET_BASE_ARCH=arm +TARGET_WORDS_BIGENDIAN=y +TARGET_XML_FILES= gdb-xml/aarch64-core.xml gdb-xml/aarch64-fpu.xml gdb-xml/arm-core.xml gdb-xml/arm-vfp.xml gdb-xml/arm-vfp3.xml gdb-xml/arm-neon.xml gdb-xml/arm-m-profile.xml +TARGET_HAS_BFLT=y diff --git a/default-configs/targets/alpha-linux-user.mak b/default-configs/targets/alpha-linux-user.mak new file mode 100644 index 0000000000..7e62fd796a --- /dev/null +++ b/default-configs/targets/alpha-linux-user.mak @@ -0,0 +1,4 @@ +TARGET_ARCH=alpha +TARGET_SYSTBL_ABI=common +TARGET_SYSTBL=syscall.tbl +TARGET_ALIGNED_ONLY=y diff --git a/default-configs/targets/alpha-softmmu.mak b/default-configs/targets/alpha-softmmu.mak new file mode 100644 index 0000000000..e4b874a19e --- /dev/null +++ b/default-configs/targets/alpha-softmmu.mak @@ -0,0 +1,3 @@ +TARGET_ARCH=alpha +TARGET_ALIGNED_ONLY=y +TARGET_SUPPORTS_MTTCG=y diff --git a/default-configs/targets/arm-linux-user.mak b/default-configs/targets/arm-linux-user.mak new file mode 100644 index 0000000000..c7cd872e86 --- /dev/null +++ b/default-configs/targets/arm-linux-user.mak @@ -0,0 +1,5 @@ +TARGET_ARCH=arm +TARGET_SYSTBL_ABI=common,oabi +TARGET_SYSTBL=syscall.tbl +TARGET_XML_FILES= gdb-xml/arm-core.xml gdb-xml/arm-vfp.xml gdb-xml/arm-vfp3.xml gdb-xml/arm-neon.xml gdb-xml/arm-m-profile.xml +TARGET_HAS_BFLT=y diff --git a/default-configs/targets/arm-softmmu.mak b/default-configs/targets/arm-softmmu.mak new file mode 100644 index 0000000000..9b1a7f37c6 --- /dev/null +++ b/default-configs/targets/arm-softmmu.mak @@ -0,0 +1,3 @@ +TARGET_ARCH=arm +TARGET_SUPPORTS_MTTCG=y +TARGET_XML_FILES= gdb-xml/arm-core.xml gdb-xml/arm-vfp.xml gdb-xml/arm-vfp3.xml gdb-xml/arm-neon.xml gdb-xml/arm-m-profile.xml diff --git a/default-configs/targets/armeb-linux-user.mak b/default-configs/targets/armeb-linux-user.mak new file mode 100644 index 0000000000..79bf10e99b --- /dev/null +++ b/default-configs/targets/armeb-linux-user.mak @@ -0,0 +1,6 @@ +TARGET_ARCH=arm +TARGET_SYSTBL_ABI=common,oabi +TARGET_SYSTBL=syscall.tbl +TARGET_WORDS_BIGENDIAN=y +TARGET_XML_FILES= gdb-xml/arm-core.xml gdb-xml/arm-vfp.xml gdb-xml/arm-vfp3.xml gdb-xml/arm-neon.xml gdb-xml/arm-m-profile.xml +TARGET_HAS_BFLT=y diff --git a/default-configs/targets/avr-softmmu.mak b/default-configs/targets/avr-softmmu.mak new file mode 100644 index 0000000000..e3f921c019 --- /dev/null +++ b/default-configs/targets/avr-softmmu.mak @@ -0,0 +1,2 @@ +TARGET_ARCH=avr +TARGET_XML_FILES= gdb-xml/avr-cpu.xml diff --git a/default-configs/targets/cris-linux-user.mak b/default-configs/targets/cris-linux-user.mak new file mode 100644 index 0000000000..e483c42066 --- /dev/null +++ b/default-configs/targets/cris-linux-user.mak @@ -0,0 +1 @@ +TARGET_ARCH=cris diff --git a/default-configs/targets/cris-softmmu.mak b/default-configs/targets/cris-softmmu.mak new file mode 100644 index 0000000000..e483c42066 --- /dev/null +++ b/default-configs/targets/cris-softmmu.mak @@ -0,0 +1 @@ +TARGET_ARCH=cris diff --git a/default-configs/targets/hppa-linux-user.mak b/default-configs/targets/hppa-linux-user.mak new file mode 100644 index 0000000000..f01e0a7b9e --- /dev/null +++ b/default-configs/targets/hppa-linux-user.mak @@ -0,0 +1,5 @@ +TARGET_ARCH=hppa +TARGET_SYSTBL_ABI=common,32 +TARGET_SYSTBL=syscall.tbl +TARGET_ALIGNED_ONLY=y +TARGET_WORDS_BIGENDIAN=y diff --git a/default-configs/targets/hppa-softmmu.mak b/default-configs/targets/hppa-softmmu.mak new file mode 100644 index 0000000000..e3e71eb21b --- /dev/null +++ b/default-configs/targets/hppa-softmmu.mak @@ -0,0 +1,4 @@ +TARGET_ARCH=hppa +TARGET_ALIGNED_ONLY=y +TARGET_WORDS_BIGENDIAN=y +TARGET_SUPPORTS_MTTCG=y diff --git a/default-configs/targets/i386-bsd-user.mak b/default-configs/targets/i386-bsd-user.mak new file mode 100644 index 0000000000..0283bb62a0 --- /dev/null +++ b/default-configs/targets/i386-bsd-user.mak @@ -0,0 +1,2 @@ +TARGET_ARCH=i386 +TARGET_XML_FILES= gdb-xml/i386-32bit.xml diff --git a/default-configs/targets/i386-linux-user.mak b/default-configs/targets/i386-linux-user.mak new file mode 100644 index 0000000000..5b2546a430 --- /dev/null +++ b/default-configs/targets/i386-linux-user.mak @@ -0,0 +1,4 @@ +TARGET_ARCH=i386 +TARGET_SYSTBL_ABI=i386 +TARGET_SYSTBL=syscall_32.tbl +TARGET_XML_FILES= gdb-xml/i386-32bit.xml diff --git a/default-configs/targets/i386-softmmu.mak b/default-configs/targets/i386-softmmu.mak new file mode 100644 index 0000000000..5babf71895 --- /dev/null +++ b/default-configs/targets/i386-softmmu.mak @@ -0,0 +1,3 @@ +TARGET_ARCH=i386 +TARGET_SUPPORTS_MTTCG=y +TARGET_XML_FILES= gdb-xml/i386-32bit.xml diff --git a/default-configs/targets/lm32-softmmu.mak b/default-configs/targets/lm32-softmmu.mak new file mode 100644 index 0000000000..55e7184a3d --- /dev/null +++ b/default-configs/targets/lm32-softmmu.mak @@ -0,0 +1,2 @@ +TARGET_ARCH=lm32 +TARGET_WORDS_BIGENDIAN=y diff --git a/default-configs/targets/m68k-linux-user.mak b/default-configs/targets/m68k-linux-user.mak new file mode 100644 index 0000000000..805d16c6ab --- /dev/null +++ b/default-configs/targets/m68k-linux-user.mak @@ -0,0 +1,6 @@ +TARGET_ARCH=m68k +TARGET_SYSTBL_ABI=common +TARGET_SYSTBL=syscall.tbl +TARGET_WORDS_BIGENDIAN=y +TARGET_XML_FILES= gdb-xml/cf-core.xml gdb-xml/cf-fp.xml gdb-xml/m68k-core.xml gdb-xml/m68k-fp.xml +TARGET_HAS_BFLT=y diff --git a/default-configs/targets/m68k-softmmu.mak b/default-configs/targets/m68k-softmmu.mak new file mode 100644 index 0000000000..5df1a2b7d7 --- /dev/null +++ b/default-configs/targets/m68k-softmmu.mak @@ -0,0 +1,3 @@ +TARGET_ARCH=m68k +TARGET_WORDS_BIGENDIAN=y +TARGET_XML_FILES= gdb-xml/cf-core.xml gdb-xml/cf-fp.xml gdb-xml/m68k-core.xml gdb-xml/m68k-fp.xml diff --git a/default-configs/targets/microblaze-linux-user.mak b/default-configs/targets/microblaze-linux-user.mak new file mode 100644 index 0000000000..2a25bf2fa3 --- /dev/null +++ b/default-configs/targets/microblaze-linux-user.mak @@ -0,0 +1,5 @@ +TARGET_ARCH=microblaze +TARGET_SYSTBL_ABI=common +TARGET_SYSTBL=syscall.tbl +TARGET_WORDS_BIGENDIAN=y +TARGET_HAS_BFLT=y diff --git a/default-configs/targets/microblaze-softmmu.mak b/default-configs/targets/microblaze-softmmu.mak new file mode 100644 index 0000000000..0b5c78ef00 --- /dev/null +++ b/default-configs/targets/microblaze-softmmu.mak @@ -0,0 +1,3 @@ +TARGET_ARCH=microblaze +TARGET_WORDS_BIGENDIAN=y +TARGET_SUPPORTS_MTTCG=y diff --git a/default-configs/targets/microblazeel-linux-user.mak b/default-configs/targets/microblazeel-linux-user.mak new file mode 100644 index 0000000000..d0e775d840 --- /dev/null +++ b/default-configs/targets/microblazeel-linux-user.mak @@ -0,0 +1,4 @@ +TARGET_ARCH=microblaze +TARGET_SYSTBL_ABI=common +TARGET_SYSTBL=syscall.tbl +TARGET_HAS_BFLT=y diff --git a/default-configs/targets/microblazeel-softmmu.mak b/default-configs/targets/microblazeel-softmmu.mak new file mode 100644 index 0000000000..dc822219d8 --- /dev/null +++ b/default-configs/targets/microblazeel-softmmu.mak @@ -0,0 +1,2 @@ +TARGET_ARCH=microblaze +TARGET_SUPPORTS_MTTCG=y diff --git a/default-configs/targets/mips-linux-user.mak b/default-configs/targets/mips-linux-user.mak new file mode 100644 index 0000000000..19f5779831 --- /dev/null +++ b/default-configs/targets/mips-linux-user.mak @@ -0,0 +1,6 @@ +TARGET_ARCH=mips +TARGET_ABI_MIPSO32=y +TARGET_SYSTBL_ABI=o32 +TARGET_SYSTBL=syscall_o32.tbl +TARGET_ALIGNED_ONLY=y +TARGET_WORDS_BIGENDIAN=y diff --git a/default-configs/targets/mips-softmmu.mak b/default-configs/targets/mips-softmmu.mak new file mode 100644 index 0000000000..8a49999a47 --- /dev/null +++ b/default-configs/targets/mips-softmmu.mak @@ -0,0 +1,4 @@ +TARGET_ARCH=mips +TARGET_ALIGNED_ONLY=y +TARGET_WORDS_BIGENDIAN=y +TARGET_SUPPORTS_MTTCG=y diff --git a/default-configs/targets/mips64-linux-user.mak b/default-configs/targets/mips64-linux-user.mak new file mode 100644 index 0000000000..32fd1acdf2 --- /dev/null +++ b/default-configs/targets/mips64-linux-user.mak @@ -0,0 +1,7 @@ +TARGET_ARCH=mips64 +TARGET_ABI_MIPSN64=y +TARGET_BASE_ARCH=mips +TARGET_SYSTBL_ABI=n64 +TARGET_SYSTBL=syscall_n64.tbl +TARGET_ALIGNED_ONLY=y +TARGET_WORDS_BIGENDIAN=y diff --git a/default-configs/targets/mips64-softmmu.mak b/default-configs/targets/mips64-softmmu.mak new file mode 100644 index 0000000000..ece25b9624 --- /dev/null +++ b/default-configs/targets/mips64-softmmu.mak @@ -0,0 +1,4 @@ +TARGET_ARCH=mips64 +TARGET_BASE_ARCH=mips +TARGET_ALIGNED_ONLY=y +TARGET_WORDS_BIGENDIAN=y diff --git a/default-configs/targets/mips64el-linux-user.mak b/default-configs/targets/mips64el-linux-user.mak new file mode 100644 index 0000000000..f348f35997 --- /dev/null +++ b/default-configs/targets/mips64el-linux-user.mak @@ -0,0 +1,6 @@ +TARGET_ARCH=mips64 +TARGET_ABI_MIPSN64=y +TARGET_BASE_ARCH=mips +TARGET_SYSTBL_ABI=n64 +TARGET_SYSTBL=syscall_n64.tbl +TARGET_ALIGNED_ONLY=y diff --git a/default-configs/targets/mips64el-softmmu.mak b/default-configs/targets/mips64el-softmmu.mak new file mode 100644 index 0000000000..b751ae1bcf --- /dev/null +++ b/default-configs/targets/mips64el-softmmu.mak @@ -0,0 +1,3 @@ +TARGET_ARCH=mips64 +TARGET_BASE_ARCH=mips +TARGET_ALIGNED_ONLY=y diff --git a/default-configs/targets/mipsel-linux-user.mak b/default-configs/targets/mipsel-linux-user.mak new file mode 100644 index 0000000000..e23793070c --- /dev/null +++ b/default-configs/targets/mipsel-linux-user.mak @@ -0,0 +1,5 @@ +TARGET_ARCH=mips +TARGET_ABI_MIPSO32=y +TARGET_SYSTBL_ABI=o32 +TARGET_SYSTBL=syscall_o32.tbl +TARGET_ALIGNED_ONLY=y diff --git a/default-configs/targets/mipsel-softmmu.mak b/default-configs/targets/mipsel-softmmu.mak new file mode 100644 index 0000000000..c7c41f4fb7 --- /dev/null +++ b/default-configs/targets/mipsel-softmmu.mak @@ -0,0 +1,3 @@ +TARGET_ARCH=mips +TARGET_ALIGNED_ONLY=y +TARGET_SUPPORTS_MTTCG=y diff --git a/default-configs/targets/mipsn32-linux-user.mak b/default-configs/targets/mipsn32-linux-user.mak new file mode 100644 index 0000000000..b8c2441ad0 --- /dev/null +++ b/default-configs/targets/mipsn32-linux-user.mak @@ -0,0 +1,8 @@ +TARGET_ARCH=mips64 +TARGET_ABI_MIPSN32=y +TARGET_ABI32=y +TARGET_BASE_ARCH=mips +TARGET_SYSTBL_ABI=n32 +TARGET_SYSTBL=syscall_n32.tbl +TARGET_ALIGNED_ONLY=y +TARGET_WORDS_BIGENDIAN=y diff --git a/default-configs/targets/mipsn32el-linux-user.mak b/default-configs/targets/mipsn32el-linux-user.mak new file mode 100644 index 0000000000..f31a9c394b --- /dev/null +++ b/default-configs/targets/mipsn32el-linux-user.mak @@ -0,0 +1,7 @@ +TARGET_ARCH=mips64 +TARGET_ABI_MIPSN32=y +TARGET_ABI32=y +TARGET_BASE_ARCH=mips +TARGET_SYSTBL_ABI=n32 +TARGET_SYSTBL=syscall_n32.tbl +TARGET_ALIGNED_ONLY=y diff --git a/default-configs/targets/moxie-softmmu.mak b/default-configs/targets/moxie-softmmu.mak new file mode 100644 index 0000000000..183e6b0ebd --- /dev/null +++ b/default-configs/targets/moxie-softmmu.mak @@ -0,0 +1,2 @@ +TARGET_ARCH=moxie +TARGET_WORDS_BIGENDIAN=y diff --git a/default-configs/targets/nios2-linux-user.mak b/default-configs/targets/nios2-linux-user.mak new file mode 100644 index 0000000000..9a372f0717 --- /dev/null +++ b/default-configs/targets/nios2-linux-user.mak @@ -0,0 +1 @@ +TARGET_ARCH=nios2 diff --git a/default-configs/targets/nios2-softmmu.mak b/default-configs/targets/nios2-softmmu.mak new file mode 100644 index 0000000000..9a372f0717 --- /dev/null +++ b/default-configs/targets/nios2-softmmu.mak @@ -0,0 +1 @@ +TARGET_ARCH=nios2 diff --git a/default-configs/targets/or1k-linux-user.mak b/default-configs/targets/or1k-linux-user.mak new file mode 100644 index 0000000000..1dfb93e46d --- /dev/null +++ b/default-configs/targets/or1k-linux-user.mak @@ -0,0 +1,2 @@ +TARGET_ARCH=openrisc +TARGET_WORDS_BIGENDIAN=y diff --git a/default-configs/targets/or1k-softmmu.mak b/default-configs/targets/or1k-softmmu.mak new file mode 100644 index 0000000000..1dfb93e46d --- /dev/null +++ b/default-configs/targets/or1k-softmmu.mak @@ -0,0 +1,2 @@ +TARGET_ARCH=openrisc +TARGET_WORDS_BIGENDIAN=y diff --git a/default-configs/targets/ppc-linux-user.mak b/default-configs/targets/ppc-linux-user.mak new file mode 100644 index 0000000000..ca4187e4aa --- /dev/null +++ b/default-configs/targets/ppc-linux-user.mak @@ -0,0 +1,5 @@ +TARGET_ARCH=ppc +TARGET_SYSTBL_ABI=common,nospu,32 +TARGET_SYSTBL=syscall.tbl +TARGET_WORDS_BIGENDIAN=y +TARGET_XML_FILES= gdb-xml/power-core.xml gdb-xml/power-fpu.xml gdb-xml/power-altivec.xml gdb-xml/power-spe.xml diff --git a/default-configs/targets/ppc-softmmu.mak b/default-configs/targets/ppc-softmmu.mak new file mode 100644 index 0000000000..ef69037a2c --- /dev/null +++ b/default-configs/targets/ppc-softmmu.mak @@ -0,0 +1,3 @@ +TARGET_ARCH=ppc +TARGET_WORDS_BIGENDIAN=y +TARGET_XML_FILES= gdb-xml/power-core.xml gdb-xml/power-fpu.xml gdb-xml/power-altivec.xml gdb-xml/power-spe.xml diff --git a/default-configs/targets/ppc64-linux-user.mak b/default-configs/targets/ppc64-linux-user.mak new file mode 100644 index 0000000000..3133346676 --- /dev/null +++ b/default-configs/targets/ppc64-linux-user.mak @@ -0,0 +1,7 @@ +TARGET_ARCH=ppc64 +TARGET_BASE_ARCH=ppc +TARGET_ABI_DIR=ppc +TARGET_SYSTBL_ABI=common,nospu,64 +TARGET_SYSTBL=syscall.tbl +TARGET_WORDS_BIGENDIAN=y +TARGET_XML_FILES= gdb-xml/power64-core.xml gdb-xml/power-fpu.xml gdb-xml/power-altivec.xml gdb-xml/power-spe.xml gdb-xml/power-vsx.xml diff --git a/default-configs/targets/ppc64-softmmu.mak b/default-configs/targets/ppc64-softmmu.mak new file mode 100644 index 0000000000..0fde2d02b9 --- /dev/null +++ b/default-configs/targets/ppc64-softmmu.mak @@ -0,0 +1,5 @@ +TARGET_ARCH=ppc64 +TARGET_BASE_ARCH=ppc +TARGET_WORDS_BIGENDIAN=y +TARGET_SUPPORTS_MTTCG=y +TARGET_XML_FILES= gdb-xml/power64-core.xml gdb-xml/power-fpu.xml gdb-xml/power-altivec.xml gdb-xml/power-spe.xml gdb-xml/power-vsx.xml diff --git a/default-configs/targets/ppc64abi32-linux-user.mak b/default-configs/targets/ppc64abi32-linux-user.mak new file mode 100644 index 0000000000..0945451081 --- /dev/null +++ b/default-configs/targets/ppc64abi32-linux-user.mak @@ -0,0 +1,8 @@ +TARGET_ARCH=ppc64 +TARGET_ABI32=y +TARGET_BASE_ARCH=ppc +TARGET_ABI_DIR=ppc +TARGET_SYSTBL_ABI=common,nospu,32 +TARGET_SYSTBL=syscall.tbl +TARGET_WORDS_BIGENDIAN=y +TARGET_XML_FILES= gdb-xml/power64-core.xml gdb-xml/power-fpu.xml gdb-xml/power-altivec.xml gdb-xml/power-spe.xml gdb-xml/power-vsx.xml diff --git a/default-configs/targets/ppc64le-linux-user.mak b/default-configs/targets/ppc64le-linux-user.mak new file mode 100644 index 0000000000..426d5a28d6 --- /dev/null +++ b/default-configs/targets/ppc64le-linux-user.mak @@ -0,0 +1,6 @@ +TARGET_ARCH=ppc64 +TARGET_BASE_ARCH=ppc +TARGET_ABI_DIR=ppc +TARGET_SYSTBL_ABI=common,nospu,64 +TARGET_SYSTBL=syscall.tbl +TARGET_XML_FILES= gdb-xml/power64-core.xml gdb-xml/power-fpu.xml gdb-xml/power-altivec.xml gdb-xml/power-spe.xml gdb-xml/power-vsx.xml diff --git a/default-configs/targets/riscv32-linux-user.mak b/default-configs/targets/riscv32-linux-user.mak new file mode 100644 index 0000000000..dfb259e8aa --- /dev/null +++ b/default-configs/targets/riscv32-linux-user.mak @@ -0,0 +1,4 @@ +TARGET_ARCH=riscv32 +TARGET_BASE_ARCH=riscv +TARGET_ABI_DIR=riscv +TARGET_XML_FILES= gdb-xml/riscv-32bit-cpu.xml gdb-xml/riscv-32bit-fpu.xml gdb-xml/riscv-64bit-fpu.xml gdb-xml/riscv-32bit-csr.xml gdb-xml/riscv-32bit-virtual.xml diff --git a/default-configs/targets/riscv32-softmmu.mak b/default-configs/targets/riscv32-softmmu.mak new file mode 100644 index 0000000000..4544e1ae9a --- /dev/null +++ b/default-configs/targets/riscv32-softmmu.mak @@ -0,0 +1,4 @@ +TARGET_ARCH=riscv32 +TARGET_BASE_ARCH=riscv +TARGET_SUPPORTS_MTTCG=y +TARGET_XML_FILES= gdb-xml/riscv-32bit-cpu.xml gdb-xml/riscv-32bit-fpu.xml gdb-xml/riscv-64bit-fpu.xml gdb-xml/riscv-32bit-csr.xml gdb-xml/riscv-32bit-virtual.xml diff --git a/default-configs/targets/riscv64-linux-user.mak b/default-configs/targets/riscv64-linux-user.mak new file mode 100644 index 0000000000..b13895f3b0 --- /dev/null +++ b/default-configs/targets/riscv64-linux-user.mak @@ -0,0 +1,4 @@ +TARGET_ARCH=riscv64 +TARGET_BASE_ARCH=riscv +TARGET_ABI_DIR=riscv +TARGET_XML_FILES= gdb-xml/riscv-64bit-cpu.xml gdb-xml/riscv-32bit-fpu.xml gdb-xml/riscv-64bit-fpu.xml gdb-xml/riscv-64bit-csr.xml gdb-xml/riscv-64bit-virtual.xml diff --git a/default-configs/targets/riscv64-softmmu.mak b/default-configs/targets/riscv64-softmmu.mak new file mode 100644 index 0000000000..6ce0b283cf --- /dev/null +++ b/default-configs/targets/riscv64-softmmu.mak @@ -0,0 +1,4 @@ +TARGET_ARCH=riscv64 +TARGET_BASE_ARCH=riscv +TARGET_SUPPORTS_MTTCG=y +TARGET_XML_FILES= gdb-xml/riscv-64bit-cpu.xml gdb-xml/riscv-32bit-fpu.xml gdb-xml/riscv-64bit-fpu.xml gdb-xml/riscv-64bit-csr.xml gdb-xml/riscv-64bit-virtual.xml diff --git a/default-configs/targets/rx-softmmu.mak b/default-configs/targets/rx-softmmu.mak new file mode 100644 index 0000000000..2d410e0b0c --- /dev/null +++ b/default-configs/targets/rx-softmmu.mak @@ -0,0 +1,2 @@ +TARGET_ARCH=rx +TARGET_XML_FILES= gdb-xml/rx-core.xml diff --git a/default-configs/targets/s390x-linux-user.mak b/default-configs/targets/s390x-linux-user.mak new file mode 100644 index 0000000000..9e31ce6457 --- /dev/null +++ b/default-configs/targets/s390x-linux-user.mak @@ -0,0 +1,5 @@ +TARGET_ARCH=s390x +TARGET_SYSTBL_ABI=common,64 +TARGET_SYSTBL=syscall.tbl +TARGET_WORDS_BIGENDIAN=y +TARGET_XML_FILES= gdb-xml/s390x-core64.xml gdb-xml/s390-acr.xml gdb-xml/s390-fpr.xml gdb-xml/s390-vx.xml gdb-xml/s390-cr.xml gdb-xml/s390-virt.xml gdb-xml/s390-gs.xml diff --git a/default-configs/targets/s390x-softmmu.mak b/default-configs/targets/s390x-softmmu.mak new file mode 100644 index 0000000000..fd9fbd870d --- /dev/null +++ b/default-configs/targets/s390x-softmmu.mak @@ -0,0 +1,4 @@ +TARGET_ARCH=s390x +TARGET_WORDS_BIGENDIAN=y +TARGET_SUPPORTS_MTTCG=y +TARGET_XML_FILES= gdb-xml/s390x-core64.xml gdb-xml/s390-acr.xml gdb-xml/s390-fpr.xml gdb-xml/s390-vx.xml gdb-xml/s390-cr.xml gdb-xml/s390-virt.xml gdb-xml/s390-gs.xml diff --git a/default-configs/targets/sh4-linux-user.mak b/default-configs/targets/sh4-linux-user.mak new file mode 100644 index 0000000000..0152d6621e --- /dev/null +++ b/default-configs/targets/sh4-linux-user.mak @@ -0,0 +1,5 @@ +TARGET_ARCH=sh4 +TARGET_SYSTBL_ABI=common +TARGET_SYSTBL=syscall.tbl +TARGET_ALIGNED_ONLY=y +TARGET_HAS_BFLT=y diff --git a/default-configs/targets/sh4-softmmu.mak b/default-configs/targets/sh4-softmmu.mak new file mode 100644 index 0000000000..95896376c4 --- /dev/null +++ b/default-configs/targets/sh4-softmmu.mak @@ -0,0 +1,2 @@ +TARGET_ARCH=sh4 +TARGET_ALIGNED_ONLY=y diff --git a/default-configs/targets/sh4eb-linux-user.mak b/default-configs/targets/sh4eb-linux-user.mak new file mode 100644 index 0000000000..9b6fb4c1bb --- /dev/null +++ b/default-configs/targets/sh4eb-linux-user.mak @@ -0,0 +1,6 @@ +TARGET_ARCH=sh4 +TARGET_SYSTBL_ABI=common +TARGET_SYSTBL=syscall.tbl +TARGET_ALIGNED_ONLY=y +TARGET_WORDS_BIGENDIAN=y +TARGET_HAS_BFLT=y diff --git a/default-configs/targets/sh4eb-softmmu.mak b/default-configs/targets/sh4eb-softmmu.mak new file mode 100644 index 0000000000..382e9a80f8 --- /dev/null +++ b/default-configs/targets/sh4eb-softmmu.mak @@ -0,0 +1,3 @@ +TARGET_ARCH=sh4 +TARGET_ALIGNED_ONLY=y +TARGET_WORDS_BIGENDIAN=y diff --git a/default-configs/targets/sparc-bsd-user.mak b/default-configs/targets/sparc-bsd-user.mak new file mode 100644 index 0000000000..9ba3d7b07f --- /dev/null +++ b/default-configs/targets/sparc-bsd-user.mak @@ -0,0 +1,3 @@ +TARGET_ARCH=sparc +TARGET_ALIGNED_ONLY=y +TARGET_WORDS_BIGENDIAN=y diff --git a/default-configs/targets/sparc-linux-user.mak b/default-configs/targets/sparc-linux-user.mak new file mode 100644 index 0000000000..53dc7aaed5 --- /dev/null +++ b/default-configs/targets/sparc-linux-user.mak @@ -0,0 +1,5 @@ +TARGET_ARCH=sparc +TARGET_SYSTBL_ABI=common,32 +TARGET_SYSTBL=syscall.tbl +TARGET_ALIGNED_ONLY=y +TARGET_WORDS_BIGENDIAN=y diff --git a/default-configs/targets/sparc-softmmu.mak b/default-configs/targets/sparc-softmmu.mak new file mode 100644 index 0000000000..9ba3d7b07f --- /dev/null +++ b/default-configs/targets/sparc-softmmu.mak @@ -0,0 +1,3 @@ +TARGET_ARCH=sparc +TARGET_ALIGNED_ONLY=y +TARGET_WORDS_BIGENDIAN=y diff --git a/default-configs/targets/sparc32plus-linux-user.mak b/default-configs/targets/sparc32plus-linux-user.mak new file mode 100644 index 0000000000..e4c51df3dc --- /dev/null +++ b/default-configs/targets/sparc32plus-linux-user.mak @@ -0,0 +1,8 @@ +TARGET_ARCH=sparc64 +TARGET_ABI32=y +TARGET_BASE_ARCH=sparc +TARGET_ABI_DIR=sparc +TARGET_SYSTBL_ABI=common,32 +TARGET_SYSTBL=syscall.tbl +TARGET_ALIGNED_ONLY=y +TARGET_WORDS_BIGENDIAN=y diff --git a/default-configs/targets/sparc64-bsd-user.mak b/default-configs/targets/sparc64-bsd-user.mak new file mode 100644 index 0000000000..8dd3217800 --- /dev/null +++ b/default-configs/targets/sparc64-bsd-user.mak @@ -0,0 +1,4 @@ +TARGET_ARCH=sparc64 +TARGET_BASE_ARCH=sparc +TARGET_ALIGNED_ONLY=y +TARGET_WORDS_BIGENDIAN=y diff --git a/default-configs/targets/sparc64-linux-user.mak b/default-configs/targets/sparc64-linux-user.mak new file mode 100644 index 0000000000..846924201a --- /dev/null +++ b/default-configs/targets/sparc64-linux-user.mak @@ -0,0 +1,6 @@ +TARGET_ARCH=sparc64 +TARGET_BASE_ARCH=sparc +TARGET_SYSTBL_ABI=common,64 +TARGET_SYSTBL=syscall.tbl +TARGET_ALIGNED_ONLY=y +TARGET_WORDS_BIGENDIAN=y diff --git a/default-configs/targets/sparc64-softmmu.mak b/default-configs/targets/sparc64-softmmu.mak new file mode 100644 index 0000000000..8dd3217800 --- /dev/null +++ b/default-configs/targets/sparc64-softmmu.mak @@ -0,0 +1,4 @@ +TARGET_ARCH=sparc64 +TARGET_BASE_ARCH=sparc +TARGET_ALIGNED_ONLY=y +TARGET_WORDS_BIGENDIAN=y diff --git a/default-configs/targets/tilegx-linux-user.mak b/default-configs/targets/tilegx-linux-user.mak new file mode 100644 index 0000000000..10480e74c9 --- /dev/null +++ b/default-configs/targets/tilegx-linux-user.mak @@ -0,0 +1 @@ +TARGET_ARCH=tilegx diff --git a/default-configs/targets/tricore-softmmu.mak b/default-configs/targets/tricore-softmmu.mak new file mode 100644 index 0000000000..96b10af853 --- /dev/null +++ b/default-configs/targets/tricore-softmmu.mak @@ -0,0 +1 @@ +TARGET_ARCH=tricore diff --git a/default-configs/targets/unicore32-softmmu.mak b/default-configs/targets/unicore32-softmmu.mak new file mode 100644 index 0000000000..57331e94fe --- /dev/null +++ b/default-configs/targets/unicore32-softmmu.mak @@ -0,0 +1 @@ +TARGET_ARCH=unicore32 diff --git a/default-configs/targets/x86_64-bsd-user.mak b/default-configs/targets/x86_64-bsd-user.mak new file mode 100644 index 0000000000..799cd4acd4 --- /dev/null +++ b/default-configs/targets/x86_64-bsd-user.mak @@ -0,0 +1,3 @@ +TARGET_ARCH=x86_64 +TARGET_BASE_ARCH=i386 +TARGET_XML_FILES= gdb-xml/i386-64bit.xml diff --git a/default-configs/targets/x86_64-linux-user.mak b/default-configs/targets/x86_64-linux-user.mak new file mode 100644 index 0000000000..9ceefbb615 --- /dev/null +++ b/default-configs/targets/x86_64-linux-user.mak @@ -0,0 +1,5 @@ +TARGET_ARCH=x86_64 +TARGET_BASE_ARCH=i386 +TARGET_SYSTBL_ABI=common,64 +TARGET_SYSTBL=syscall_64.tbl +TARGET_XML_FILES= gdb-xml/i386-64bit.xml diff --git a/default-configs/targets/x86_64-softmmu.mak b/default-configs/targets/x86_64-softmmu.mak new file mode 100644 index 0000000000..75e42bc840 --- /dev/null +++ b/default-configs/targets/x86_64-softmmu.mak @@ -0,0 +1,4 @@ +TARGET_ARCH=x86_64 +TARGET_BASE_ARCH=i386 +TARGET_SUPPORTS_MTTCG=y +TARGET_XML_FILES= gdb-xml/i386-64bit.xml diff --git a/default-configs/targets/xtensa-linux-user.mak b/default-configs/targets/xtensa-linux-user.mak new file mode 100644 index 0000000000..fc95cc60f5 --- /dev/null +++ b/default-configs/targets/xtensa-linux-user.mak @@ -0,0 +1,5 @@ +TARGET_ARCH=xtensa +TARGET_SYSTBL_ABI=common +TARGET_SYSTBL=syscall.tbl +TARGET_ALIGNED_ONLY=y +TARGET_HAS_BFLT=y diff --git a/default-configs/targets/xtensa-softmmu.mak b/default-configs/targets/xtensa-softmmu.mak new file mode 100644 index 0000000000..26c0285655 --- /dev/null +++ b/default-configs/targets/xtensa-softmmu.mak @@ -0,0 +1,3 @@ +TARGET_ARCH=xtensa +TARGET_ALIGNED_ONLY=y +TARGET_SUPPORTS_MTTCG=y diff --git a/default-configs/targets/xtensaeb-linux-user.mak b/default-configs/targets/xtensaeb-linux-user.mak new file mode 100644 index 0000000000..cfc3518118 --- /dev/null +++ b/default-configs/targets/xtensaeb-linux-user.mak @@ -0,0 +1,6 @@ +TARGET_ARCH=xtensa +TARGET_SYSTBL_ABI=common +TARGET_SYSTBL=syscall.tbl +TARGET_ALIGNED_ONLY=y +TARGET_WORDS_BIGENDIAN=y +TARGET_HAS_BFLT=y diff --git a/default-configs/targets/xtensaeb-softmmu.mak b/default-configs/targets/xtensaeb-softmmu.mak new file mode 100644 index 0000000000..14cb9289a6 --- /dev/null +++ b/default-configs/targets/xtensaeb-softmmu.mak @@ -0,0 +1,4 @@ +TARGET_ARCH=xtensa +TARGET_ALIGNED_ONLY=y +TARGET_WORDS_BIGENDIAN=y +TARGET_SUPPORTS_MTTCG=y diff --git a/default-configs/tilegx-linux-user.mak b/default-configs/tilegx-linux-user.mak deleted file mode 100644 index 3e47493af0..0000000000 --- a/default-configs/tilegx-linux-user.mak +++ /dev/null @@ -1 +0,0 @@ -# Default configuration for tilegx-linux-user diff --git a/default-configs/x86_64-bsd-user.mak b/default-configs/x86_64-bsd-user.mak deleted file mode 100644 index 73e5d34ec5..0000000000 --- a/default-configs/x86_64-bsd-user.mak +++ /dev/null @@ -1 +0,0 @@ -# Default configuration for x86_64-bsd-user diff --git a/default-configs/x86_64-linux-user.mak b/default-configs/x86_64-linux-user.mak deleted file mode 100644 index bec1d9e7c6..0000000000 --- a/default-configs/x86_64-linux-user.mak +++ /dev/null @@ -1 +0,0 @@ -# Default configuration for x86_64-linux-user diff --git a/default-configs/xtensa-linux-user.mak b/default-configs/xtensa-linux-user.mak deleted file mode 100644 index fd1d350ee9..0000000000 --- a/default-configs/xtensa-linux-user.mak +++ /dev/null @@ -1 +0,0 @@ -# Default configuration for xtensa-linux-user diff --git a/default-configs/xtensaeb-linux-user.mak b/default-configs/xtensaeb-linux-user.mak deleted file mode 100644 index fd1d350ee9..0000000000 --- a/default-configs/xtensaeb-linux-user.mak +++ /dev/null @@ -1 +0,0 @@ -# Default configuration for xtensa-linux-user diff --git a/meson.build b/meson.build index 20f6ad774a..a02c743794 100644 --- a/meson.build +++ b/meson.build @@ -51,6 +51,28 @@ configure_file(input: files('scripts/ninjatool.py'), output: 'ninjatool', configuration: config_host) +if cpu in ['x86', 'x86_64'] + kvm_targets = ['i386-softmmu', 'x86_64-softmmu'] +elif cpu == 'aarch64' + kvm_targets = ['aarch64-softmmu'] +elif cpu == 's390x' + kvm_targets = ['s390x-softmmu'] +elif cpu in ['ppc', 'ppc64'] + kvm_targets = ['ppc-softmmu', 'ppc64-softmmu'] +else + kvm_targets = [] +endif + +accelerator_targets = { 'CONFIG_KVM': kvm_targets } +if cpu in ['x86', 'x86_64'] + accelerator_targets += { + 'CONFIG_HAX': ['i386-softmmu', 'x86_64-softmmu'], + 'CONFIG_XEN': ['i386-softmmu', 'x86_64-softmmu'], + 'CONFIG_HVF': ['x86_64-softmmu'], + 'CONFIG_WHPX': ['i386-softmmu', 'x86_64-softmmu'], + } +endif + ################## # Compiler flags # ################## @@ -81,11 +103,13 @@ if host_machine.system() == 'darwin' add_languages('objc', required: false, native: false) endif -if 'SPARSE_CFLAGS' in config_host +sparse = find_program('cgcc', required: get_option('sparse')) +if sparse.found() run_target('sparse', command: [find_program('scripts/check_sparse.py'), - config_host['SPARSE_CFLAGS'].split(), - 'compile_commands.json']) + 'compile_commands.json', sparse.full_path(), '-Wbitwise', + '-Wno-transparent-union', '-Wno-old-initializer', + '-Wno-non-pointer-null']) endif ########################################### @@ -103,8 +127,9 @@ socket = [] version_res = [] coref = [] iokit = [] +emulator_link_args = [] cocoa = not_found -hvf = [] +hvf = not_found if targetos == 'windows' socket = cc.find_library('ws2_32') winmm = cc.find_library('winmm') @@ -117,7 +142,6 @@ elif targetos == 'darwin' coref = dependency('appleframeworks', modules: 'CoreFoundation') iokit = dependency('appleframeworks', modules: 'IOKit') cocoa = dependency('appleframeworks', modules: 'Cocoa', required: get_option('cocoa')) - hvf = dependency('appleframeworks', modules: 'Hypervisor') elif targetos == 'sunos' socket = [cc.find_library('socket'), cc.find_library('nsl'), @@ -126,8 +150,71 @@ elif targetos == 'haiku' socket = [cc.find_library('posix_error_mapper'), cc.find_library('network'), cc.find_library('bsd')] +elif targetos == 'openbsd' + if not get_option('tcg').disabled() and target_dirs.length() > 0 + # Disable OpenBSD W^X if available + emulator_link_args = cc.get_supported_link_arguments('-Wl,-z,wxneeded') + endif endif +accelerators = [] +if not get_option('kvm').disabled() and targetos == 'linux' + accelerators += 'CONFIG_KVM' +endif +if not get_option('xen').disabled() and 'CONFIG_XEN_BACKEND' in config_host + accelerators += 'CONFIG_XEN' + have_xen_pci_passthrough = not get_option('xen_pci_passthrough').disabled() and targetos == 'linux' +else + have_xen_pci_passthrough = false +endif +if not get_option('whpx').disabled() and targetos == 'windows' + if get_option('whpx').enabled() and cpu != 'x86_64' + error('WHPX requires 64-bit host') + elif cc.has_header('WinHvPlatform.h', required: get_option('whpx')) and \ + cc.has_header('WinHvEmulation.h', required: get_option('whpx')) + accelerators += 'CONFIG_WHPX' + endif +endif +if not get_option('hvf').disabled() + hvf = dependency('appleframeworks', modules: 'Hypervisor', + required: get_option('hvf')) + if hvf.found() + accelerators += 'CONFIG_HVF' + endif +endif +if not get_option('hax').disabled() + if get_option('hax').enabled() or targetos in ['windows', 'darwin', 'netbsd'] + accelerators += 'CONFIG_HAX' + endif +endif +if not get_option('tcg').disabled() + if cpu not in supported_cpus + if 'CONFIG_TCG_INTERPRETER' in config_host + warning('Unsupported CPU @0@, will use TCG with TCI (experimental)'.format(cpu)) + else + error('Unsupported CPU @0@, try --enable-tcg-interpreter'.format(cpu)) + endif + endif + accelerators += 'CONFIG_TCG' + config_host += { 'CONFIG_TCG': 'y' } +endif + +if 'CONFIG_KVM' not in accelerators and get_option('kvm').enabled() + error('KVM not available on this platform') +endif +if 'CONFIG_HVF' not in accelerators and get_option('hvf').enabled() + error('HVF not available on this platform') +endif +if 'CONFIG_WHPX' not in accelerators and get_option('whpx').enabled() + error('WHPX not available on this platform') +endif +if not have_xen_pci_passthrough and get_option('xen_pci_passthrough').enabled() + if 'CONFIG_XEN' in accelerators + error('Xen PCI passthrough not available on this platform') + else + error('Xen PCI passthrough requested but Xen not enabled') + endif +endif if not cocoa.found() and get_option('cocoa').enabled() error('Cocoa not available on this platform') endif @@ -556,12 +643,15 @@ config_host_data.set('QEMU_VERSION_MAJOR', meson.project_version().split('.')[0] config_host_data.set('QEMU_VERSION_MINOR', meson.project_version().split('.')[1]) config_host_data.set('QEMU_VERSION_MICRO', meson.project_version().split('.')[2]) +ignored = ['CONFIG_QEMU_INTERP_PREFIX'] # actually per-target arrays = ['CONFIG_AUDIO_DRIVERS', 'CONFIG_BDRV_RW_WHITELIST', 'CONFIG_BDRV_RO_WHITELIST'] strings = ['HOST_DSOSUF', 'CONFIG_IASL', 'bindir', 'prefix', 'qemu_confdir', 'qemu_datadir', 'qemu_moddir', 'qemu_localstatedir', 'qemu_helperdir', 'qemu_localedir', 'qemu_icondir', 'qemu_desktopdir', 'qemu_firmwarepath', 'sysconfdir'] foreach k, v: config_host - if arrays.contains(k) + if ignored.contains(k) + # do nothing + elif arrays.contains(k) if v != '' v = '"' + '", "'.join(v.split()) + '", ' endif @@ -634,18 +724,68 @@ kconfig_external_symbols = [ 'CONFIG_LINUX', 'CONFIG_PVRDMA', ] -ignored = ['TARGET_XML_FILES', 'TARGET_ABI_DIR', 'TARGET_DIRS'] - -accel_symbols = [ - 'CONFIG_KVM', - 'CONFIG_HAX', - 'CONFIG_HVF', - 'CONFIG_TCG', - 'CONFIG_WHPX' -] +ignored = [ 'TARGET_XML_FILES', 'TARGET_ABI_DIR', 'TARGET_ARCH' ] +default_targets = 'CONFIG_DEFAULT_TARGETS' in config_host +actual_target_dirs = [] foreach target : target_dirs - config_target = keyval.load(meson.current_build_dir() / target / 'config-target.mak') + config_target = { 'TARGET_NAME': target.split('-')[0] } + if target.endswith('linux-user') + if targetos != 'linux' + if default_targets + continue + endif + error('Target @0@ is only available on a Linux host'.format(target)) + endif + config_target += { 'CONFIG_LINUX_USER': 'y' } + elif target.endswith('bsd-user') + if 'CONFIG_BSD' not in config_host + if default_targets + continue + endif + error('Target @0@ is only available on a BSD host'.format(target)) + endif + config_target += { 'CONFIG_BSD_USER': 'y' } + elif target.endswith('softmmu') + config_target += { 'CONFIG_SOFTMMU': 'y' } + endif + if target.endswith('-user') + config_target += { + 'CONFIG_USER_ONLY': 'y', + 'CONFIG_QEMU_INTERP_PREFIX': + config_host['CONFIG_QEMU_INTERP_PREFIX'].format(config_target['TARGET_NAME']) + } + endif + + have_accel = false + foreach sym: accelerators + if sym == 'CONFIG_TCG' or target in accelerator_targets.get(sym, []) + config_target += { sym: 'y' } + config_all += { sym: 'y' } + if sym == 'CONFIG_XEN' and have_xen_pci_passthrough + config_target += { 'CONFIG_XEN_PCI_PASSTHROUGH': 'y' } + endif + have_accel = true + endif + endforeach + if not have_accel + if default_targets + continue + endif + error('No accelerator available for target @0@'.format(target)) + endif + + actual_target_dirs += target + config_target += keyval.load('default-configs/targets' / target + '.mak') + config_target += { 'TARGET_' + config_target['TARGET_ARCH'].to_upper(): 'y' } + + # Add default keys + if 'TARGET_BASE_ARCH' not in config_target + config_target += {'TARGET_BASE_ARCH': config_target['TARGET_ARCH']} + endif + if 'TARGET_ABI_DIR' not in config_target + config_target += {'TARGET_ABI_DIR': config_target['TARGET_ARCH']} + endif foreach k, v: disassemblers if config_host['ARCH'].startswith(k) or config_target['TARGET_BASE_ARCH'].startswith(k) @@ -663,8 +803,10 @@ foreach target : target_dirs elif ignored.contains(k) # do nothing elif k == 'TARGET_BASE_ARCH' + # Note that TARGET_BASE_ARCH ends up in config-target.h but it is + # not used to select files from sourcesets. config_target_data.set('TARGET_' + v.to_upper(), 1) - elif k == 'TARGET_NAME' + elif k == 'TARGET_NAME' or k == 'CONFIG_QEMU_INTERP_PREFIX' config_target_data.set_quoted(k, v) elif v == 'y' config_target_data.set(k, 1) @@ -672,11 +814,6 @@ foreach target : target_dirs config_target_data.set(k, v) endif endforeach - foreach sym: accel_symbols - if config_target.has_key(sym) - config_all += { sym: 'y' } - endif - endforeach config_target_h += {target: configure_file(output: target + '-config-target.h', configuration: config_target_data)} @@ -690,7 +827,7 @@ foreach target : target_dirs config_devices_mak = target + '-config-devices.mak' config_devices_mak = configure_file( - input: ['default-configs' / target + '.mak', 'Kconfig'], + input: ['default-configs/devices' / target + '.mak', 'Kconfig'], output: config_devices_mak, depfile: config_devices_mak + '.d', capture: true, @@ -711,6 +848,7 @@ foreach target : target_dirs endif config_target_mak += {target: config_target} endforeach +target_dirs = actual_target_dirs # This configuration is used to build files that are shared by # multiple binaries, and then extracted out of the "common" @@ -1237,7 +1375,7 @@ foreach target : target_dirs c_args = ['-DNEED_CPU_H', '-DCONFIG_TARGET="@0@-config-target.h"'.format(target), '-DCONFIG_DEVICES="@0@-config-devices.h"'.format(target)] - link_args = [] + link_args = emulator_link_args config_target += config_host target_inc = [include_directories('target' / config_target['TARGET_BASE_ARCH'])] @@ -1528,9 +1666,9 @@ if config_host.has_key('CONFIG_MODULES') endif summary_info += {'host CPU': cpu} summary_info += {'host endianness': build_machine.endian()} -summary_info += {'target list': config_host['TARGET_DIRS']} +summary_info += {'target list': ' '.join(target_dirs)} summary_info += {'gprof enabled': config_host.has_key('CONFIG_GPROF')} -summary_info += {'sparse enabled': meson.get_compiler('c').cmd_array().contains('cgcc')} +summary_info += {'sparse enabled': sparse.found()} summary_info += {'strip binaries': get_option('strip')} summary_info += {'profiler': config_host.has_key('CONFIG_PROFILER')} summary_info += {'static build': config_host.has_key('CONFIG_STATIC')} diff --git a/meson_options.txt b/meson_options.txt index a1228d29a9..a0455d8a95 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -5,12 +5,29 @@ option('docdir', type : 'string', value : 'doc', option('gettext', type : 'boolean', value : true, description: 'Localization of the GTK+ user interface') +option('sparse', type : 'feature', value : 'auto', + description: 'sparse checker') option('malloc_trim', type : 'feature', value : 'auto', description: 'enable libc malloc_trim() for memory optimization') option('malloc', type : 'combo', choices : ['system', 'tcmalloc', 'jemalloc'], value: 'system', description: 'choose memory allocator to use') +option('kvm', type: 'feature', value: 'auto', + description: 'KVM acceleration support') +option('hax', type: 'feature', value: 'auto', + description: 'HAX acceleration support') +option('whpx', type: 'feature', value: 'auto', + description: 'WHPX acceleration support') +option('hvf', type: 'feature', value: 'auto', + description: 'HVF acceleration support') +option('xen', type: 'feature', value: 'auto', + description: 'Xen backend support') +option('xen_pci_passthrough', type: 'feature', value: 'auto', + description: 'Xen PCI passthrough support') +option('tcg', type: 'feature', value: 'auto', + description: 'TCG support') + option('cocoa', type : 'feature', value : 'auto', description: 'Cocoa user interface (macOS only)') option('mpath', type : 'feature', value : 'auto', diff --git a/qapi/run-state.json b/qapi/run-state.json index 7cc9f96a5b..964c8ef391 100644 --- a/qapi/run-state.json +++ b/qapi/run-state.json @@ -475,3 +475,93 @@ 'psw-mask': 'uint64', 'psw-addr': 'uint64', 'reason': 'S390CrashReason' } } + +## +# @MEMORY_FAILURE: +# +# Emitted when a memory failure occurs on host side. +# +# @recipient: recipient is defined as @MemoryFailureRecipient. +# +# @action: action that has been taken. action is defined as @MemoryFailureAction. +# +# @flags: flags for MemoryFailureAction. action is defined as @MemoryFailureFlags. +# +# Since: 5.2 +# +# Example: +# +# <- { "event": "MEMORY_FAILURE", +# "data": { "recipient": "hypervisor", +# "action": "fatal", +# "flags": { 'action-required': false } } +# +## +{ 'event': 'MEMORY_FAILURE', + 'data': { 'recipient': 'MemoryFailureRecipient', + 'action': 'MemoryFailureAction', + 'flags': 'MemoryFailureFlags'} } + +## +# @MemoryFailureRecipient: +# +# Hardware memory failure occurs, handled by recipient. +# +# @hypervisor: memory failure at QEMU process address space. +# (none guest memory, but used by QEMU itself). +# +# @guest: memory failure at guest memory, +# +# Since: 5.2 +# +## +{ 'enum': 'MemoryFailureRecipient', + 'data': [ 'hypervisor', + 'guest' ] } + + +## +# @MemoryFailureAction: +# +# Actions taken by QEMU in response to a hardware memory failure. +# +# @ignore: the memory failure could be ignored. This will only be the case +# for action-optional failures. +# +# @inject: memory failure occurred in guest memory, the guest enabled MCE +# handling mechanism, and QEMU could inject the MCE into the guest +# successfully. +# +# @fatal: the failure is unrecoverable. This occurs for action-required +# failures if the recipient is the hypervisor; QEMU will exit. +# +# @reset: the failure is unrecoverable but confined to the guest. This +# occurs if the recipient is a guest guest which is not ready +# to handle memory failures. +# +# Since: 5.2 +# +## +{ 'enum': 'MemoryFailureAction', + 'data': [ 'ignore', + 'inject', + 'fatal', + 'reset' ] } + +## +# @MemoryFailureFlags: +# +# Additional information on memory failures. +# +# @action-required: whether a memory failure event is action-required +# or action-optional (e.g. a failure during memory scrub). +# +# @recursive: whether the failure occurred while the previous +# failure was still in progress. +# +# Since: 5.2 +# +## +{ 'struct': 'MemoryFailureFlags', + 'data': { 'action-required': 'bool', + 'recursive': 'bool'} } diff --git a/scripts/check_sparse.py b/scripts/check_sparse.py index 0de7aa55d9..2956124442 100644 --- a/scripts/check_sparse.py +++ b/scripts/check_sparse.py @@ -1,25 +1,59 @@ #! /usr/bin/env python3 -# Invoke sparse based on the contents of compile_commands.json +# Invoke sparse based on the contents of compile_commands.json, +# also working around several deficiencies in cgcc's command line +# parsing import json import subprocess +import os import sys import shlex -def extract_cflags(shcmd): - cflags = shlex.split(shcmd) - return [x for x in cflags - if x.startswith('-D') or x.startswith('-I') or x.startswith('-W') - or x.startswith('-std=')] +def cmdline_for_sparse(sparse, cmdline): + # Do not include the C compiler executable + skip = True + arg = False + out = sparse + ['-no-compile'] + for x in cmdline: + if arg: + out.append(x) + arg = False + continue + if skip: + skip = False + continue + # prevent sparse from treating output files as inputs + if x == '-MF' or x == '-MQ' or x == '-o': + skip = True + continue + # cgcc ignores -no-compile if it sees -M or -MM? + if x.startswith('-M'): + continue + # sparse does not understand these! + if x == '-iquote' or x == '-isystem': + x = '-I' + if x == '-I': + arg = True + out.append(x) + return out -cflags = sys.argv[1:-1] -with open(sys.argv[-1], 'r') as fd: +root_path = os.getenv('MESON_BUILD_ROOT') +def build_path(s): + return s if not root_path else os.path.join(root_path, s) + +ccjson_path = build_path(sys.argv[1]) +with open(ccjson_path, 'r') as fd: compile_commands = json.load(fd) +sparse = sys.argv[2:] +sparse_env = os.environ.copy() for cmd in compile_commands: - cmd = ['sparse'] + cflags + extract_cflags(cmd['command']) + [cmd['file']] - print(' '.join((shlex.quote(x) for x in cmd))) - r = subprocess.run(cmd) + cmdline = shlex.split(cmd['command']) + cmd = cmdline_for_sparse(sparse, cmdline) + print('REAL_CC=%s' % shlex.quote(cmdline[0]), + ' '.join((shlex.quote(x) for x in cmd))) + sparse_env['REAL_CC'] = cmdline[0] + r = subprocess.run(cmd, env=sparse_env, cwd=root_path) if r.returncode != 0: sys.exit(r.returncode) diff --git a/target/i386/helper.c b/target/i386/helper.c index 70be53e2c3..32fa21a7bb 100644 --- a/target/i386/helper.c +++ b/target/i386/helper.c @@ -18,6 +18,7 @@ */ #include "qemu/osdep.h" +#include "qapi/qapi-events-run-state.h" #include "cpu.h" #include "exec/exec-all.h" #include "qemu/qemu-print.h" @@ -851,22 +852,35 @@ typedef struct MCEInjectionParams { int flags; } MCEInjectionParams; +static void emit_guest_memory_failure(MemoryFailureAction action, bool ar, + bool recursive) +{ + MemoryFailureFlags mff = {.action_required = ar, .recursive = recursive}; + + qapi_event_send_memory_failure(MEMORY_FAILURE_RECIPIENT_GUEST, action, + &mff); +} + static void do_inject_x86_mce(CPUState *cs, run_on_cpu_data data) { MCEInjectionParams *params = data.host_ptr; X86CPU *cpu = X86_CPU(cs); CPUX86State *cenv = &cpu->env; uint64_t *banks = cenv->mce_banks + 4 * params->bank; + g_autofree char *msg = NULL; + bool need_reset = false; + bool recursive; + bool ar = !!(params->status & MCI_STATUS_AR); cpu_synchronize_state(cs); + recursive = !!(cenv->mcg_status & MCG_STATUS_MCIP); /* * If there is an MCE exception being processed, ignore this SRAO MCE * unless unconditional injection was requested. */ - if (!(params->flags & MCE_INJECT_UNCOND_AO) - && !(params->status & MCI_STATUS_AR) - && (cenv->mcg_status & MCG_STATUS_MCIP)) { + if (!(params->flags & MCE_INJECT_UNCOND_AO) && !ar && recursive) { + emit_guest_memory_failure(MEMORY_FAILURE_ACTION_IGNORE, ar, recursive); return; } @@ -894,16 +908,27 @@ static void do_inject_x86_mce(CPUState *cs, run_on_cpu_data data) return; } - if ((cenv->mcg_status & MCG_STATUS_MCIP) || - !(cenv->cr[4] & CR4_MCE_MASK)) { - monitor_printf(params->mon, - "CPU %d: Previous MCE still in progress, raising" - " triple fault\n", - cs->cpu_index); - qemu_log_mask(CPU_LOG_RESET, "Triple fault\n"); + if (recursive) { + need_reset = true; + msg = g_strdup_printf("CPU %d: Previous MCE still in progress, " + "raising triple fault", cs->cpu_index); + } + + if (!(cenv->cr[4] & CR4_MCE_MASK)) { + need_reset = true; + msg = g_strdup_printf("CPU %d: MCE capability is not enabled, " + "raising triple fault", cs->cpu_index); + } + + if (need_reset) { + emit_guest_memory_failure(MEMORY_FAILURE_ACTION_RESET, ar, + recursive); + monitor_printf(params->mon, "%s", msg); + qemu_log_mask(CPU_LOG_RESET, "%s\n", msg); qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); return; } + if (banks[1] & MCI_STATUS_VAL) { params->status |= MCI_STATUS_OVER; } @@ -923,6 +948,8 @@ static void do_inject_x86_mce(CPUState *cs, run_on_cpu_data data) } else { banks[1] |= MCI_STATUS_OVER; } + + emit_guest_memory_failure(MEMORY_FAILURE_ACTION_INJECT, ar, recursive); } void cpu_x86_inject_mce(Monitor *mon, X86CPU *cpu, int bank, diff --git a/target/i386/kvm.c b/target/i386/kvm.c index f6dae4cfb6..8b12387d30 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -13,6 +13,7 @@ */ #include "qemu/osdep.h" +#include "qapi/qapi-events-run-state.h" #include "qapi/error.h" #include #include @@ -549,8 +550,17 @@ static void kvm_mce_inject(X86CPU *cpu, hwaddr paddr, int code) (MCM_ADDR_PHYS << 6) | 0xc, flags); } +static void emit_hypervisor_memory_failure(MemoryFailureAction action, bool ar) +{ + MemoryFailureFlags mff = {.action_required = ar, .recursive = false}; + + qapi_event_send_memory_failure(MEMORY_FAILURE_RECIPIENT_HYPERVISOR, action, + &mff); +} + static void hardware_memory_error(void *host_addr) { + emit_hypervisor_memory_failure(MEMORY_FAILURE_ACTION_FATAL, true); error_report("QEMU got Hardware memory error at addr %p", host_addr); exit(1); } @@ -605,7 +615,8 @@ void kvm_arch_on_sigbus_vcpu(CPUState *c, int code, void *addr) hardware_memory_error(addr); } - /* Hope we are lucky for AO MCE */ + /* Hope we are lucky for AO MCE, just notify a event */ + emit_hypervisor_memory_failure(MEMORY_FAILURE_ACTION_IGNORE, false); } static void kvm_reset_exception(CPUX86State *env) diff --git a/tests/Makefile.include b/tests/Makefile.include index 40d909badc..5aca98e60c 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -50,21 +50,21 @@ RUN_TCG_TARGET_RULES=$(patsubst %,run-tcg-tests-%, $(TARGET_DIRS)) $(foreach PROBE_TARGET,$(TARGET_DIRS), \ $(eval -include $(SRC_PATH)/tests/tcg/Makefile.prereqs)) -build-tcg-tests-%: $(if $(CONFIG_PLUGIN),test-plugins) +$(BUILD_TCG_TARGET_RULES): build-tcg-tests-%: $(if $(CONFIG_PLUGIN),test-plugins) $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) \ -f $(SRC_PATH)/tests/tcg/Makefile.qemu \ SRC_PATH=$(SRC_PATH) \ V="$(V)" TARGET="$*" guest-tests, \ "BUILD", "TCG tests for $*") -run-tcg-tests-%: build-tcg-tests-% all +$(RUN_TCG_TARGET_RULES): run-tcg-tests-%: build-tcg-tests-% all $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) \ -f $(SRC_PATH)/tests/tcg/Makefile.qemu \ SRC_PATH=$(SRC_PATH) SPEED="$(SPEED)" \ V="$(V)" TARGET="$*" run-guest-tests, \ "RUN", "TCG tests for $*") -clean-tcg-tests-%: +$(CLEAN_TCG_TARGET_RULES): clean-tcg-tests-%: $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) \ -f $(SRC_PATH)/tests/tcg/Makefile.qemu \ SRC_PATH=$(SRC_PATH) TARGET="$*" clean-guest-tests, \ diff --git a/tests/docker/dockerfiles/fedora.docker b/tests/docker/dockerfiles/fedora.docker index 71e4b56977..ec783418c8 100644 --- a/tests/docker/dockerfiles/fedora.docker +++ b/tests/docker/dockerfiles/fedora.docker @@ -11,6 +11,7 @@ ENV PACKAGES \ cyrus-sasl-devel \ dbus-daemon \ device-mapper-multipath-devel \ + diffutils \ findutils \ gcc \ gcc-c++ \ diff --git a/tests/meson.build b/tests/meson.build index 3c2969092d..bf47a38c74 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -269,7 +269,7 @@ test('decodetree', sh, subdir('fp') -if 'CONFIG_TCG' in config_host +if not get_option('tcg').disabled() if 'CONFIG_PLUGIN' in config_host subdir('plugin') endif