From: Ian Campbell Subject: Re: [PATCH] xen: arm: Fixing ttbcr (TCR_EL1 for AArch64) size. Date: Tue, 3 Dec 2013 13:47:33 +0000 Message-ID: <1386078453.13256.35.camel@kazak.uk.xensource.com> References: <1386072224-4478-1-git-send-email-pranavkumar@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1386072224-4478-1-git-send-email-pranavkumar@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Pranavkumar Sawargaonkar Cc: Anup Patel , patches@linaro.org, patches@apm.com, xen-devel@lists.xen.org, julien.grall@citrix.com, stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org On Tue, 2013-12-03 at 17:33 +0530, Pranavkumar Sawargaonkar wrote: > This patch fixes size of ttbcr register (TCR_EL1 in case of AArch64) > and it's programming considering size in case of context switch. > > Currently ttbcr is defined as 32b register but for AArch64 TCR_EL1 > size is 64b. Thanks for tracking this down. > Signed-off-by: Anup Patel > Signed-off-by: Pranavkumar Sawargaonkar [...] > diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h > index d5cae2e..2aa4443 100644 > --- a/xen/include/asm-arm/domain.h > +++ b/xen/include/asm-arm/domain.h > @@ -165,7 +165,11 @@ struct arch_vcpu > > /* MMU */ > register_t vbar; > +#ifdef CONFIG_ARM_32 > uint32_t ttbcr; > +#else > + uint64_t ttbcr; > +#endif I think that actually only this hunk is required. Actually, the correct type to use is register_t (which is defined to be the "native" register size, 32- or 64-bit as appropriate). That avoids the ifdef. The READ/WRITE_SYSREG macros are also defined to deal in the "native" bit width so the other hunks are unnecessary. The SYSREG32/64 variants are for use with a register which is a fixed width independent of the platform. Thanks, Ian.