qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC PATCH] target-arm/psci.c: wake up sleeping CPUs (M


From: Alex Bennée
Subject: Re: [Qemu-devel] [RFC PATCH] target-arm/psci.c: wake up sleeping CPUs (MTTCG)
Date: Fri, 26 Jun 2015 08:06:55 +0100

Andrew Jones <address@hidden> writes:

> On Wed, Jun 24, 2015 at 08:12:52PM +0100, Peter Maydell wrote:
>> On 24 June 2015 at 18:18, Alex Bennée <address@hidden> wrote:
>> >
>> > Paolo Bonzini <address@hidden> 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 <address@hidden>
>> >>> CC: Alexander Spyridakis <address@hidden>
>> >>>
>> >>> ---
>> >>> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]