qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Claudio Fontana <cfontana@suse.de>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	"Christian Schoenebeck" <qemu_oss@crudebyte.com>,
	"Greg Kurz" <groug@kaod.org>,
	qemu-devel@nongnu.org, jose.ziviani@suse.com,
	pbonzini@redhat.com, "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Subject: Re: [PATCH 0/4] modules: add support for target-specific modules.
Date: Thu, 10 Jun 2021 15:10:44 +0200	[thread overview]
Message-ID: <20210610131044.32iioustv7vev4p5@sirius.home.kraxel.org> (raw)
In-Reply-To: <20210610122305.zxdaqsft5evcrli6@sirius.home.kraxel.org>

  Hi,

> Build qtest modular on top of that was easy, patch below.
> 
> I'm not convinced though that the approach will work for other
> accelerators too given that they have dependencies to directories
> outside accel/ ...

Oh, it depends on how high you hang the tcg modularization bar.

Building only the tcg accel ops as module is easy too, but that
of course leaves a large chunk of tcg linked into qemu itself.

take care,
  Gerd

From 8062aabd26f12bd8199b43c631a3aba8f195183e Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Thu, 10 Jun 2021 14:48:20 +0200
Subject: [PATCH] modules: build tcg accel modular
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

It's not all of tcg, only the accel ops, but its a start 😊

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 accel/accel-softmmu.c     | 2 +-
 accel/tcg/tcg-accel-ops.c | 2 ++
 accel/tcg/meson.build     | 6 ++++++
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/accel/accel-softmmu.c b/accel/accel-softmmu.c
index 50fa5acaa401..67276e4f5222 100644
--- a/accel/accel-softmmu.c
+++ b/accel/accel-softmmu.c
@@ -72,7 +72,7 @@ void accel_init_ops_interfaces(AccelClass *ac)
     g_assert(ac_name != NULL);
 
     ops_name = g_strdup_printf("%s" ACCEL_OPS_SUFFIX, ac_name);
-    ops = ACCEL_OPS_CLASS(object_class_by_name(ops_name));
+    ops = ACCEL_OPS_CLASS(module_object_class_by_name(ops_name));
     g_free(ops_name);
 
     /*
diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c
index 7191315aeed4..432a76d2ea29 100644
--- a/accel/tcg/tcg-accel-ops.c
+++ b/accel/tcg/tcg-accel-ops.c
@@ -124,9 +124,11 @@ static const TypeInfo tcg_accel_ops_type = {
     .class_init = tcg_accel_ops_class_init,
     .abstract = true,
 };
+module_obj("tcg-accel-ops"); // FIXME: use ACCEL_OPS_NAME
 
 static void tcg_accel_ops_register_types(void)
 {
     type_register_static(&tcg_accel_ops_type);
 }
 type_init(tcg_accel_ops_register_types);
+module_arch(TARGET_NAME);
diff --git a/accel/tcg/meson.build b/accel/tcg/meson.build
index 1236ac7b910b..0362b1bd5918 100644
--- a/accel/tcg/meson.build
+++ b/accel/tcg/meson.build
@@ -15,8 +15,14 @@ specific_ss.add_all(when: 'CONFIG_TCG', if_true: tcg_ss)
 
 specific_ss.add(when: ['CONFIG_SOFTMMU', 'CONFIG_TCG'], if_true: files(
   'cputlb.c',
+))
+
+tcg_module_ss = ss.source_set()
+tcg_module_ss.add(when: ['CONFIG_SOFTMMU', 'CONFIG_TCG'], if_true: files(
   'tcg-accel-ops.c',
   'tcg-accel-ops-mttcg.c',
   'tcg-accel-ops-icount.c',
   'tcg-accel-ops-rr.c'
 ))
+
+accel_modules += {'tcg': tcg_module_ss }
-- 
2.31.1



  reply	other threads:[~2021-06-10 13:12 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-10 10:15 [PATCH 0/4] modules: add support for target-specific modules Gerd Hoffmann
2021-06-10 10:15 ` [PATCH 1/4] modules: factor out arch check Gerd Hoffmann
2021-06-10 10:15 ` [PATCH 2/4] modules: check arch on qom lookup Gerd Hoffmann
2021-06-10 10:15 ` [PATCH 3/4] modules: target-specific module build infrastructure Gerd Hoffmann
2021-06-10 10:15 ` [PATCH 4/4] modules: build virtio-9p modular Gerd Hoffmann
2021-06-10 10:34 ` [PATCH 0/4] modules: add support for target-specific modules Claudio Fontana
2021-06-10 12:23   ` Gerd Hoffmann
2021-06-10 13:10     ` Gerd Hoffmann [this message]
2021-06-10 13:12     ` Claudio Fontana
2021-06-11  7:35       ` Paolo Bonzini
2021-06-11  8:29         ` Gerd Hoffmann
2021-06-11 13:03           ` Gerd Hoffmann
2021-06-11 13:17             ` Claudio Fontana
2021-06-14 22:19             ` José Ricardo Ziviani
2021-06-15  5:09               ` Gerd Hoffmann
2021-06-15 15:48                 ` José Ricardo Ziviani
2021-06-16  9:28                   ` Gerd Hoffmann
2021-06-16 12:23                     ` Claudio Fontana
2021-06-17  5:37                       ` Gerd Hoffmann
2021-06-17  7:48                         ` Claudio Fontana
2021-06-17  9:48                           ` Gerd Hoffmann
2021-06-17 10:07                             ` Claudio Fontana
2021-06-11 17:14           ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210610131044.32iioustv7vev4p5@sirius.home.kraxel.org \
    --to=kraxel@redhat.com \
    --cc=cfontana@suse.de \
    --cc=f4bug@amsat.org \
    --cc=groug@kaod.org \
    --cc=jose.ziviani@suse.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu_oss@crudebyte.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).