From: Ian Campbell Subject: Re: [PATCH] xen/arm: remove check for generic timer support for arm64 Date: Mon, 2 Jun 2014 12:09:48 +0100 Message-ID: <1401707388.11045.6.camel@kazak.uk.xensource.com> References: <1401698241-20722-1-git-send-email-vijay.kilari@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1401698241-20722-1-git-send-email-vijay.kilari@gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: vijay.kilari@gmail.com Cc: stefano.stabellini@eu.citrix.com, Prasun.Kapoor@caviumnetworks.com, vijaya.kumar@caviumnetworks.com, julien.grall@linaro.org, xen-devel@lists.xen.org, stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org On Mon, 2014-06-02 at 14:07 +0530, vijay.kilari@gmail.com wrote: > From: Vijaya Kumar K > > arm64 always supports generic timer. So check is not required > for arm64. For platforms which supports only aarch64 mode this > check always passes and panics Ah, because the relevant feature flag/register is 32-bit only. I'd prefer to see this done in the cpufeature header as: #ifdef CONFIG_ARM_32 #define cpu_has_gentimer (boot_cpu_feature32(gentimer) == 1) #else #define cpu_has_gentimer (1) #endif rather than adding #ifdef to the common code. Likewise for any similar "always on for aarch64" features. Thanks, Ian. > > Signed-off-by: Vijaya Kumar K > --- > xen/arch/arm/time.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c > index 4c3e1a6..801c130 100644 > --- a/xen/arch/arm/time.c > +++ b/xen/arch/arm/time.c > @@ -138,8 +138,10 @@ int __init init_xen_time(void) > panic("Timer: Cannot initialize platform timer"); > > /* Check that this CPU supports the Generic Timer interface */ > +#ifdef CONFIG_ARM_32 > if ( !cpu_has_gentimer ) > panic("CPU does not support the Generic Timer v1 interface"); > +#endif > > res = dt_property_read_u32(dev, "clock-frequency", &rate); > if ( res )