From nobody Sat May 18 09:48:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1626819297626569.8421690078333; Tue, 20 Jul 2021 15:14:57 -0700 (PDT) Received: from localhost ([::1]:41980 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m5y0u-0007VW-GU for importer@patchew.org; Tue, 20 Jul 2021 18:14:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56330) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5y03-000688-Fr for qemu-devel@nongnu.org; Tue, 20 Jul 2021 18:14:03 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:47762) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m5y01-0007FQ-OT for qemu-devel@nongnu.org; Tue, 20 Jul 2021 18:14:03 -0400 Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 8FB7E22498; Tue, 20 Jul 2021 22:14:00 +0000 (UTC) Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap1.suse-dmz.suse.de (Postfix) with ESMTPS id 7F9E513BAB; Tue, 20 Jul 2021 22:13:58 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap1.suse-dmz.suse.de with ESMTPSA id eOuoEaZK92DjEQAAGKfGzw (envelope-from ); Tue, 20 Jul 2021 22:13:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1626819240; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZQ++T/l6J0S5iRZ6AdhfJo3BE0taZTfUI7XZ+fAAYLI=; b=LpRu/guafmd9f/tf5DTqBQE7m1tcMYzA6fnWRZegL66zi8tQMIFyee5Qh5eC4UL/R7+zzI hNxAPvIwqs1afdzHyDn2qND7BZpOKnufh1EPtbLRdDbbXMkxqdSyvMx24YTwaxvBdr2gIn 0hR9hlD5cZhf4n+AehOnIAb8XRMjx1Y= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1626819240; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZQ++T/l6J0S5iRZ6AdhfJo3BE0taZTfUI7XZ+fAAYLI=; b=TlZyUGsAPYcKgaSgXDtn/dnfzzsBQ1cmfGHtCWwhPKpQWZUdqYAQnGNwouWDDMTvB1NMlS R+lIuZjIczlTOfAg== From: "Jose R. Ziviani" To: qemu-devel@nongnu.org Subject: [PATCH 1/1] modules: Option to build native TCG with --enable-modules Date: Tue, 20 Jul 2021 19:13:51 -0300 Message-Id: <20210720221351.13354-2-jziviani@suse.de> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210720221351.13354-1-jziviani@suse.de> References: <20210720221351.13354-1-jziviani@suse.de> MIME-Version: 1.0 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=195.135.220.28; envelope-from=jziviani@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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: , Cc: thuth@redhat.com, "Jose R. Ziviani" , richard.henderson@linaro.org, kraxel@redhat.com, pbonzini@redhat.com, cfontana@suse.de Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (found 2 invalid signatures) X-ZM-MESSAGEID: 1626819298351100003 Content-Type: text/plain; charset="utf-8" Adds an option (--enable-tcg-builtin) to build TCG natively when --enable-modules argument is passed to the build system. It gives the opportunity to have this important accelerator built-in and still take advantage of the new modular system. Signed-off-by: Jose R. Ziviani --- configure | 12 ++++++++++-- meson.build | 11 ++++++++++- meson_options.txt | 2 ++ 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 232c54dcc1..64d7a909ce 100755 --- a/configure +++ b/configure @@ -345,6 +345,7 @@ tsan=3D"no" fortify_source=3D"$default_feature" strip_opt=3D"yes" tcg_interpreter=3D"false" +tcg_builtin=3D"false" bigendian=3D"no" mingw32=3D"no" gcov=3D"no" @@ -1120,6 +1121,8 @@ for opt do ;; --enable-tcg) tcg=3D"enabled" ;; + --enable-tcg-builtin) tcg_builtin=3D"true" + ;; --disable-malloc-trim) malloc_trim=3D"disabled" ;; --enable-malloc-trim) malloc_trim=3D"enabled" @@ -1817,6 +1820,7 @@ Advanced options (experts only): Default:trace- --disable-slirp disable SLIRP userspace network connectivity --enable-tcg-interpreter enable TCI (TCG with bytecode interpreter, expe= rimental and slow) + --enable-tcg-builtin force TCG builtin even with --enable-modules --enable-malloc-trim enable libc malloc_trim() for memory optimizati= on --oss-lib path to OSS library --cpu=3DCPU Build for host CPU [$cpu] @@ -2318,7 +2322,11 @@ if test "$solaris" =3D "yes" ; then fi fi =20 -if test "$tcg" =3D "enabled"; then +if test "$tcg" =3D "disabled"; then + debug_tcg=3D"no" + tcg_interpreter=3D"false" + tcg_builtin=3D"false" +else git_submodules=3D"$git_submodules tests/fp/berkeley-testfloat-3" git_submodules=3D"$git_submodules tests/fp/berkeley-softfloat-3" fi @@ -5229,7 +5237,7 @@ if test "$skip_meson" =3D no; then -Dvhost_user_blk_server=3D$vhost_user_blk_server -Dmultiprocess=3D= $multiprocess \ -Dfuse=3D$fuse -Dfuse_lseek=3D$fuse_lseek -Dguest_agent_msi=3D$gue= st_agent_msi -Dbpf=3D$bpf\ $(if test "$default_features" =3D no; then echo "-Dauto_features= =3Ddisabled"; fi) \ - -Dtcg_interpreter=3D$tcg_interpreter \ + -Dtcg_interpreter=3D$tcg_interpreter -Dtcg_builtin=3D$tcg_builtin \ $cross_arg \ "$PWD" "$source_path" =20 diff --git a/meson.build b/meson.build index 2f377098d7..2909043aab 100644 --- a/meson.build +++ b/meson.build @@ -93,9 +93,13 @@ if cpu in ['x86', 'x86_64'] endif =20 modular_tcg =3D [] +is_tcg_modular =3D false # Darwin does not support references to thread-local variables in modules if targetos !=3D 'darwin' modular_tcg =3D ['i386-softmmu', 'x86_64-softmmu'] + is_tcg_modular =3D config_host.has_key('CONFIG_MODULES') \ + and get_option('tcg').enabled() \ + and not get_option('tcg_builtin') endif =20 edk2_targets =3D [ 'arm-softmmu', 'aarch64-softmmu', 'i386-softmmu', 'x86_= 64-softmmu' ] @@ -279,6 +283,9 @@ if not get_option('tcg').disabled() =20 accelerators +=3D 'CONFIG_TCG' config_host +=3D { 'CONFIG_TCG': 'y' } + if is_tcg_modular + config_host +=3D { 'CONFIG_TCG_MODULAR': 'y' } + endif endif =20 if 'CONFIG_KVM' not in accelerators and get_option('kvm').enabled() @@ -1567,7 +1574,7 @@ foreach target : target_dirs elif sym =3D=3D 'CONFIG_XEN' and have_xen_pci_passthrough config_target +=3D { 'CONFIG_XEN_PCI_PASSTHROUGH': 'y' } endif - if target in modular_tcg + if target in modular_tcg and is_tcg_modular config_target +=3D { 'CONFIG_TCG_MODULAR': 'y' } else config_target +=3D { 'CONFIG_TCG_BUILTIN': 'y' } @@ -2976,6 +2983,8 @@ summary_info +=3D {'TCG support': config_all.ha= s_key('CONFIG_TCG')} if config_all.has_key('CONFIG_TCG') if get_option('tcg_interpreter') summary_info +=3D {'TCG backend': 'TCI (TCG with bytecode interprete= r, experimental and slow)'} + elif is_tcg_modular + summary_info +=3D {'TCG backend': 'module (@0@)'.format(cpu)} else summary_info +=3D {'TCG backend': 'native (@0@)'.format(cpu)} endif diff --git a/meson_options.txt b/meson_options.txt index a9a9b8f4c6..c27749b864 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -43,6 +43,8 @@ option('tcg', type: 'feature', value: 'auto', description: 'TCG support') option('tcg_interpreter', type: 'boolean', value: false, description: 'TCG with bytecode interpreter (experimental and slow)= ') +option('tcg_builtin', type: 'boolean', value: 'false', + description: 'Force TCG builtin') option('cfi', type: 'boolean', value: 'false', description: 'Control-Flow Integrity (CFI)') option('cfi_debug', type: 'boolean', value: 'false', --=20 2.32.0