From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48438) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9xbn-0001d0-8W for qemu-devel@nongnu.org; Mon, 06 Jun 2016 12:42:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b9xbi-0004Es-Qp for qemu-devel@nongnu.org; Mon, 06 Jun 2016 12:42:34 -0400 Date: Mon, 6 Jun 2016 17:32:38 +0100 From: Mark Rutland Message-ID: <20160606163238.GB23505@leverpostej> References: <1465064165-14885-4-git-send-email-drjones@redhat.com> <8737oqi8x2.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <8737oqi8x2.fsf@linaro.org> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [kvm-unit-tests PATCH v2 03/10] arm/arm64: smp: support more than 8 cpus List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex =?utf-8?Q?Benn=C3=A9e?= Cc: Andrew Jones , kvm@vger.kernel.org, marc.zyngier@arm.com, andre.przywara@arm.com, qemu-devel@nongnu.org, qemu-arm@nongnu.org, pbonzini@redhat.com, kvmarm@lists.cs.columbia.edu On Mon, Jun 06, 2016 at 05:22:49PM +0100, Alex Benn=C3=A9e wrote: > Andrew Jones writes: > > +#define MPIDR_LEVEL_SHIFT(level) \ > > + (((1 << level) >> 1) << 3) > > +#define MPIDR_AFFINITY_LEVEL(mpidr, level) \ > > + ((mpidr >> MPIDR_LEVEL_SHIFT(level)) & 0xff) >=20 > 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: (gdb) p (((1 << 0) >> 1) << 3) $1 =3D 0 (gdb) p (((1 << 1) >> 1) << 3) $2 =3D 8 (gdb) p (((1 << 2) >> 1) << 3) $3 =3D 16 (gdb) p (((1 << 3) >> 1) << 3) $4 =3D 32 (gdb)=20 We do the same in arch/arm64/include/asm/cputype.h since b058450f38c337d1 ("arm64: kernel: add MPIDR_EL1 accessors macros"). Thanks, Mark.