From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45728) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bX9NH-0005B0-C7 for qemu-devel@nongnu.org; Tue, 09 Aug 2016 11:55:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bX9NC-0003Oi-Fv for qemu-devel@nongnu.org; Tue, 09 Aug 2016 11:55:26 -0400 Received: from mail-wm0-x230.google.com ([2a00:1450:400c:c09::230]:36926) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bX9NC-0003OY-95 for qemu-devel@nongnu.org; Tue, 09 Aug 2016 11:55:22 -0400 Received: by mail-wm0-x230.google.com with SMTP id i5so44683909wmg.0 for ; Tue, 09 Aug 2016 08:55:22 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Tue, 9 Aug 2016 16:55:25 +0100 Message-Id: <1470758127-17769-2-git-send-email-alex.bennee@linaro.org> In-Reply-To: <1470758127-17769-1-git-send-email-alex.bennee@linaro.org> References: <1470758127-17769-1-git-send-email-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [RFC for 2.8 1/3] configure: check CPU width and disable larger guests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, rth@twiddle.net, =?UTF-8?q?Alex=20Benn=C3=A9e?= Emulating 64 bit guests on a 32 bit host is either impossible with KVM or needs a lot of special casing for TCG targets. As 64 bit hosts are fairly normal nowadays and there can't be many people trying this combination lets disable it completely. Signed-off-by: Alex Bennée --- configure | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/configure b/configure index f57fcc6..7b779c1 100755 --- a/configure +++ b/configure @@ -478,6 +478,7 @@ elif check_define __x86_64__ ; then cpu="x32" else cpu="x86_64" + cpu_width=64 fi elif check_define __sparc__ ; then if check_define __arch64__ ; then @@ -515,26 +516,36 @@ ARCH= # Normalise host CPU name and set ARCH. # Note that this case should only have supported host CPUs, not guests. case "$cpu" in - ia64|ppc|ppc64|s390|s390x|sparc64|x32) + ppc|s390|x32) cpu="$cpu" + cpu_width=32 + ;; + ia64|ppc64|s390x|sparc64) + cpu="$cpu" + cpu_width=64 ;; i386|i486|i586|i686|i86pc|BePC) cpu="i386" + cpu_width=32 ;; x86_64|amd64) cpu="x86_64" + cpu_width=64 ;; armv*b|armv*l|arm) cpu="arm" + cpu_width=32 ;; aarch64) cpu="aarch64" + cpu_width=32 ;; mips*) cpu="mips" ;; sparc|sun4[cdmuv]) cpu="sparc" + cpu_width=32 ;; *) # This will result in either an error or falling back to TCI later @@ -1700,6 +1711,26 @@ else fi ########################################## +# host address width checks +too_wide_targets="" + +if test "$cpu_width" = "32"; then + for target in $target_list; do + target_name=$(echo $target | cut -d '-' -f 1) + case "$target_name" in + aarch64|mips64|ppc64|s390x|sparc64) + too_wide_targets="$too_wide_targets $target" + ;; + esac + done +fi + +if test ! -z "$too_wide_targets" ; then + error_exit "Support for the following targets can't be built on 32 bit systems:\n\t$too_wide_targets" +fi + + +########################################## # cocoa implies not SDL or GTK # (the cocoa UI code currently assumes it is always the active UI # and doesn't interact well with other UI frontend code) @@ -4795,6 +4826,7 @@ if test "$slirp" = "yes" ; then fi echo "module support $modules" echo "host CPU $cpu" +echo "host CPU width $cpu_width" echo "host big endian $bigendian" echo "target list $target_list" echo "tcg debug enabled $debug_tcg" -- 2.7.4