[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [kvm-unit-tests PATCH v2 03/10] arm/arm64: smp: support m
From: |
Alex Bennée |
Subject: |
Re: [Qemu-arm] [kvm-unit-tests PATCH v2 03/10] arm/arm64: smp: support more than 8 cpus |
Date: |
Mon, 06 Jun 2016 18:28:57 +0100 |
User-agent: |
mu4e 0.9.17; emacs 25.0.94.5 |
Mark Rutland <address@hidden> writes:
> On Mon, Jun 06, 2016 at 05:22:49PM +0100, Alex Bennée wrote:
>> Andrew Jones <address@hidden> writes:
>> > +#define MPIDR_LEVEL_SHIFT(level) \
>> > + (((1 << level) >> 1) << 3)
>> > +#define MPIDR_AFFINITY_LEVEL(mpidr, level) \
>> > + ((mpidr >> MPIDR_LEVEL_SHIFT(level)) & 0xff)
>>
>> Doesn't Aff3 break this little macro? It sits at 32:39 with a gap for
>> MT, RES0, U, RES1 for bits 25:31
>
> It works, it's just a little bit magic:
Ahh the magic was too subtle for my eyes, perhaps a comment for the
wary.
>
> (gdb) p (((1 << 0) >> 1) << 3)
> $1 = 0
> (gdb) p (((1 << 1) >> 1) << 3)
> $2 = 8
> (gdb) p (((1 << 2) >> 1) << 3)
> $3 = 16
> (gdb) p (((1 << 3) >> 1) << 3)
> $4 = 32
> (gdb)
>
> We do the same in arch/arm64/include/asm/cputype.h since b058450f38c337d1
> ("arm64: kernel: add MPIDR_EL1 accessors macros").
I see the truth of it ;-)
>
> Thanks,
> Mark.
--
Alex Bennée
[Qemu-arm] [kvm-unit-tests PATCH v2 04/10] arm/arm64: add some delay routines, Andrew Jones, 2016/06/04
[Qemu-arm] [kvm-unit-tests PATCH v2 06/10] arm/arm64: add initial gicv2 support, Andrew Jones, 2016/06/04
[Qemu-arm] [kvm-unit-tests PATCH v2 05/10] arm/arm64: irq enable/disable, Andrew Jones, 2016/06/04
[Qemu-arm] [kvm-unit-tests PATCH v2 10/10] arm/arm64: gic: don't just use zero, Andrew Jones, 2016/06/04
[Qemu-arm] [kvm-unit-tests PATCH v2 07/10] arm/arm64: add initial gicv3 support, Andrew Jones, 2016/06/04
[Qemu-arm] [kvm-unit-tests PATCH v2 09/10] arm/arm64: gicv3: add an IPI test, Andrew Jones, 2016/06/04
[Qemu-arm] [kvm-unit-tests PATCH v2 08/10] arm/arm64: gicv2: add an IPI test, Andrew Jones, 2016/06/04