From nobody Mon Feb 9 23:40:20 2026 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; dmarc=pass(p=none dis=none) header.from=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1644226405; cv=none; d=zohomail.com; s=zohoarc; b=APMScMxqqhWMlbEM3Te8PqwJlTIpGaHItyQEBC7BA4VR6GEcPW86arHcgELH1JLPfRUXvC/GsQVbHcyt/n5W0Z4FhLdFrAmI2nfZrnTsssEiEWqQfeKEtqsr9NOkZDb5OTNjH7DvRCvgxIUbAmAM9rcZBrP7gKZG+si1WgsL7wo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1644226405; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=jA/zGq0i7Q1AJkyr3sqI0LygQvi9DNMNVaVAvFtIKuY=; b=mfcSvoG0grpxJykRHB9lhuY3q+dZIlaiGOpHn4jUN2XL3Gj8C1G9nnvtxb2YMVQKLwz2DMpZn3KnpUJ6CYHKaL7dGzgnS+S0HqJ6/qMSLxPy0LFSZTMBtoIjIZmDSFay9dbQ6SQm3wzTLBUfR6GVBDu1ePmOL+oGZMa5z3YgkZI= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1644226405122503.18898262073355; Mon, 7 Feb 2022 01:33:25 -0800 (PST) Received: from localhost ([::1]:59470 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nH0Oh-0002ff-SR for importer@patchew.org; Mon, 07 Feb 2022 04:33:23 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51208) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nGysz-00063t-FV for qemu-devel@nongnu.org; Mon, 07 Feb 2022 02:56:35 -0500 Received: from [2a00:1450:4864:20::329] (port=53793 helo=mail-wm1-x329.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nGysv-0002Ir-84 for qemu-devel@nongnu.org; Mon, 07 Feb 2022 02:56:31 -0500 Received: by mail-wm1-x329.google.com with SMTP id n8so9212155wmk.3 for ; Sun, 06 Feb 2022 23:56:01 -0800 (PST) Received: from localhost.localdomain (154.red-83-50-83.dynamicip.rima-tde.net. [83.50.83.154]) by smtp.gmail.com with ESMTPSA id l12sm3807977wrs.11.2022.02.06.23.56.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 06 Feb 2022 23:56:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jA/zGq0i7Q1AJkyr3sqI0LygQvi9DNMNVaVAvFtIKuY=; b=QLVEflRFJmDny8NAD6eca/CLGfpqmSlf0selnUFNV6IhmvmLi1rY8p7xrb5lUFx2qJ V87ElRakfTCzPcFmi8tVP2uh5EGK6RkkBJxnEG66dI6D5VvEpvcXe2m5KCRJchQWqnlP 6Q+1wzlo9+MQqcxYQd9IEW5lIdTSvxGkp/6EUdgGrn/HZdBCVRvIZ439Ddox6TxSTg7w NZDV5kMA0p2jEtiP/0ASFu6idrHX/+Fom64ly6MrVZ4exQfVWbOGF+HjK6T8awsoUsJt 70Jjqt/JNbRezGpGT3CnkeAbofpjXGpCUG+4MAL/C4DKrJ6ORz/nyGB4k8HTsIAazpZo 0XrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=jA/zGq0i7Q1AJkyr3sqI0LygQvi9DNMNVaVAvFtIKuY=; b=AFAIbRuUwJt9pGGr5LFdWVN7AqZCtFJ0xbJKimbFERO5GywZx/oK1Yv9bv8B1hgLZt m92hCYoHGvjlYHD7peexgTdb6CPIrpFnOPpF7DNblUjFKR7MhWx21verYpX6DPAyxZoa n8P4r+ihMRkDVRDCNP2i7A/QYvJImDs7jWtVg5G54K3aS8l3EHzjQy48URTOtccx2jHu IFfWatX8olBXmbj+Ywrdl7hYLYt+xzUd4kF/DRpvddaux13f3JGWfbhZ+qwggCddzN/8 Q4BmsQ84je9VxiDBXUWHF0Pej3qsmThZA8ci3XsLhQ5JDLVGpxz5A4jhsF7QwGXkx/jn UrWw== X-Gm-Message-State: AOAM530jAPPpjpVwzIMMpuZr3+sCsNQH5Tsri3/4do9VufN7sD9zSfsf 8ZUvd2LCaEG4rJdvaKtUb9E4Ci6OIA4= X-Google-Smtp-Source: ABdhPJyWIPdh0ZYJKEQ1lCJQVBCuCEKTe+/nuRtPehiIYFMWvEwzLys5o5wcdmvumZmJC9PJuC3klA== X-Received: by 2002:a7b:c1cb:: with SMTP id a11mr2982182wmj.111.1644220560842; Sun, 06 Feb 2022 23:56:00 -0800 (PST) To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 20/21] softmmu: Add qemu_init_arch_modules() Date: Mon, 7 Feb 2022 08:54:25 +0100 Message-Id: <20220207075426.81934-21-f4bug@amsat.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220207075426.81934-1-f4bug@amsat.org> References: <20220207075426.81934-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::329 (failed) 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=2a00:1450:4864:20::329; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x329.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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" Reply-to: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= via X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1644226406288100001 module_allow_arch() is the single target-specific call in the whole vl.c file. Move the module initialization out to arch_init.c, that way we'll be able to build vl.o once for all targets (the next commit). Reviewed-by: Paolo Bonzini Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/sysemu/arch_init.h | 2 ++ softmmu/arch_init.c | 9 +++++++++ softmmu/vl.c | 5 +---- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/include/sysemu/arch_init.h b/include/sysemu/arch_init.h index 70c579560a..79c2591425 100644 --- a/include/sysemu/arch_init.h +++ b/include/sysemu/arch_init.h @@ -28,4 +28,6 @@ enum { =20 extern const uint32_t arch_type; =20 +void qemu_init_arch_modules(void); + #endif diff --git a/softmmu/arch_init.c b/softmmu/arch_init.c index 8919405c7b..79716f959b 100644 --- a/softmmu/arch_init.c +++ b/softmmu/arch_init.c @@ -22,6 +22,7 @@ * THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qemu/module.h" #include "sysemu/arch_init.h" =20 #ifdef TARGET_SPARC @@ -39,3 +40,11 @@ int graphic_depth =3D 32; #endif =20 const uint32_t arch_type =3D QEMU_ARCH; + +void qemu_init_arch_modules(void) +{ +#ifdef CONFIG_MODULES + module_init_info(qemu_modinfo); + module_allow_arch(TARGET_NAME); +#endif +} diff --git a/softmmu/vl.c b/softmmu/vl.c index 5e1b35ba48..08ff97f4e0 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -2814,10 +2814,7 @@ void qemu_init(int argc, char **argv, char **envp) error_init(argv[0]); qemu_init_exec_dir(argv[0]); =20 -#ifdef CONFIG_MODULES - module_init_info(qemu_modinfo); - module_allow_arch(TARGET_NAME); -#endif + qemu_init_arch_modules(); =20 qemu_init_subsystems(); =20 --=20 2.34.1