From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753063AbdATQUe (ORCPT ); Fri, 20 Jan 2017 11:20:34 -0500 Received: from mail-pg0-f66.google.com ([74.125.83.66]:33839 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753026AbdATQUb (ORCPT ); Fri, 20 Jan 2017 11:20:31 -0500 Date: Fri, 20 Jan 2017 21:50:22 +0530 From: Afzal Mohammed To: Vladimir Murzin Cc: Russell King - ARM Linux , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/4] ARM: nommu: dynamic exception base address setting Message-ID: <20170120162022.GB3865@afzalpc> References: <20170118203525.6246-1-afzal.mohd.ma@gmail.com> <20170118203807.6467-1-afzal.mohd.ma@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Thu, Jan 19, 2017 at 01:59:09PM +0000, Vladimir Murzin wrote: > On 18/01/17 20:38, afzal mohammed wrote: > > +#define ID_PFR1_SE (0x3 << 4) /* Security extension enable bits */ > > This bitfiled is 4 bits wide. Since only 2 LSb's out of the 4 were enough to detect whether security extensions were enabled, it was done so. i am going to use your below suggestion & this would be taken care by that. > > + if (security_extensions_enabled()) { > > You can use > > cpuid_feature_extract(CPUID_EXT_PFR1, 4) > > and add a comment explaining what we are looking for and why. Yes, that is better, was not aware of this, did saw CPUID_EXT_PFR1 as an unused macro. > > +#ifdef CONFIG_CPU_CP15 > > + vectors_base = setup_vectors_base(); > > +#endif > > alternatively it can be > > unsigned long vector_base = IS_ENABLED(CONFIG_CPU_CP15) ? setup_vbar() : 0; Yes that certainly is better. Regards afzal