Message ID | 20200525145440.29728-2-cfontana@suse.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | QEMU cpus.c refactoring | expand |
On 5/25/20 4:54 PM, Claudio Fontana wrote: > move arch_init, balloon, cpus, ioport, memory, memory_mapping, qtest. > > They are all specific to CONFIG_SOFTMMU. > > Signed-off-by: Claudio Fontana <cfontana@suse.de> > --- > MAINTAINERS | 12 ++++++------ > Makefile.target | 7 ++----- > softmmu/Makefile.objs | 10 ++++++++++ > arch_init.c => softmmu/arch_init.c | 0 OK. > balloon.c => softmmu/balloon.c | 0 OK > cpus.c => softmmu/cpus.c | 0 I'm still not 100% convinced. > ioport.c => softmmu/ioport.c | 0 OK > memory.c => softmmu/memory.c | 0 OK > memory_mapping.c => softmmu/memory_mapping.c | 0 I am not sure (yet). > qtest.c => softmmu/qtest.c | 0 This one seems to belong to accel/ > 10 files changed, 18 insertions(+), 11 deletions(-) > rename arch_init.c => softmmu/arch_init.c (100%) > rename balloon.c => softmmu/balloon.c (100%) > rename cpus.c => softmmu/cpus.c (100%) > rename ioport.c => softmmu/ioport.c (100%) > rename memory.c => softmmu/memory.c (100%) > rename memory_mapping.c => softmmu/memory_mapping.c (100%) > rename qtest.c => softmmu/qtest.c (100%) What about the corresponding headers? [...]
On 5/25/20 5:12 PM, Philippe Mathieu-Daudé wrote: > On 5/25/20 4:54 PM, Claudio Fontana wrote: >> move arch_init, balloon, cpus, ioport, memory, memory_mapping, qtest. >> >> They are all specific to CONFIG_SOFTMMU. >> >> Signed-off-by: Claudio Fontana <cfontana@suse.de> >> --- >> MAINTAINERS | 12 ++++++------ >> Makefile.target | 7 ++----- >> softmmu/Makefile.objs | 10 ++++++++++ >> arch_init.c => softmmu/arch_init.c | 0 > > OK. > >> balloon.c => softmmu/balloon.c | 0 > > OK > >> cpus.c => softmmu/cpus.c | 0 > > I'm still not 100% convinced. Hi Philippe, do you see a reason to keep cpus.c in the top_srcdir? The way I see it, it belongs in softmmu/, we have a separate cpu-common.c that is target-indep and in common between user and softmmu, while cpus.c is softmmu-only right? > >> ioport.c => softmmu/ioport.c | 0 > > OK > >> memory.c => softmmu/memory.c | 0 > > OK > >> memory_mapping.c => softmmu/memory_mapping.c | 0 > > I am not sure (yet). headers are already in sysemu (sysemu/memory_mapping.h) > >> qtest.c => softmmu/qtest.c | 0 > > This one seems to belong to accel/ We already have accel/qtest.c , that is the qtest AccelClass. Here we are talking about qtest.c from the top_srcdir, which it the qtest server and is built with softmmu code, with header in sysemu/qtest.h Thomas? >> 10 files changed, 18 insertions(+), 11 deletions(-) >> rename arch_init.c => softmmu/arch_init.c (100%) >> rename balloon.c => softmmu/balloon.c (100%) >> rename cpus.c => softmmu/cpus.c (100%) >> rename ioport.c => softmmu/ioport.c (100%) >> rename memory.c => softmmu/memory.c (100%) >> rename memory_mapping.c => softmmu/memory_mapping.c (100%) >> rename qtest.c => softmmu/qtest.c (100%) > > What about the corresponding headers? headers already in sysemu/ : sysemu/arch_init.h sysemu/balloon.h sysemu/cpus.h sysemu/qtest.h - (again, for the qtest server) sysemu/memory_mapping.h headers currently in exec/ : exec/memory.h exec/ioport.h Paolo? > > [...] >
On 5/25/20 5:37 PM, Claudio Fontana wrote: > On 5/25/20 5:12 PM, Philippe Mathieu-Daudé wrote: >> On 5/25/20 4:54 PM, Claudio Fontana wrote: >>> move arch_init, balloon, cpus, ioport, memory, memory_mapping, qtest. >>> >>> They are all specific to CONFIG_SOFTMMU. >>> >>> Signed-off-by: Claudio Fontana <cfontana@suse.de> >>> --- >>> MAINTAINERS | 12 ++++++------ >>> Makefile.target | 7 ++----- >>> softmmu/Makefile.objs | 10 ++++++++++ >>> arch_init.c => softmmu/arch_init.c | 0 >> >> OK. >> >>> balloon.c => softmmu/balloon.c | 0 >> >> OK >> >>> cpus.c => softmmu/cpus.c | 0 >> >> I'm still not 100% convinced. > > Hi Philippe, do you see a reason to keep cpus.c in the top_srcdir? > > The way I see it, it belongs in softmmu/, > > we have a separate cpu-common.c that is target-indep and in common between user and softmmu, > while cpus.c is softmmu-only right? Sorry, I meant to say I need to look more in details at this file uses and will do a second review pass on your series. > > >> >>> ioport.c => softmmu/ioport.c | 0 >> >> OK >> >>> memory.c => softmmu/memory.c | 0 >> >> OK >> >>> memory_mapping.c => softmmu/memory_mapping.c | 0 >> >> I am not sure (yet). > > headers are already in sysemu (sysemu/memory_mapping.h) > >> >>> qtest.c => softmmu/qtest.c | 0 >> >> This one seems to belong to accel/ > > We already have accel/qtest.c , that is the qtest AccelClass. > > Here we are talking about qtest.c from the top_srcdir, which it the > qtest server and is built with softmmu code, with header in sysemu/qtest.h I haven't looked at it in detail but will. > > Thomas? > >>> 10 files changed, 18 insertions(+), 11 deletions(-) >>> rename arch_init.c => softmmu/arch_init.c (100%) >>> rename balloon.c => softmmu/balloon.c (100%) >>> rename cpus.c => softmmu/cpus.c (100%) >>> rename ioport.c => softmmu/ioport.c (100%) >>> rename memory.c => softmmu/memory.c (100%) >>> rename memory_mapping.c => softmmu/memory_mapping.c (100%) >>> rename qtest.c => softmmu/qtest.c (100%) >> >> What about the corresponding headers? > > headers already in sysemu/ : > > sysemu/arch_init.h > sysemu/balloon.h > sysemu/cpus.h > sysemu/qtest.h - (again, for the qtest server) > sysemu/memory_mapping.h > > headers currently in exec/ : > > exec/memory.h > exec/ioport.h Yes, if you want a clean separation, I'd rather restrict include/softmmu/ to softmmu builds. user-mode and tools builds shouldn't access these headers. > > Paolo? > >> >> [...] >> >
diff --git a/MAINTAINERS b/MAINTAINERS index 3690f313c3..0288ffbc50 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -114,7 +114,7 @@ Overall TCG CPUs M: Richard Henderson <rth@twiddle.net> R: Paolo Bonzini <pbonzini@redhat.com> S: Maintained -F: cpus.c +F: softmmu/cpus.c F: cpus-common.c F: exec.c F: accel/tcg/ @@ -1668,7 +1668,7 @@ M: David Hildenbrand <david@redhat.com> S: Maintained F: hw/virtio/virtio-balloon*.c F: include/hw/virtio/virtio-balloon.h -F: balloon.c +F: softmmu/balloon.c F: include/sysemu/balloon.h virtio-9p @@ -2110,12 +2110,12 @@ Memory API M: Paolo Bonzini <pbonzini@redhat.com> S: Supported F: include/exec/ioport.h -F: ioport.c F: include/exec/memop.h F: include/exec/memory.h F: include/exec/ram_addr.h F: include/exec/ramblock.h -F: memory.c +F: softmmu/ioport.c +F: softmmu/memory.c F: include/exec/memory-internal.h F: exec.c F: scripts/coccinelle/memory-region-housekeeping.cocci @@ -2147,7 +2147,7 @@ F: ui/cocoa.m Main loop M: Paolo Bonzini <pbonzini@redhat.com> S: Maintained -F: cpus.c +F: softmmu/cpus.c F: include/qemu/main-loop.h F: include/sysemu/runstate.h F: util/main-loop.c @@ -2306,7 +2306,7 @@ M: Thomas Huth <thuth@redhat.com> M: Laurent Vivier <lvivier@redhat.com> R: Paolo Bonzini <pbonzini@redhat.com> S: Maintained -F: qtest.c +F: softmmu/qtest.c F: accel/qtest.c F: tests/qtest/ diff --git a/Makefile.target b/Makefile.target index 8ed1eba95b..7fbf5d8b92 100644 --- a/Makefile.target +++ b/Makefile.target @@ -152,16 +152,13 @@ endif #CONFIG_BSD_USER ######################################################### # System emulator target ifdef CONFIG_SOFTMMU -obj-y += arch_init.o cpus.o gdbstub.o balloon.o ioport.o -obj-y += qtest.o +obj-y += softmmu/ +obj-y += gdbstub.o obj-y += dump/ obj-y += hw/ obj-y += monitor/ obj-y += qapi/ -obj-y += memory.o -obj-y += memory_mapping.o obj-y += migration/ram.o -obj-y += softmmu/ LIBS := $(libs_softmmu) $(LIBS) # Hardware support diff --git a/softmmu/Makefile.objs b/softmmu/Makefile.objs index dd15c24346..a4bd9f2f52 100644 --- a/softmmu/Makefile.objs +++ b/softmmu/Makefile.objs @@ -1,3 +1,13 @@ softmmu-main-y = softmmu/main.o + +obj-y += arch_init.o +obj-y += cpus.o +obj-y += balloon.o +obj-y += ioport.o +obj-y += memory.o +obj-y += memory_mapping.o + +obj-y += qtest.o + obj-y += vl.o vl.o-cflags := $(GPROF_CFLAGS) $(SDL_CFLAGS) diff --git a/arch_init.c b/softmmu/arch_init.c similarity index 100% rename from arch_init.c rename to softmmu/arch_init.c diff --git a/balloon.c b/softmmu/balloon.c similarity index 100% rename from balloon.c rename to softmmu/balloon.c diff --git a/cpus.c b/softmmu/cpus.c similarity index 100% rename from cpus.c rename to softmmu/cpus.c diff --git a/ioport.c b/softmmu/ioport.c similarity index 100% rename from ioport.c rename to softmmu/ioport.c diff --git a/memory.c b/softmmu/memory.c similarity index 100% rename from memory.c rename to softmmu/memory.c diff --git a/memory_mapping.c b/softmmu/memory_mapping.c similarity index 100% rename from memory_mapping.c rename to softmmu/memory_mapping.c diff --git a/qtest.c b/softmmu/qtest.c similarity index 100% rename from qtest.c rename to softmmu/qtest.c
move arch_init, balloon, cpus, ioport, memory, memory_mapping, qtest. They are all specific to CONFIG_SOFTMMU. Signed-off-by: Claudio Fontana <cfontana@suse.de> --- MAINTAINERS | 12 ++++++------ Makefile.target | 7 ++----- softmmu/Makefile.objs | 10 ++++++++++ arch_init.c => softmmu/arch_init.c | 0 balloon.c => softmmu/balloon.c | 0 cpus.c => softmmu/cpus.c | 0 ioport.c => softmmu/ioport.c | 0 memory.c => softmmu/memory.c | 0 memory_mapping.c => softmmu/memory_mapping.c | 0 qtest.c => softmmu/qtest.c | 0 10 files changed, 18 insertions(+), 11 deletions(-) rename arch_init.c => softmmu/arch_init.c (100%) rename balloon.c => softmmu/balloon.c (100%) rename cpus.c => softmmu/cpus.c (100%) rename ioport.c => softmmu/ioport.c (100%) rename memory.c => softmmu/memory.c (100%) rename memory_mapping.c => softmmu/memory_mapping.c (100%) rename qtest.c => softmmu/qtest.c (100%)