From patchwork Tue Jun 29 21:28:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jose R. Ziviani" X-Patchwork-Id: 12350853 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NORMAL_HTTP_TO_IP,NUMERIC_HTTP_ADDR,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86E49C11F67 for ; Tue, 29 Jun 2021 21:29:43 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 006C961D68 for ; Tue, 29 Jun 2021 21:29:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 006C961D68 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:42530 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lyLIc-0001t8-6P for qemu-devel@archiver.kernel.org; Tue, 29 Jun 2021 17:29:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34532) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lyLHg-0008J3-9n for qemu-devel@nongnu.org; Tue, 29 Jun 2021 17:28:44 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:49200) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lyLHd-0004im-Ox for qemu-devel@nongnu.org; Tue, 29 Jun 2021 17:28:43 -0400 Received: from imap.suse.de (imap-alt.suse-dmz.suse.de [192.168.254.47]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 9FE0921965; Tue, 29 Jun 2021 21:28:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1625002119; 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=cxjC9vg5O9h/KsgFbnL77+ujadx7CaW97/Uias2sZyU=; b=GY7VpbBbcnzUTedE35u/IFbqWYW9872vqWj9VzATXF6645EyATGnnlNvjObYdSGx4bJ3lH uRZMV/xGlYGB3I3x1tm7axjKCKDR2+NZzoRmayxEc16+QwmsJCHueYmljeGKLt/2DS+ZqR Sg6GFCdoCglf43BCz+jLGPSV86adqd8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1625002119; 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=cxjC9vg5O9h/KsgFbnL77+ujadx7CaW97/Uias2sZyU=; b=5jpAnh/J78rKJJgzcGXMxd9S9Ii/zBC+ggrgE//7WR9lRkVwKJA8Al1VOtui8pqUUJpu7B 6tlVK10xuBXvnrAQ== Received: from imap3-int (imap-alt.suse-dmz.suse.de [192.168.254.47]) by imap.suse.de (Postfix) with ESMTP id F08E311906; Tue, 29 Jun 2021 21:28:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1625002119; 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=cxjC9vg5O9h/KsgFbnL77+ujadx7CaW97/Uias2sZyU=; b=GY7VpbBbcnzUTedE35u/IFbqWYW9872vqWj9VzATXF6645EyATGnnlNvjObYdSGx4bJ3lH uRZMV/xGlYGB3I3x1tm7axjKCKDR2+NZzoRmayxEc16+QwmsJCHueYmljeGKLt/2DS+ZqR Sg6GFCdoCglf43BCz+jLGPSV86adqd8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1625002119; 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=cxjC9vg5O9h/KsgFbnL77+ujadx7CaW97/Uias2sZyU=; b=5jpAnh/J78rKJJgzcGXMxd9S9Ii/zBC+ggrgE//7WR9lRkVwKJA8Al1VOtui8pqUUJpu7B 6tlVK10xuBXvnrAQ== Received: from director2.suse.de ([192.168.254.72]) by imap3-int with ESMTPSA id aHshLYWQ22AtQQAALh3uQQ (envelope-from ); Tue, 29 Jun 2021 21:28:37 +0000 From: "Jose R. Ziviani" To: qemu-devel@nongnu.org Subject: [RFC 1/2] modules: Option to build native TCG with --enable-modules Date: Tue, 29 Jun 2021 18:28:18 -0300 Message-Id: <20210629212819.24389-2-jziviani@suse.de> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210629212819.24389-1-jziviani@suse.de> References: <20210629212819.24389-1-jziviani@suse.de> MIME-Version: 1.0 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: pbonzini@redhat.com, "Jose R. Ziviani" , kraxel@redhat.com, cfontana@suse.de Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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 the accelerator built-in and still take advantage of the new modular system. Signed-off-by: Jose R. Ziviani --- configure | 12 ++++++++++-- meson.build | 7 ++++++- meson_options.txt | 2 ++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 38704b4e11..add8cf4970 100755 --- a/configure +++ b/configure @@ -344,6 +344,7 @@ tsan="no" fortify_source="$default_feature" strip_opt="yes" tcg_interpreter="false" +tcg_builtin="false" bigendian="no" mingw32="no" gcov="no" @@ -1107,6 +1108,8 @@ for opt do ;; --enable-tcg) tcg="enabled" ;; + --enable-tcg-builtin) tcg_builtin="true" + ;; --disable-malloc-trim) malloc_trim="disabled" ;; --enable-malloc-trim) malloc_trim="enabled" @@ -1792,6 +1795,7 @@ Advanced options (experts only): Default:trace- --disable-slirp disable SLIRP userspace network connectivity --enable-tcg-interpreter enable TCI (TCG with bytecode interpreter, experimental and slow) + --enable-tcg-builtin force TCG builtin even with --enable-modules --enable-malloc-trim enable libc malloc_trim() for memory optimization --oss-lib path to OSS library --cpu=CPU Build for host CPU [$cpu] @@ -2288,7 +2292,11 @@ if test "$solaris" = "yes" ; then fi fi -if test "$tcg" = "enabled"; then +if test "$tcg" = "disabled"; then + debug_tcg="no" + tcg_interpreter="false" + tcg_builtin="false" +else git_submodules="$git_submodules tests/fp/berkeley-testfloat-3" git_submodules="$git_submodules tests/fp/berkeley-softfloat-3" fi @@ -6449,7 +6457,7 @@ if test "$skip_meson" = no; then -Dvhost_user_blk_server=$vhost_user_blk_server -Dmultiprocess=$multiprocess \ -Dfuse=$fuse -Dfuse_lseek=$fuse_lseek -Dguest_agent_msi=$guest_agent_msi -Dbpf=$bpf\ $(if test "$default_features" = no; then echo "-Dauto_features=disabled"; fi) \ - -Dtcg_interpreter=$tcg_interpreter \ + -Dtcg_interpreter=$tcg_interpreter -Dtcg_builtin=$tcg_builtin \ $cross_arg \ "$PWD" "$source_path" diff --git a/meson.build b/meson.build index fe58793549..2d72b8cc06 100644 --- a/meson.build +++ b/meson.build @@ -93,6 +93,9 @@ if cpu in ['x86', 'x86_64'] endif modular_tcg = ['i386-softmmu', 'x86_64-softmmu'] +is_tcg_modular = config_host.has_key('CONFIG_MODULES') \ + and get_option('tcg').enabled() \ + and not get_option('tcg_builtin') edk2_targets = [ 'arm-softmmu', 'aarch64-softmmu', 'i386-softmmu', 'x86_64-softmmu' ] install_edk2_blobs = false @@ -1313,7 +1316,7 @@ foreach target : target_dirs elif sym == 'CONFIG_XEN' and have_xen_pci_passthrough config_target += { 'CONFIG_XEN_PCI_PASSTHROUGH': 'y' } endif - if target in modular_tcg + if target in modular_tcg and is_tcg_modular config_target += { 'CONFIG_TCG_MODULAR': 'y' } else config_target += { 'CONFIG_TCG_BUILTIN': 'y' } @@ -2698,6 +2701,8 @@ summary_info += {'TCG support': config_all.has_key('CONFIG_TCG')} if config_all.has_key('CONFIG_TCG') if get_option('tcg_interpreter') summary_info += {'TCG backend': 'TCI (TCG with bytecode interpreter, experimental and slow)'} + elif is_tcg_modular + summary_info += {'TCG backend': 'module (@0@)'.format(cpu)} else summary_info += {'TCG backend': 'native (@0@)'.format(cpu)} endif diff --git a/meson_options.txt b/meson_options.txt index 3d304cac96..fd9f92b333 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', From patchwork Tue Jun 29 21:28:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jose R. Ziviani" X-Patchwork-Id: 12350851 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 891DDC11F68 for ; Tue, 29 Jun 2021 21:29:43 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E5F4D61CD8 for ; Tue, 29 Jun 2021 21:29:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E5F4D61CD8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:42590 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lyLIc-0001vh-1X for qemu-devel@archiver.kernel.org; Tue, 29 Jun 2021 17:29:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34544) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lyLHj-0008Ml-1S for qemu-devel@nongnu.org; Tue, 29 Jun 2021 17:28:47 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:49214) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lyLHh-0004kl-99 for qemu-devel@nongnu.org; Tue, 29 Jun 2021 17:28:46 -0400 Received: from imap.suse.de (imap-alt.suse-dmz.suse.de [192.168.254.47]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 8FA91226EA; Tue, 29 Jun 2021 21:28:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1625002123; 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=Qa+labxdjR4IyVCKDF0/nFJ1Fzb864WBc37lKGdMpLs=; b=yrEJe5GEVVOZzu8nDW7Zh79KTBNrxD5St3tBoLiUabVOGUrxuIUx2NU9F0la7kIdz4m8a6 BaPWDAdNcSuzpmPs564/iIjgBhzeOt3aB/TlnNIphR8nmtnxVh1biSRwu+XKTqS8bU83Yd B3ZQ/2StAjT0YR7tomifYHAdeqqJcFg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1625002123; 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=Qa+labxdjR4IyVCKDF0/nFJ1Fzb864WBc37lKGdMpLs=; b=TtvyH+2udh/bJ0EoqywGI4uVQW4WHUAHhv0Ly2BxLmYRLPcCRzJGMOV/BgQ+S16uDNdZNt lwk0FN5RjWUZtYBA== Received: from imap3-int (imap-alt.suse-dmz.suse.de [192.168.254.47]) by imap.suse.de (Postfix) with ESMTP id E1A9D11906; Tue, 29 Jun 2021 21:28:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1625002123; 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=Qa+labxdjR4IyVCKDF0/nFJ1Fzb864WBc37lKGdMpLs=; b=yrEJe5GEVVOZzu8nDW7Zh79KTBNrxD5St3tBoLiUabVOGUrxuIUx2NU9F0la7kIdz4m8a6 BaPWDAdNcSuzpmPs564/iIjgBhzeOt3aB/TlnNIphR8nmtnxVh1biSRwu+XKTqS8bU83Yd B3ZQ/2StAjT0YR7tomifYHAdeqqJcFg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1625002123; 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=Qa+labxdjR4IyVCKDF0/nFJ1Fzb864WBc37lKGdMpLs=; b=TtvyH+2udh/bJ0EoqywGI4uVQW4WHUAHhv0Ly2BxLmYRLPcCRzJGMOV/BgQ+S16uDNdZNt lwk0FN5RjWUZtYBA== Received: from director2.suse.de ([192.168.254.72]) by imap3-int with ESMTPSA id 0KNnKYmQ22AtQQAALh3uQQ (envelope-from ); Tue, 29 Jun 2021 21:28:41 +0000 From: "Jose R. Ziviani" To: qemu-devel@nongnu.org Subject: [RFC 2/2] modules: Fix warning in module_arch documentation Date: Tue, 29 Jun 2021 18:28:19 -0300 Message-Id: <20210629212819.24389-3-jziviani@suse.de> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210629212819.24389-1-jziviani@suse.de> References: <20210629212819.24389-1-jziviani@suse.de> MIME-Version: 1.0 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: pbonzini@redhat.com, "Jose R. Ziviani" , kraxel@redhat.com, cfontana@suse.de Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Fixes a small issue in the module_arch documentation that caused the build system to complain: module.h:127: warning: Function parameter or member 'name' not described in 'module_arch' module.h:127: warning: Excess function parameter 'arch' description in 'module_arch' Signed-off-by: Jose R. Ziviani --- include/qemu/module.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/qemu/module.h b/include/qemu/module.h index 8bc80535a4..456e190a55 100644 --- a/include/qemu/module.h +++ b/include/qemu/module.h @@ -115,7 +115,7 @@ void module_allow_arch(const char *arch); /** * module_arch * - * @arch: target architecture + * @name: module name * * This module is for target architecture @arch. *