From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51883) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VFPu7-0007cJ-7Z for qemu-devel@nongnu.org; Fri, 30 Aug 2013 10:42:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VFPu2-0006vC-3v for qemu-devel@nongnu.org; Fri, 30 Aug 2013 10:42:27 -0400 Received: from cantor2.suse.de ([195.135.220.15]:45969 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VFPu1-0006v2-Ps for qemu-devel@nongnu.org; Fri, 30 Aug 2013 10:42:22 -0400 Message-ID: <5220AF4A.9050602@suse.de> Date: Fri, 30 Aug 2013 16:42:18 +0200 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1375203359-17562-1-git-send-email-afaerber@suse.de> <520B6EAC.10006@suse.de> In-Reply-To: <520B6EAC.10006@suse.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH qom-cpu for-next 0/2] QOM CPUState, part 12: CPU loops, revisited List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Eduardo Habkost , "Michael S. Tsirkin" , Riku Voipio , Alexander Graf , Markus Armbruster , Blue Swirl , Anthony Liguori , Igor Mammedov , Paolo Bonzini , =?UTF-8?B?QXVyw6lsaWVuIEphcm5v?= Am 14.08.2013 13:49, schrieb Andreas F=C3=A4rber: > Am 30.07.2013 18:55, schrieb Andreas F=C3=A4rber: >> Hello everyone, >> >> A short CPUState series for a change: This mini-series replaces our ho= me-grown >> CPU list (first_cpu global and CPUState::next_cpu) with a QTAILQ. >> >> To avoid repeated QTAILQ_FOREACH(foo, cpus, node) I am proposing a wra= pper >> CPU_FOREACH(foo) to hide the implementation details, as requested by m= st, >> while keeping inline loops, as requested by Markus. >> >> The bulk of patch 1 is mechanical for/while loop conversions, except f= or: >> exec.c: QTAILQ_INSERT_TAIL() >> linux-user/syscall.c: QTAILQ_REMOVE() -- untested! >=20 > Ping! The 1.7 merge window is approaching and Michael has ack'ed > adopting the macros introduced in patch 1/2, but that patch has no > review or test reports yet. Riku? Peter? Alex? Applied to qom-cpu: https://github.com/afaerber/qemu-cpu/commits/qom-cpu Andreas >=20 > Latest rebased version on qom-cpu-12 branch. >=20 > Regards, > Andreas >=20 >> Having such a stable API will help with vCPU hot-unplug. >> >> Patch 2 is controversial: It drops qemu_for_each_cpu() on Markus' requ= est. >> I'm including it as RFC to showcase what exactly those suggestions inv= olve. >> Converting from for (cpu =3D ...) to CPU_FOREACH(cpu) is obviously muc= h more >> straightforward than converting between function and loop, therefore w= ith >> patch 1 in mind, it seems best to still use for loops, which since rec= ently >> no longer require CPUArchState, the original trigger for qemu_for_each= _cpu(). >> >> Available for testing at: >> git://github.com/afaerber/qemu-cpu.git qom-cpu-12.v1 >> https://github.com/afaerber/qemu-cpu/commits/qom-cpu-12.v1 >> >> Regards, >> Andreas >> >> From CPUState part 10 v1: >> * Instead of replacing every loop with qemu_for_each_cpu() >> replace loops with CPU_FOREACH() macro, based on QTAILQ_FOREACH(). >> >> Cc: Markus Armbruster >> Cc: Michael S. Tsirkin >> Cc: Anthony Liguori >> Cc: Blue Swirl >> Cc: Aur=C3=A9lien Jarno >> Cc: Paolo Bonzini >> Cc: Eduardo Habkost >> Cc: Igor Mammedov >> Cc: Riku Voipio >> >> Andreas F=C3=A4rber (2): >> cpu: Use QTAILQ for CPU list >> cpu: Replace qemu_for_each_cpu() >> >> arch_init.c | 11 ++++----- >> cpus.c | 58 ++++++++++++++++++++------------------= --------- >> cputlb.c | 2 +- >> dump.c | 10 ++++---- >> exec.c | 33 ++++++++------------------- >> gdbstub.c | 14 ++++++------ >> hw/acpi/piix4.c | 20 ++++++++-------- >> hw/arm/boot.c | 2 +- >> hw/i386/kvm/clock.c | 2 +- >> hw/i386/kvmvapic.c | 2 +- >> hw/i386/pc.c | 3 +-- >> hw/ppc/e500.c | 2 +- >> hw/ppc/ppc.c | 2 +- >> hw/ppc/spapr.c | 4 ++-- >> include/qom/cpu.h | 20 ++++++++-------- >> kvm-all.c | 8 +++---- >> linux-user/elfload.c | 2 +- >> linux-user/main.c | 10 +++++--- >> linux-user/syscall.c | 17 ++------------ >> memory_mapping.c | 5 ++-- >> monitor.c | 2 +- >> qom/cpu.c | 30 ++++++++---------------- >> target-i386/helper.c | 3 +-- >> target-i386/misc_helper.c | 2 +- >> target-mips/op_helper.c | 10 ++++---- >> target-ppc/excp_helper.c | 2 +- >> translate-all.c | 4 ++-- >> 27 files changed, 113 insertions(+), 167 deletions(-) >> >=20 >=20 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg