* [Qemu-devel] [PATCH] Makefile: Move balloon.o, numa.o and bootdevice.o to common-obj-y
@ 2017-06-08 14:18 Thomas Huth
2017-06-08 14:37 ` Juan Quintela
2017-06-14 11:18 ` Thomas Huth
0 siblings, 2 replies; 5+ messages in thread
From: Thomas Huth @ 2017-06-08 14:18 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Paolo Bonzini, Juan Quintela, Andrew Jones
There does not seem to be any target specific code in these files, so
we can put them into "common-obj" instead of "obj" to compile them only
once for all targets.
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
Makefile.objs | 1 +
Makefile.target | 3 +--
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile.objs b/Makefile.objs
index 0575802..a949502 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -40,6 +40,7 @@ io-obj-y = io/
ifeq ($(CONFIG_SOFTMMU),y)
common-obj-y = blockdev.o blockdev-nbd.o block/
+common-obj-y += balloon.o numa.o bootdevice.o
common-obj-y += iothread.o
common-obj-y += net/
common-obj-y += qdev-monitor.o device-hotplug.o
diff --git a/Makefile.target b/Makefile.target
index ce8dfe4..da37258 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -139,8 +139,7 @@ endif #CONFIG_BSD_USER
#########################################################
# System emulator target
ifdef CONFIG_SOFTMMU
-obj-y += arch_init.o cpus.o monitor.o gdbstub.o balloon.o ioport.o numa.o
-obj-y += qtest.o bootdevice.o
+obj-y += arch_init.o cpus.o monitor.o gdbstub.o ioport.o qtest.o
obj-y += hw/
obj-$(CONFIG_KVM) += kvm-all.o
obj-y += memory.o cputlb.o
--
1.8.3.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] Makefile: Move balloon.o, numa.o and bootdevice.o to common-obj-y
2017-06-08 14:18 [Qemu-devel] [PATCH] Makefile: Move balloon.o, numa.o and bootdevice.o to common-obj-y Thomas Huth
@ 2017-06-08 14:37 ` Juan Quintela
2017-06-14 11:18 ` Thomas Huth
1 sibling, 0 replies; 5+ messages in thread
From: Juan Quintela @ 2017-06-08 14:37 UTC (permalink / raw)
To: Thomas Huth; +Cc: qemu-devel, qemu-trivial, Paolo Bonzini, Andrew Jones
Thomas Huth <thuth@redhat.com> wrote:
> There does not seem to be any target specific code in these files, so
> we can put them into "common-obj" instead of "obj" to compile them only
> once for all targets.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Again, nothing strange on that files that looks target specific.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] Makefile: Move balloon.o, numa.o and bootdevice.o to common-obj-y
2017-06-08 14:18 [Qemu-devel] [PATCH] Makefile: Move balloon.o, numa.o and bootdevice.o to common-obj-y Thomas Huth
2017-06-08 14:37 ` Juan Quintela
@ 2017-06-14 11:18 ` Thomas Huth
2017-06-14 11:25 ` Paolo Bonzini
1 sibling, 1 reply; 5+ messages in thread
From: Thomas Huth @ 2017-06-14 11:18 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Paolo Bonzini, Andrew Jones, Juan Quintela
On 08.06.2017 16:18, Thomas Huth wrote:
> There does not seem to be any target specific code in these files, so
> we can put them into "common-obj" instead of "obj" to compile them only
> once for all targets.
Self-NACK: balloon.c uses kvm_enabled() which in turn depends on
CONFIG_KVM ... and that flag is target-specific, so balloon.o can not be
moved to common-obj right now.
We should poison CONFIG_KVM for common code ... I'll have a look into
that...
Thomas
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] Makefile: Move balloon.o, numa.o and bootdevice.o to common-obj-y
2017-06-14 11:18 ` Thomas Huth
@ 2017-06-14 11:25 ` Paolo Bonzini
2017-06-16 11:03 ` Thomas Huth
0 siblings, 1 reply; 5+ messages in thread
From: Paolo Bonzini @ 2017-06-14 11:25 UTC (permalink / raw)
To: Thomas Huth, qemu-devel; +Cc: qemu-trivial, Andrew Jones, Juan Quintela
On 14/06/2017 13:18, Thomas Huth wrote:
> On 08.06.2017 16:18, Thomas Huth wrote:
>> There does not seem to be any target specific code in these files, so
>> we can put them into "common-obj" instead of "obj" to compile them only
>> once for all targets.
>
> Self-NACK: balloon.c uses kvm_enabled() which in turn depends on
> CONFIG_KVM ... and that flag is target-specific, so balloon.o can not be
> moved to common-obj right now.
>
> We should poison CONFIG_KVM for common code ... I'll have a look into
> that...
No, your patch is okay.
#if defined CONFIG_KVM || !defined NEED_CPU_H
#define kvm_enabled() (kvm_allowed)
...
#else
#define kvm_enabled() (0)
In other words, kvm_enabled() forces itself to be 0 only in per-target
files. This is done mostly to limit the number of required stubs:
target-independent APIs can be called from compile-once files and must
be stubbed; target-specific APIs can only be called from per-target
files, and their calls are culled by the compiler if !CONFIG_KVM.
Paolo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] Makefile: Move balloon.o, numa.o and bootdevice.o to common-obj-y
2017-06-14 11:25 ` Paolo Bonzini
@ 2017-06-16 11:03 ` Thomas Huth
0 siblings, 0 replies; 5+ messages in thread
From: Thomas Huth @ 2017-06-16 11:03 UTC (permalink / raw)
To: Paolo Bonzini, qemu-devel; +Cc: qemu-trivial, Andrew Jones, Juan Quintela
On 14.06.2017 13:25, Paolo Bonzini wrote:
>
>
> On 14/06/2017 13:18, Thomas Huth wrote:
>> On 08.06.2017 16:18, Thomas Huth wrote:
>>> There does not seem to be any target specific code in these files, so
>>> we can put them into "common-obj" instead of "obj" to compile them only
>>> once for all targets.
>>
>> Self-NACK: balloon.c uses kvm_enabled() which in turn depends on
>> CONFIG_KVM ... and that flag is target-specific, so balloon.o can not be
>> moved to common-obj right now.
>>
>> We should poison CONFIG_KVM for common code ... I'll have a look into
>> that...
>
> No, your patch is okay.
>
> #if defined CONFIG_KVM || !defined NEED_CPU_H
> #define kvm_enabled() (kvm_allowed)
> ...
> #else
> #define kvm_enabled() (0)
>
> In other words, kvm_enabled() forces itself to be 0 only in per-target
> files. This is done mostly to limit the number of required stubs:
> target-independent APIs can be called from compile-once files and must
> be stubbed; target-specific APIs can only be called from per-target
> files, and their calls are culled by the compiler if !CONFIG_KVM.
OK, thanks for the explanation!
... but I now think my patch is still wrong, due to another reason:
numa.o indirectly uses ram_addr_t variables, and these are target
specific, as far as I can see. So at least that file should not be moved
to common-obj-y.
Thomas
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-06-16 11:04 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-08 14:18 [Qemu-devel] [PATCH] Makefile: Move balloon.o, numa.o and bootdevice.o to common-obj-y Thomas Huth
2017-06-08 14:37 ` Juan Quintela
2017-06-14 11:18 ` Thomas Huth
2017-06-14 11:25 ` Paolo Bonzini
2017-06-16 11:03 ` Thomas Huth
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).