From nobody Tue Feb 10 05:46:20 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1611412554; cv=none; d=zohomail.com; s=zohoarc; b=lpv2p0dXu3pZoBzVzspLSQPz6ctuo8Rd20aPVyPvt4zUJ7TNK1flJGSuL0py369gJ1Q2dU0G3/EXMp7PR5oXSpI2HSC65hAD3p4hF9aL9izhwJK3r9zh48ajFZeddgxF7SndECFiT4zkud2pYykdX7ekgsZzkJwDKYz1Rxv2Rj0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611412554; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=DfOHFLc+xaX9VNCaiHgCnHGEgBGgoOA+pyzDfGHs+5Q=; b=OsYZjNjjzgp5rgbBXlje7lu1lIaE1wSf+0PjZpfHfzWhYcZj2IOzdaYFX2RkD4XUO85t1nH6gqq6ZMTrn2/lf8tysboEMXCZxmRa7luUR2qFgICTz5WJFjUE2uwq5ge70mynlPuNx8h3zg7GMZI7O5ShmSWbvA0zbPLd8T5vulE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1611412554124167.14556736210648; Sat, 23 Jan 2021 06:35:54 -0800 (PST) Received: from localhost ([::1]:36026 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3K13-0000PV-3W for importer@patchew.org; Sat, 23 Jan 2021 09:35:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35112) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3Jx2-0003Sx-Gt for qemu-devel@nongnu.org; Sat, 23 Jan 2021 09:31:45 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:35642) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l3Jwt-0005n0-9x for qemu-devel@nongnu.org; Sat, 23 Jan 2021 09:31:43 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-291-Q6BRHnX1PoW3XlqLrqo0Dg-1; Sat, 23 Jan 2021 09:31:32 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2C69A180A096 for ; Sat, 23 Jan 2021 14:31:31 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id ECB165D9CC for ; Sat, 23 Jan 2021 14:31:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611412294; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DfOHFLc+xaX9VNCaiHgCnHGEgBGgoOA+pyzDfGHs+5Q=; b=hXthlZXowSQKUd10xQ3XdaJ4ybG27EQ6sSzeuJ0+YgIyAX6HLP8SOgboFIUmvVmzg95Vkv InGHNcN3US598FJ51zX1X+3Xyb426bY0OAht+CVnMqXHPVSXwFWau+jckIeJ/srbpEdj4y cJ3YFrEYcxwF2T03NQ7nlVMLUC2gd1Y= X-MC-Unique: Q6BRHnX1PoW3XlqLrqo0Dg-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 04/31] build-system: clean up TCG/TCI configury Date: Sat, 23 Jan 2021 09:31:01 -0500 Message-Id: <20210123143128.1167797-5-pbonzini@redhat.com> In-Reply-To: <20210123143128.1167797-1-pbonzini@redhat.com> References: <20210123143128.1167797-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.165, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Make CONFIG_TCG_INTERPRETER a Meson option, and enable TCI (though with a warning) if the host CPU is unsupported, making it more similar to other --enable-* options. Remove TCG-specific include paths from !CONFIG_TCG builds. Signed-off-by: Paolo Bonzini --- configure | 11 +++-------- disas/meson.build | 2 -- meson.build | 46 +++++++++++++++++++++++++--------------------- meson_options.txt | 2 ++ 4 files changed, 30 insertions(+), 31 deletions(-) diff --git a/configure b/configure index f16fa99060..a84df7c4ad 100755 --- a/configure +++ b/configure @@ -359,7 +359,7 @@ sanitizers=3D"no" tsan=3D"no" fortify_source=3D"$default_feature" strip_opt=3D"yes" -tcg_interpreter=3D"no" +tcg_interpreter=3D"false" bigendian=3D"no" mingw32=3D"no" gcov=3D"no" @@ -1119,9 +1119,9 @@ for opt do ;; --enable-whpx) whpx=3D"enabled" ;; - --disable-tcg-interpreter) tcg_interpreter=3D"no" + --disable-tcg-interpreter) tcg_interpreter=3D"true" ;; - --enable-tcg-interpreter) tcg_interpreter=3D"yes" + --enable-tcg-interpreter) tcg_interpreter=3D"false" ;; --disable-cap-ng) cap_ng=3D"disabled" ;; @@ -5834,11 +5834,6 @@ fi if test "$optreset" =3D "yes" ; then echo "HAVE_OPTRESET=3Dy" >> $config_host_mak fi -if test "$tcg" =3D "enabled"; then - if test "$tcg_interpreter" =3D "yes" ; then - echo "CONFIG_TCG_INTERPRETER=3Dy" >> $config_host_mak - fi -fi if test "$fdatasync" =3D "yes" ; then echo "CONFIG_FDATASYNC=3Dy" >> $config_host_mak fi diff --git a/disas/meson.build b/disas/meson.build index 09a852742e..da341a511e 100644 --- a/disas/meson.build +++ b/disas/meson.build @@ -22,5 +22,3 @@ common_ss.add(when: 'CONFIG_SH4_DIS', if_true: files('sh4= .c')) common_ss.add(when: 'CONFIG_SPARC_DIS', if_true: files('sparc.c')) common_ss.add(when: 'CONFIG_XTENSA_DIS', if_true: files('xtensa.c')) common_ss.add(when: capstone, if_true: files('capstone.c')) - -specific_ss.add(when: 'CONFIG_TCG_INTERPRETER', if_true: files('tci.c')) diff --git a/meson.build b/meson.build index af2bc89741..2001e941f4 100644 --- a/meson.build +++ b/meson.build @@ -113,25 +113,8 @@ if targetos =3D=3D 'linux' language: ['c', 'cpp']) endif =20 -if 'CONFIG_TCG_INTERPRETER' in config_host - tcg_arch =3D 'tci' -elif config_host['ARCH'] =3D=3D 'sparc64' - tcg_arch =3D 'sparc' -elif config_host['ARCH'] =3D=3D 's390x' - tcg_arch =3D 's390' -elif config_host['ARCH'] in ['x86_64', 'x32'] - tcg_arch =3D 'i386' -elif config_host['ARCH'] =3D=3D 'ppc64' - tcg_arch =3D 'ppc' -elif config_host['ARCH'] in ['riscv32', 'riscv64'] - tcg_arch =3D 'riscv' -else - tcg_arch =3D config_host['ARCH'] -endif -add_project_arguments('-iquote', meson.current_source_dir() / 'tcg' / tcg_= arch, - '-iquote', '.', +add_project_arguments('-iquote', '.', '-iquote', meson.current_source_dir(), - '-iquote', meson.current_source_dir() / 'accel/tcg', '-iquote', meson.current_source_dir() / 'include', '-iquote', meson.current_source_dir() / 'disas/libvi= xl', language: ['c', 'cpp', 'objc']) @@ -226,14 +209,33 @@ if not get_option('hax').disabled() accelerators +=3D 'CONFIG_HAX' endif endif + +tcg_arch =3D config_host['ARCH'] if not get_option('tcg').disabled() if cpu not in supported_cpus - if 'CONFIG_TCG_INTERPRETER' in config_host + if get_option('tcg_interpreter') 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 + if get_option('tcg_interpreter') + tcg_arch =3D 'tci' + elif config_host['ARCH'] =3D=3D 'sparc64' + tcg_arch =3D 'sparc' + elif config_host['ARCH'] =3D=3D 's390x' + tcg_arch =3D 's390' + elif config_host['ARCH'] in ['x86_64', 'x32'] + tcg_arch =3D 'i386' + elif config_host['ARCH'] =3D=3D 'ppc64' + tcg_arch =3D 'ppc' + elif config_host['ARCH'] in ['riscv32', 'riscv64'] + tcg_arch =3D 'riscv' + endif + add_project_arguments('-iquote', meson.current_source_dir() / 'tcg' / tc= g_arch, + '-iquote', meson.current_source_dir() / 'accel/tcg= ', + language: ['c', 'cpp', 'objc']) + accelerators +=3D 'CONFIG_TCG' config_host +=3D { 'CONFIG_TCG': 'y' } endif @@ -1234,7 +1236,9 @@ foreach target : target_dirs if sym =3D=3D 'CONFIG_TCG' or target in accelerator_targets.get(sym, [= ]) config_target +=3D { sym: 'y' } config_all +=3D { sym: 'y' } - if sym =3D=3D 'CONFIG_XEN' and have_xen_pci_passthrough + if sym =3D=3D 'CONFIG_TCG' and tcg_arch =3D=3D 'tci' + config_target +=3D { 'CONFIG_TCG_INTERPRETER': 'y' } + elif sym =3D=3D 'CONFIG_XEN' and have_xen_pci_passthrough config_target +=3D { 'CONFIG_XEN_PCI_PASSTHROUGH': 'y' } endif accel_kconfig +=3D [ sym + '=3Dy' ] @@ -2411,7 +2415,7 @@ summary_info +=3D {'WHPX support': config_all.ha= s_key('CONFIG_WHPX')} summary_info +=3D {'TCG support': config_all.has_key('CONFIG_TCG')} if config_all.has_key('CONFIG_TCG') summary_info +=3D {'TCG debug enabled': config_host.has_key('CONFIG_DEBU= G_TCG')} - summary_info +=3D {'TCG interpreter': config_host.has_key('CONFIG_TCG_= INTERPRETER')} + summary_info +=3D {'TCG interpreter': tcg_arch =3D=3D 'tci'} endif summary_info +=3D {'malloc trim support': has_malloc_trim} summary_info +=3D {'RDMA support': config_host.has_key('CONFIG_RDMA')} diff --git a/meson_options.txt b/meson_options.txt index 72a3ca22d6..7dcd81c06a 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -37,6 +37,8 @@ option('xen_pci_passthrough', type: 'feature', value: 'au= to', description: 'Xen PCI passthrough support') option('tcg', type: 'feature', value: 'auto', description: 'TCG support') +option('tcg_interpreter', type: 'boolean', value: false, + description: 'TCG bytecode interpreter (TCI)') option('cfi', type: 'boolean', value: 'false', description: 'Control-Flow Integrity (CFI)') option('cfi_debug', type: 'boolean', value: 'false', --=20 2.26.2