From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758304AbcIHNke (ORCPT ); Thu, 8 Sep 2016 09:40:34 -0400 Received: from foss.arm.com ([217.140.101.70]:49716 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757562AbcIHNkc (ORCPT ); Thu, 8 Sep 2016 09:40:32 -0400 Date: Thu, 8 Sep 2016 14:40:25 +0100 From: Catalin Marinas To: Jason Baron Cc: Will Deacon , peterz@infradead.org, Suzuki.Poulose@arm.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, corbet@lwn.net Subject: Re: [PATCH v2 2/2] arm64: Use static keys for CPU features Message-ID: <20160908134025.2nq3e5ohienesrae@localhost> References: <1473096348-19548-1-git-send-email-catalin.marinas@arm.com> <1473096348-19548-3-git-send-email-catalin.marinas@arm.com> <48d10fa1-ee4c-e398-b5ae-9815bf0f18eb@akamai.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48d10fa1-ee4c-e398-b5ae-9815bf0f18eb@akamai.com> User-Agent: NeoMutt/ (1.7.0) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 07, 2016 at 12:59:52PM -0400, Jason Baron wrote: > On 09/05/2016 01:25 PM, Catalin Marinas wrote: > > This patch adds static keys transparently for all the cpu_hwcaps > > features by implementing an array of default-false static keys and > > enabling them when detected. The cpus_have_cap() check uses the static > > keys if the feature being checked is a constant, otherwise the compiler > > generates the bitmap test. > > > > Because of the early call to static_branch_enable() via > > check_local_cpu_errata() -> update_cpu_capabilities(), the jump labels > > are initialised in cpuinfo_store_boot_cpu(). > > Was there a reason the jump_label_init() couldn't be moved > earlier in the common code? No particular reason, only that I wasn't sure what the arch requirements to be able to initialise the jump labels early are (for example, jump_label_init() calls arch_jump_label_transform_static(); there don't seem to be any issues at a first look but I don't have the hardware to test and confirm). Therefore I followed the powerpc idea of calling jump_label_init() directly earlier. We also don't know how early it needs to be to benefit other architectures (powerpc seems to call it on a very early path via early_setup()). -- Catalin