From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52979) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8NiL-0002nw-3K for qemu-devel@nongnu.org; Fri, 26 Jun 2015 03:06:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z8NiH-000221-T5 for qemu-devel@nongnu.org; Fri, 26 Jun 2015 03:06:17 -0400 Received: from mail-wi0-f169.google.com ([209.85.212.169]:35037) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8NiH-00021r-Mf for qemu-devel@nongnu.org; Fri, 26 Jun 2015 03:06:13 -0400 Received: by wiga1 with SMTP id a1so9093478wig.0 for ; Fri, 26 Jun 2015 00:06:12 -0700 (PDT) References: <1435160084-938-1-git-send-email-alex.bennee@linaro.org> <558AD458.4000905@redhat.com> <87y4j9xbxh.fsf@linaro.org> <20150625154432.GA6535@hawk.localdomain> From: Alex =?utf-8?Q?Benn=C3=A9e?= In-reply-to: <20150625154432.GA6535@hawk.localdomain> Date: Fri, 26 Jun 2015 08:06:55 +0100 Message-ID: <878ub7aqy8.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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: Andrew Jones Cc: mttcg@greensocs.com, Peter Maydell , Alexander Spyridakis , Mark Burton , QEMU Developers , Paolo Bonzini , KONRAD =?utf-8?B?RnLDqWTDqXJpYw==?= Andrew Jones writes: > On Wed, Jun 24, 2015 at 08:12:52PM +0100, Peter Maydell wrote: >> On 24 June 2015 at 18:18, Alex Bennée wrote: >> > >> > Paolo Bonzini writes: >> > >> >> On 24/06/2015 17:34, Alex Bennée wrote: >> >>> Testing with Alexander's bare metal syncronisation tests fails in MTTCG >> >>> leaving one CPU spinning forever waiting for the second CPU to wake up. >> >>> We simply need to poke the halt_cond once we have processed the PSCI >> >>> power on call. >> >>> >> >>> Tested-by: Alex Bennée >> >>> 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 should be >> >> acceptable now upstream, I think. >> > >> > Oh so this might well fail in KVM too? >> >> 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=arm64 --cross-prefix=aarch64-linux-gnu- > OR > ./configure --arch=arm --cross-prefix=arm-linux-gnu- > > make > > 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 Thanks for that. I shall have a play with it today. > > Thanks, > drew > > [1] git://git.kernel.org/pub/scm/virt/kvm/kvm-unit-tests.git -- Alex Bennée