From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoffer Dall Subject: Re: [PATCH 6/7] KVM: arm64: re-factor hyp.S debug register code Date: Tue, 2 Dec 2014 14:23:37 +0100 Message-ID: <20141202132337.GD545@cbox> References: <1416931805-23223-1-git-send-email-alex.bennee@linaro.org> <1416931805-23223-7-git-send-email-alex.bennee@linaro.org> <20141130102546.GI23653@cbox> <87ppc31t9v.fsf@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, marc.zyngier@arm.com, peter.maydell@linaro.org, agraf@suse.de, jan.kiszka@siemens.com, dahi@linux.vnet.ibm.com, r65777@freescale.com, bp@suse.de, pbonzini@redhat.com, Gleb Natapov , Catalin Marinas , Will Deacon , open list To: Alex =?iso-8859-1?Q?Benn=E9e?= Return-path: Content-Disposition: inline In-Reply-To: <87ppc31t9v.fsf@linaro.org> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On Mon, Dec 01, 2014 at 11:52:44AM +0000, Alex Benn=E9e wrote: >=20 > Christoffer Dall writes: >=20 > > On Tue, Nov 25, 2014 at 04:10:04PM +0000, Alex Benn=E9e wrote: > >> This is a pre-cursor to sharing the code with the guest debug supp= ort. > >> This replaces the big macro that fishes data out of a fixed locati= on > >> with a more general helper macro to restore a set of debug registe= rs. It > >> uses macro substitution so it can be re-used for debug control and= value > >> registers. It does however rely on the debug registers being 64 bi= t > >> aligned (as they happen to be in the hyp ABI). > > > > can you enforce that somewhere? >=20 > There is a comment in kvm_asm.h: >=20 > /* > * 0 is reserved as an invalid value. > * Order *must* be kept in sync with the hyp switch code. > */ >=20 > But I'm not sure how to enforce it in assembly. Is there a #pragma or > something I can use? >=20 You can add a BUG_ON somewhere at runtime, but I wouldn't bother, you can stick a note in that existing comment just so people don't change the declaration of the registers to be 32-bit aligned or something else= =2E -Christoffer