From patchwork Fri Sep 17 01:29:02 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: 12500749 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=-11.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 83316C433EF for ; Fri, 17 Sep 2021 01:31:27 +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 25B4C61250 for ; Fri, 17 Sep 2021 01:31:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 25B4C61250 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:58324 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mR2is-0001R6-3H for qemu-devel@archiver.kernel.org; Thu, 16 Sep 2021 21:31:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41696) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mR2gn-0008TO-Pr for qemu-devel@nongnu.org; Thu, 16 Sep 2021 21:29:17 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:60970) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mR2gl-00025k-Ta for qemu-devel@nongnu.org; Thu, 16 Sep 2021 21:29:17 -0400 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (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-out2.suse.de (Postfix) with ESMTPS id 8919220253; Fri, 17 Sep 2021 01:29:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1631842152; 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; bh=qgoBTTcrjNtVSqkcuQg2WhpvsXCzO7irXfv7JGSR9pQ=; b=q0ZY3UvGHC5S/30bgGJwwDJ/OBPDdVWtKAw/1TD76J8Hrw/CREeJJZOIHS7r984DI8HDBA pn7iftX9ZPU0fCiOt+7TYsdsNQUM3aZApnR+iBzyrir+ytTv2iyS1WtC2aKODebsYe/Gmj wivaBuq+Wk3LwIJcA1tTpfn6/6Y5j1k= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1631842152; 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; bh=qgoBTTcrjNtVSqkcuQg2WhpvsXCzO7irXfv7JGSR9pQ=; b=2ZfbR2cvF1VRyE/K1Am6WmdEezKv6xSN104Im0iAW9jzt1bA8/rU0GQw7vE1A0KeQNN/E0 wMFr36aXVxZw90AQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (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 imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 0AFB713DEF; Fri, 17 Sep 2021 01:29:10 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id EWQgL2bvQ2GsFgAAMHmgww (envelope-from ); Fri, 17 Sep 2021 01:29:10 +0000 From: "Jose R. Ziviani" To: qemu-devel@nongnu.org Subject: [PATCH 0/2] modules: Improve modinfo.c architecture support Date: Thu, 16 Sep 2021 22:29:02 -0300 Message-Id: <20210917012904.26544-1-jziviani@suse.de> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Received-SPF: pass client-ip=195.135.220.29; envelope-from=jziviani@suse.de; helo=smtp-out2.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, kraxel@redhat.com, "Jose R. Ziviani" Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" When building a single target, the build system detects the architecture and generates a modinfo.c with modules related to that arch only. However, when more than one target is built, modinfo.c is generated with modules available for each architecture - without any way to know what arch supports what. The problem is when executing the target, it will try to load modules that is not supported by it and will throw errors to users, for instance: $ ./configure --enable-modules # all targets $ ./qemu-system-avr -nodefaults -display none -accel tcg -M none -device help | head Failed to open module: /.../hw-display-qxl.so: undefined symbol: vga_ioport_read Failed to open module: /.../hw-display-virtio-gpu.so: undefined symbol: virtio_vmstate_info Failed to open module: /.../hw-display-virtio-gpu.so: undefined symbol: virtio_vmstate_info Failed to open module: /.../hw-display-virtio-gpu-gl.so: undefined symbol: virtio_gpu_ctrl_response Failed to open module: /.../hw-display-virtio-gpu-pci.so: undefined symbol: virtio_instance_init_common Failed to open module: /.../hw-display-virtio-gpu-pci.so: undefined symbol: virtio_instance_init_common Failed to open module: /.../hw-display-virtio-gpu-pci-gl.so: undefined symbol: virtio_instance_init_common Failed to open module: /.../hw-display-virtio-vga.so: undefined symbol: vmstate_vga_common Failed to open module: /.../hw-display-virtio-vga.so: undefined symbol: vmstate_vga_common Failed to open module: /.../hw-display-virtio-vga-gl.so: undefined symbol: have_vga Failed to open module: /.../hw-usb-smartcard.so: undefined symbol: ccid_card_ccid_attach Failed to open module: /.../hw-usb-redirect.so: undefined symbol: vmstate_usb_device Failed to open module: /.../hw-usb-host.so: undefined symbol: vmstate_usb_device ... $ ./qemu-system-s390x -nodefaults -display none -accel tcg -M none -device help | head Failed to open module: /.../hw-display-qxl.so: undefined symbol: vga_ioport_read Failed to open module: /.../hw-display-virtio-vga.so: undefined symbol: vmstate_vga_common Failed to open module: /.../hw-display-virtio-vga.so: undefined symbol: vmstate_vga_common Failed to open module: /.../hw-display-virtio-vga-gl.so: undefined symbol: have_vga Failed to open module: /.../hw-usb-smartcard.so: undefined symbol: ccid_card_ccid_attach Failed to open module: /.../hw-usb-redirect.so: undefined symbol: vmstate_usb_device Failed to open module: /.../hw-usb-host.so: undefined symbol: vmstate_usb_device This patchset tries to improve by collecting the modules are currently enabled for each target, obtaining information in meson from kconfig and passing that to modinfo.c, which now uses a list to store supported architectures for each module. $ ./qemu-system-s390x -nodefaults -display none -accel tcg -M none -device help | head Controller/Bridge/Hub devices: name "pci-bridge", bus PCI, desc "Standard PCI Bridge" name "pci-bridge-seat", bus PCI, desc "Standard PCI Bridge (multiseat)" ... $ ./qemu-system-avr -nodefaults -display none -accel tcg -M none -device help | head ... Misc devices: name "guest-loader", desc "Guest Loader" name "loader", desc "Generic Loader" Jose R. Ziviani (2): meson: introduce modules_arch modules: use a list of supported arch for each module hw/display/meson.build | 48 +++++++++++++++++++++++++++++++++++++ hw/usb/meson.build | 36 ++++++++++++++++++++++++++++ include/qemu/module.h | 2 +- meson.build | 19 +++++++++++---- scripts/modinfo-collect.py | 10 ++++++++ scripts/modinfo-generate.py | 7 +++--- util/module.c | 18 ++++++++++---- 7 files changed, 125 insertions(+), 15 deletions(-)