From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40466) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8Ody-0006WX-4M for qemu-devel@nongnu.org; Fri, 26 Jun 2015 04:05:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z8Odt-0000mp-OI for qemu-devel@nongnu.org; Fri, 26 Jun 2015 04:05:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36714) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8Odt-0000mj-H8 for qemu-devel@nongnu.org; Fri, 26 Jun 2015 04:05:45 -0400 Date: Fri, 26 Jun 2015 10:05:38 +0200 From: Andrew Jones Message-ID: <20150626080538.GD3682@hawk.localdomain> References: <1435160084-938-1-git-send-email-alex.bennee@linaro.org> <558AD458.4000905@redhat.com> <87y4j9xbxh.fsf@linaro.org> <20150625154432.GA6535@hawk.localdomain> <878ub7aqy8.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <878ub7aqy8.fsf@linaro.org> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC PATCH] target-arm/psci.c: wake up sleeping CPUs (MTTCG) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex =?iso-8859-1?Q?Benn=E9e?= Cc: mttcg@greensocs.com, Peter Maydell , Alexander Spyridakis , Mark Burton , QEMU Developers , Paolo Bonzini , KONRAD =?iso-8859-1?Q?Fr=E9d=E9ric?= On Fri, Jun 26, 2015 at 08:06:55AM +0100, Alex Benn=E9e wrote: >=20 > Andrew Jones writes: >=20 > > On Wed, Jun 24, 2015 at 08:12:52PM +0100, Peter Maydell wrote: > >> On 24 June 2015 at 18:18, Alex Benn=E9e wro= te: > >> > > >> > Paolo Bonzini writes: > >> > > >> >> On 24/06/2015 17:34, Alex Benn=E9e wrote: > >> >>> Testing with Alexander's bare metal syncronisation tests fails i= n MTTCG > >> >>> leaving one CPU spinning forever waiting for the second CPU to w= ake up. > >> >>> We simply need to poke the halt_cond once we have processed the = PSCI > >> >>> power on call. > >> >>> > >> >>> Tested-by: Alex Benn=E9e > >> >>> CC: Alexander Spyridakis > >> >>> > >> >>> --- > >> >>> TODO > >> >>> - exactly how does the vexpress wake up it's sleeping CPUs? > >> >>> --- > >> >>> target-arm/psci.c | 2 ++ > >> >>> 1 file changed, 2 insertions(+) > >> >>> > >> >>> diff --git a/target-arm/psci.c b/target-arm/psci.c > >> >>> index d8fafab..661ff28 100644 > >> >>> --- a/target-arm/psci.c > >> >>> +++ b/target-arm/psci.c > >> >>> @@ -196,6 +196,8 @@ void arm_handle_psci_call(ARMCPU *cpu) > >> >>> } > >> >>> target_cpu_class->set_pc(target_cpu_state, entry); > >> >>> > >> >>> + qemu_cond_signal(target_cpu_state->halt_cond); > >> >> > >> >> That's called qemu_cpu_kick(target_cpu_state). :) The patch shou= ld be > >> >> acceptable now upstream, I think. > >> > > >> > Oh so this might well fail in KVM too? > >>=20 > >> In KVM we won't use target-arm/psci.c because PSCI calls > >> are handled in the kernel. > >> > > > > It's also not valid to use Alexander's test on KVM, as the test > > framework doesn't enable the mmu, and thus {ldr,str}ex won't work > > as expected. > > > > I guess I need to do a better job at advertising/documenting > > kvm-unit-tests/arm, as that framework would suit this test just > > fine. I've attached a patch porting the test over to k-u-t[1]. > > After applying the patch, do > > > > ./configure --arch=3Darm64 --cross-prefix=3Daarch64-linux-gnu- > > OR > > ./configure --arch=3Darm --cross-prefix=3Darm-linux-gnu- > > > > make One more step here, that you probably already figured out export QEMU=3D > > > > arm/run arm/vos-spinlock-test.flat -smp 4 # non-atomic locks > > OR > > arm/run arm/vos-spinlock-test.flat -smp 4 -append atomic # atomic > > locks >=20 > Thanks for that. I shall have a play with it today. Feel free to make suggestions/patches for the framework, and, of course, to write unit tests :-) drew >=20 > > > > Thanks, > > drew > > > > [1] git://git.kernel.org/pub/scm/virt/kvm/kvm-unit-tests.git >=20 > --=20 > Alex Benn=E9e >=20 >=20