From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42671) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCuTi-0005j9-61 for qemu-devel@nongnu.org; Wed, 08 Jul 2015 14:53:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZCuTe-0004DC-VY for qemu-devel@nongnu.org; Wed, 08 Jul 2015 14:53:54 -0400 Received: from cantor2.suse.de ([195.135.220.15]:43026 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCuTe-0004Cv-M7 for qemu-devel@nongnu.org; Wed, 08 Jul 2015 14:53:50 -0400 Message-ID: <559D71BB.50202@suse.de> Date: Wed, 08 Jul 2015 20:53:47 +0200 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1436289389-5403-1-git-send-email-afaerber@suse.de> <559D6034.7060200@suse.de> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PULL v2 00/22] QOM CPUState patch queue 2015-07-07 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Peter Crosthwaite , Eduardo Habkost , Alexander Graf , QEMU Developers , Bharata B Rao , Paolo Bonzini , David Gibson Am 08.07.2015 um 20:50 schrieb Peter Maydell: > On 8 July 2015 at 18:39, Andreas F=C3=A4rber wrote: >> Am 08.07.2015 um 13:33 schrieb Peter Maydell: >>> On 7 July 2015 at 18:16, Andreas F=C3=A4rber wrote= : >>>> Hello Peter, >>>> >>>> This is my QOM CPU patch queue. Please pull. >>>> >>>> Note: For time reasons I did not give this queue as much testing as = usual, >>>> in particular BSD and non-x86 KVM hosts were not covered. >>>> >>>> Regards, >>>> Andreas >>>> >>>> Cc: Peter Maydell >>>> >>>> Cc: Eduardo Habkost >>>> Cc: Peter Crosthwaite >>>> >>>> The following changes since commit f2562fbb7ac54d597cfe05f613d30296d= 1850d1b: >>>> >>>> Merge remote-tracking branch 'remotes/stefanha/tags/net-pull-reque= st' into staging (2015-07-07 15:48:49 +0100) >>>> >>>> are available in the git repository at: >>>> >>>> git://github.com/afaerber/qemu-cpu.git tags/qom-cpu-for-peter >>>> >>>> for you to fetch changes up to cf6f1442257d53cf617545dd150efe26771ec= 31c: >>>> >>>> disas: cris: QOMify target specific disas setup (2015-07-07 18:35:= 39 +0200) >>>> >>>> ---------------------------------------------------------------- >>>> QOM CPUState and X86CPU >>>> >>>> * Further QOM'ification of CPU initialization >>>> * Propagation of CPUState arguments and elimination of ENV_GET_CPU()= usage >>>> * cpu_set_pc() abstraction >>>> * CPUClass::disas_set_info() hook >>> >>> I'm afraid this seems to break ppc linux-user somehow: >>> >>> e104462:trusty:linux-user-test-0.3$ gdb --args >>> /home/petmay01/linaro/qemu-for-merges/build/all-linux-static/ppc-linu= x-user/qemu-ppc >>> -L ./gnemul/qemu-ppc ppc/ls -l dummyfile >>> GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1 >>> Copyright (C) 2014 Free Software Foundation, Inc. >>> License GPLv3+: GNU GPL version 3 or later >>> This is free software: you are free to change and redistribute it. >>> There is NO WARRANTY, to the extent permitted by law. Type "show cop= ying" >>> and "show warranty" for details. >>> This GDB was configured as "x86_64-linux-gnu". >>> Type "show configuration" for configuration details. >>> For bug reporting instructions, please see: >>> . >>> Find the GDB manual and other documentation resources online at: >>> . >>> For help, type "help". >>> Type "apropos word" to search for commands related to "word"... >>> Reading symbols from >>> /home/petmay01/linaro/qemu-for-merges/build/all-linux-static/ppc-linu= x-user/qemu-ppc...done. >>> (gdb) handle SIGUSR1 pass noprint nostop >>> Signal Stop Print Pass to program Description >>> SIGUSR1 No No Yes User defined signal 1 >>> (gdb) r >>> Starting program: >>> /home/petmay01/linaro/qemu-for-merges/build/all-linux-static/ppc-linu= x-user/qemu-ppc >>> -L ./gnemul/qemu-ppc ppc/ls -l dummyfile >>> [Thread debugging using libthread_db enabled] >>> Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.s= o.1". >>> [New Thread 0x7ffff7ffc700 (LWP 22653)] >>> >>> Program received signal SIGSEGV, Segmentation fault. >>> 0x000000006060dd85 in static_code_gen_buffer () >>> (gdb) bt >>> #0 0x000000006060dd85 in static_code_gen_buffer () >>> #1 0x00000000600065e3 in cpu_tb_exec (cpu=3D0x6268ceb0, >>> tb_ptr=3D0x6060dd50 >>> "A\213n\374\205\355\017\205", ) >>> at /home/petmay01/linaro/qemu-for-merges/cpu-exec.c:200 >>> #2 0x0000000060006fbc in cpu_ppc_exec (cpu=3D0x6268ceb0) at >>> /home/petmay01/linaro/qemu-for-merges/cpu-exec.c:518 >>> #3 0x0000000060049dc2 in cpu_loop (env=3D0x62695100) at >>> /home/petmay01/linaro/qemu-for-merges/linux-user/main.c:1568 >>> #4 0x000000006004cac5 in main (argc=3D6, argv=3D0x7fffffffe3f8, >>> envp=3D0x7fffffffe430) >>> at /home/petmay01/linaro/qemu-for-merges/linux-user/main.c:4408 >> >> a7bebe297accafc0fa75a5f76767e6b856e6d5eb is the first bad commit >> commit a7bebe297accafc0fa75a5f76767e6b856e6d5eb >> Author: Bharata B Rao >> Date: Tue Jun 23 19:31:14 2015 -0700 >> >> target-ppc: Move cpu_exec_init() call to realize function >> >> Move cpu_exec_init() call from instance_init to realize. This allo= ws >> any failures from cpu_exec_init() to be handled appropriately. >> Also add corresponding cpu_exec_exit() call from unrealize. >> >> cpu_dt_id assignment from instance_init is no longer needed since >> correct assignment for cpu_dt_id is already present in realizefn. >> >> Signed-off-by: Bharata B Rao >> Reviewed-by: David Gibson >> Reviewed-by: Peter Crosthwaite >> Acked-by: Paolo Bonzini >> Signed-off-by: Peter Crosthwaite >> Signed-off-by: Andreas F=C3=A4rber >> >> :040000 040000 9f5a59e2b3237877cb8940f744beeb5a304a5620 >> 171e8f34622f032c8d36c98eb3ee1f513ec6d5ef M target-ppc >> >> Patch is fairly small, but I don't spot anything immediately. >=20 > The call to cpu_exec_init() appears to have been > moved to inside an #if !defined(CONFIG_USER_ONLY) block... Indeed, the following fixes it. diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c index 2b72f2d..82854a8 100644 --- a/target-ppc/translate_init.c +++ b/target-ppc/translate_init.c @@ -8927,12 +8927,15 @@ static void ppc_cpu_realizefn(DeviceState *dev, Error **errp) smp_threads, kvm_enabled() ? "KVM" : "TCG"); return; } +#endif cpu_exec_init(&cpu->env, &local_err); if (local_err !=3D NULL) { error_propagate(errp, local_err); return; } + +#if !defined(CONFIG_USER_ONLY) cpu->cpu_dt_id =3D (cs->cpu_index / smp_threads) * max_smt + (cs->cpu_index % smp_threads); #endif Thanks, Andreas --=20 SUSE Linux GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Felix Imend=C3=B6rffer, Jane Smithard, Dilip Upmanyu, Graham Norton; = HRB 21284 (AG N=C3=BCrnberg)