[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 0/4] modules: add support for target-specific modules.
From: |
Gerd Hoffmann |
Subject: |
Re: [PATCH 0/4] modules: add support for target-specific modules. |
Date: |
Thu, 10 Jun 2021 15:10:44 +0200 |
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
- [PATCH 0/4] modules: add support for target-specific modules., Gerd Hoffmann, 2021/06/10
- [PATCH 1/4] modules: factor out arch check, Gerd Hoffmann, 2021/06/10
- [PATCH 2/4] modules: check arch on qom lookup, Gerd Hoffmann, 2021/06/10
- [PATCH 3/4] modules: target-specific module build infrastructure, Gerd Hoffmann, 2021/06/10
- [PATCH 4/4] modules: build virtio-9p modular, Gerd Hoffmann, 2021/06/10
- Re: [PATCH 0/4] modules: add support for target-specific modules., Claudio Fontana, 2021/06/10
- Re: [PATCH 0/4] modules: add support for target-specific modules., Gerd Hoffmann, 2021/06/10
- Re: [PATCH 0/4] modules: add support for target-specific modules.,
Gerd Hoffmann <=
- Re: [PATCH 0/4] modules: add support for target-specific modules., Claudio Fontana, 2021/06/10
- Re: [PATCH 0/4] modules: add support for target-specific modules., Paolo Bonzini, 2021/06/11
- Re: [PATCH 0/4] modules: add support for target-specific modules., Gerd Hoffmann, 2021/06/11
- Re: [PATCH 0/4] modules: add support for target-specific modules., Gerd Hoffmann, 2021/06/11
- Re: [PATCH 0/4] modules: add support for target-specific modules., Claudio Fontana, 2021/06/11
- Re: [PATCH 0/4] modules: add support for target-specific modules., José Ricardo Ziviani, 2021/06/14
- Re: [PATCH 0/4] modules: add support for target-specific modules., Gerd Hoffmann, 2021/06/15
- Re: [PATCH 0/4] modules: add support for target-specific modules., José Ricardo Ziviani, 2021/06/15
- Re: [PATCH 0/4] modules: add support for target-specific modules., Gerd Hoffmann, 2021/06/16
- Re: [PATCH 0/4] modules: add support for target-specific modules., Claudio Fontana, 2021/06/16