From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030189AbcDNQqO (ORCPT ); Thu, 14 Apr 2016 12:46:14 -0400 Received: from foss.arm.com ([217.140.101.70]:44420 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753978AbcDNQqL (ORCPT ); Thu, 14 Apr 2016 12:46:11 -0400 Subject: Re: [PATCH v3 3/7] arm64: Add helpers for detecting AArch32 support at EL0 To: Will Deacon References: <1459445255-15653-1-git-send-email-suzuki.poulose@arm.com> <1459445255-15653-4-git-send-email-suzuki.poulose@arm.com> <20160414163933.GG4584@arm.com> Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, mark.rutland@arm.com, marc.zyngier@arm.com, ynorov@caviumnetworks.com From: Suzuki K Poulose Message-ID: <570FC950.1070904@arm.com> Date: Thu, 14 Apr 2016 17:46:08 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20160414163933.GG4584@arm.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14/04/16 17:39, Will Deacon wrote: > On Thu, Mar 31, 2016 at 06:27:31PM +0100, Suzuki K Poulose wrote: >> Adds a helper to extract the support for AArch32 at EL0 >> >> Tested-by: Yury Norov >> Signed-off-by: Suzuki K Poulose >> +static inline bool id_aa64pfr0_32bit_el0(u64 pfr0) >> +{ >> + u32 val = cpuid_feature_extract_unsigned_field(pfr0, ID_AA64PFR0_EL0_SHIFT); >> + >> + return val == ID_AA64PFR0_EL0_32BIT_64BIT; > > Should this be >=? What are the rules for this register? This feature value is kind of "FTR_EXACT" where, we don't know what the relationship of the values are. Here is the list of possible values : 0001 EL0 can be executed in AArch64 state only. 0010 EL0 can be executed in either AArch64 or AArch32 state. All the other values are reserved. So I believe "==" is better check. Suzuki