From nobody Tue Feb 10 06:58:23 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=1643919241; cv=none; d=zohomail.com; s=zohoarc; b=VhAzKby9lk73D311emkYiWpFjumVLKtj83o+XpmFwa8IAJ95doKT6bMPm72v0rl5Pli7SZMnS4gux/q8g6MDa9YoFlE5l9eqODsq8QlXY2ayTBwOqh6JiPHDYnT+fOwSPOfTuoj9LnHw5fN9OMHifrApzzsg6o/dAxFmw13MJLM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1643919241; 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=msH7qg69hCRTFoTF2Q5gZeU9fIFrOr0593v5UHiptQg=; b=fy+AD51rWnR8+LQmRep7Vn1/Un9QI63+nLb58yxCYncRK/eXvLFIFF3gUQ8HKZvtCjxVrjzJABTZbSWSJLOYujYTFRbyLYrAWfLjMy9dwAQlBU6S9dM+Xk42HMt7vwEFfBGlis9szl9OH3WcizjVqhwAIqtX2fy86vIV+z0Ba70= 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 1643919241842182.5714171169709; Thu, 3 Feb 2022 12:14:01 -0800 (PST) Received: from localhost ([::1]:53262 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nFiUS-00036W-Vo for importer@patchew.org; Thu, 03 Feb 2022 15:14:01 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52216) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nFhg4-0003JM-87 for qemu-devel@nongnu.org; Thu, 03 Feb 2022 14:21:58 -0500 Received: from [2607:f8b0:4864:20::1033] (port=45719 helo=mail-pj1-x1033.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nFhfO-0002gd-2c for qemu-devel@nongnu.org; Thu, 03 Feb 2022 14:21:38 -0500 Received: by mail-pj1-x1033.google.com with SMTP id g15-20020a17090a67cf00b001b7d5b6bedaso3935420pjm.4 for ; Thu, 03 Feb 2022 11:21:00 -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 l26sm37134129pgm.73.2022.02.03.11.20.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Feb 2022 11:20:59 -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=msH7qg69hCRTFoTF2Q5gZeU9fIFrOr0593v5UHiptQg=; b=Gv83Npq66QIBvlqIVVM4outynwaVPa79Cc98c5B34pAvbUZBEg58bk8nEh0oUD2Ceq 9Te7q4uEjxV2tn4nfG5MEqXJa5J2ofjyK60/uU+M9t1kKsea+tAmtl9QWhdtLo85Mg7V +3bMYMKNgyJz5aQlM5IgxWDW9WZnQHMph3BtMl07mskBrgUdUAZndAyBhx+tutr2033H USs7qYjeuxmZD/cgFlvg3zU1Aihxj+NwgBg6EH4NPeW4716rRAtuEBOZElnRUAGL4Yuh ASuFIZHVg6HtnyBL/UyZ0drRw6Ol2q/4bN2f2lUd9gHj85ziDhElLwzFQYfWx1Oyc6DP kMJw== 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=msH7qg69hCRTFoTF2Q5gZeU9fIFrOr0593v5UHiptQg=; b=XniidTwaPjFFBmrc48DEp8edtfkf2d2qXIGYSNlPTNFuvsY2zkK4ad9+XXq9d7lI9s x1go7dOPSqHad+Dg+KYlYF4UtCYgve4QU4lPnu0qvGOFkAffw5rinGlBbUSQnEAsN0uE HObzGbPddzBOAc4nGKU0lpIo9eVbuk7D3G6ckm3NBSRnBinx6C66Ln9Hm60RUCTcXJpJ SURqogaNicmdIy197rJe+nU8okKOXHT3YsnbhsM4dwkwqpPOhIk8kKEHUSEuOhFSnRCJ j/nHkgEhAVtRL4FkRXSAF2T22emF5PQGWBKb7VMTFgUSC24VYQzM7ocgD3D5UYEf2yXt wuQQ== X-Gm-Message-State: AOAM530e/O5DdTBCWA9yAhEZY1S/KvjUMJknxJiU92ENZVI/SmoSe5v3 AENdGpspykYWiSac8CJkfwst+kKrcqY= X-Google-Smtp-Source: ABdhPJxdh68txC3Y4IBrDhLkSmxE6TgVO6FT9aSiAoftQCzb1+3GgJkOEd2ReSoyBUfCodYEXszQ7A== X-Received: by 2002:a17:902:d4ce:: with SMTP id o14mr37545383plg.39.1643916059493; Thu, 03 Feb 2022 11:20:59 -0800 (PST) To: qemu-devel@nongnu.org Cc: Richard Henderson , Thomas Huth , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 20/21] softmmu: Add qemu_init_arch_modules() Date: Thu, 3 Feb 2022 20:18:13 +0100 Message-Id: <20220203191814.45023-21-f4bug@amsat.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220203191814.45023-1-f4bug@amsat.org> References: <20220203191814.45023-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 2607:f8b0:4864:20::1033 (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=2607:f8b0:4864:20::1033; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-pj1-x1033.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.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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: 1643919245168100001 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). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- 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