From mboxrd@z Thu Jan 1 00:00:00 1970 From: will.deacon@arm.com (Will Deacon) Date: Fri, 15 Apr 2016 13:55:12 +0100 Subject: [PATCH 1/5] arm64: cpufeature: Add scope for capability check In-Reply-To: <570FD7C2.9030305@arm.com> References: <1459941854-5190-1-git-send-email-suzuki.poulose@arm.com> <1459941854-5190-2-git-send-email-suzuki.poulose@arm.com> <20160414173809.GN4584@arm.com> <570FD7C2.9030305@arm.com> Message-ID: <20160415125511.GF22906@arm.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Thu, Apr 14, 2016 at 06:47:46PM +0100, Suzuki K Poulose wrote: > On 14/04/16 18:38, Will Deacon wrote: > >Hi Suzuki, > > > >On Wed, Apr 06, 2016 at 12:24:10PM +0100, Suzuki K Poulose wrote: > >>Add scope parameter to the arm64_cpu_capabilities::matches(), > >>so that this can be reused for checking the capability on a > >>given CPU vs the system wide. By default, the system uses > >>'system' wide values for setting the CPU_HWCAPs and ELF_HWCAPs. > > >> static bool __maybe_unused > >>-is_affected_midr_range(const struct arm64_cpu_capabilities *entry) > >>+is_affected_midr_range(const struct arm64_cpu_capabilities *entry, int __unused) > > > >Maybe it would be better to WARN if somebody passes SCOPE_SYSTEM, rather > >than silently treat it as per-cpu? > > Should we worry about errata's which may not necessarily depend on per CPU or > a local capability (GIC) ? Why would they be calling is_affected_midr_range? > If not, we could add a WARN after passing down LOCAL > scope for errata. But if we don't care about errata that aren't local, then why would we warn on LOCAL? > Right now we always do SCOPE_SYSTEM from update_cpu_capabilities(), even for > cpu_errata table. There is no specific reason for that. I'm totally confused. Can you define SCOPE_SYSTEM and SCOPE_LOCAL for me, please? Will From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751320AbcDOMzP (ORCPT ); Fri, 15 Apr 2016 08:55:15 -0400 Received: from foss.arm.com ([217.140.101.70]:49324 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750768AbcDOMzO (ORCPT ); Fri, 15 Apr 2016 08:55:14 -0400 Date: Fri, 15 Apr 2016 13:55:12 +0100 From: Will Deacon To: Suzuki K Poulose Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, marc.zyngier@arm.com, catalin.marinas@arm.com, mark.rutland@arm.com, Vadim.Lomovtsev@caviumnetworks.com, James Morse , Andre Przywara Subject: Re: [PATCH 1/5] arm64: cpufeature: Add scope for capability check Message-ID: <20160415125511.GF22906@arm.com> References: <1459941854-5190-1-git-send-email-suzuki.poulose@arm.com> <1459941854-5190-2-git-send-email-suzuki.poulose@arm.com> <20160414173809.GN4584@arm.com> <570FD7C2.9030305@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <570FD7C2.9030305@arm.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 14, 2016 at 06:47:46PM +0100, Suzuki K Poulose wrote: > On 14/04/16 18:38, Will Deacon wrote: > >Hi Suzuki, > > > >On Wed, Apr 06, 2016 at 12:24:10PM +0100, Suzuki K Poulose wrote: > >>Add scope parameter to the arm64_cpu_capabilities::matches(), > >>so that this can be reused for checking the capability on a > >>given CPU vs the system wide. By default, the system uses > >>'system' wide values for setting the CPU_HWCAPs and ELF_HWCAPs. > > >> static bool __maybe_unused > >>-is_affected_midr_range(const struct arm64_cpu_capabilities *entry) > >>+is_affected_midr_range(const struct arm64_cpu_capabilities *entry, int __unused) > > > >Maybe it would be better to WARN if somebody passes SCOPE_SYSTEM, rather > >than silently treat it as per-cpu? > > Should we worry about errata's which may not necessarily depend on per CPU or > a local capability (GIC) ? Why would they be calling is_affected_midr_range? > If not, we could add a WARN after passing down LOCAL > scope for errata. But if we don't care about errata that aren't local, then why would we warn on LOCAL? > Right now we always do SCOPE_SYSTEM from update_cpu_capabilities(), even for > cpu_errata table. There is no specific reason for that. I'm totally confused. Can you define SCOPE_SYSTEM and SCOPE_LOCAL for me, please? Will