From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [RFC PATCH] xen/arm: check on domain type against hardware support Date: Mon, 29 Sep 2014 13:42:58 +0100 Message-ID: <542953D2.4000003@linaro.org> References: <1411042429-17108-1-git-send-email-vijay.kilari@gmail.com> <1411042429-17108-2-git-send-email-vijay.kilari@gmail.com> <1411489871.1781.103.camel@kazak.uk.xensource.com> <1411643289.16473.27.camel@kazak.uk.xensource.com> <54294E21.6000403@linaro.org> <1411994131.3801.11.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1411994131.3801.11.camel@citrix.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: Ian Campbell Cc: Vijay Kilari , Stefano Stabellini , Prasun Kapoor , Vijaya Kumar K , Tim Deegan , "xen-devel@lists.xen.org" , Stefano Stabellini , manish.jaggi@caviumnetworks.com List-Id: xen-devel@lists.xenproject.org On 09/29/2014 01:35 PM, Ian Campbell wrote: >>>> I propose cpu_has_aarch32 to check for both A32 and T32. If any one >>>> (A32/T32) is set we >>>> can assume that aarch32 is supported. For ARM64 that supports only >>>> Aarch64 ID_PFR0_EL1 is RES0. so this check for T32 | A32 should work. >>>> Something like this >>>> >>>> diff --git a/xen/include/asm-arm/cpufeature.h b/xen/include/asm-arm/cpufeature.h >>>> index 7a6d3de..379e366 100644 >>>> --- a/xen/include/asm-arm/cpufeature.h >>>> +++ b/xen/include/asm-arm/cpufeature.h >>>> @@ -22,7 +22,9 @@ >>>> #define boot_cpu_feature32(feat) (boot_cpu_data.pfr32.feat) >>>> >>>> -#define cpu_has_aarch32 (boot_cpu_feature32(arm) == 1) >>>> +#define cpu_has_a32 ((boot_cpu_feature32(arm) == 1) >>>> #define cpu_has_thumb (boot_cpu_feature32(thumb) >= 1) >>>> +#define cpu_has_aarch32 (cpu_has_a32 || cpu_has_thumb) >>> >>> Yes, this looks like what is needed, thanks. >> >> Following my comment above, I don't think this change is necessary. > > Iff you are right about v8. You are probably right but it's not 100% > clear. On the other hand checking for what we actually mean has no > downside. The downside is name readability for the developer as the term A32 has been introduced on ARMv8. With only the ARMv7 spec the name is very confusing. I had to read the ARMv8 spec to completely understand the name and the different between aarch32 and a32. I would at least add a comment on top of cpu_has_a32. Regards, Regards, -- Julien Grall