From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932531AbcKHSVg (ORCPT ); Tue, 8 Nov 2016 13:21:36 -0500 Received: from foss.arm.com ([217.140.101.70]:38352 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751865AbcKHSVf (ORCPT ); Tue, 8 Nov 2016 13:21:35 -0500 Date: Tue, 8 Nov 2016 18:11:03 +0000 From: Will Deacon To: Suzuki K Poulose Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, ard.biesheuvel@linaro.org, catalin.marinas@arm.com, mark.rutland@arm.com, marc.zyngier@arm.com, kvmarm@lists.cs.columbia.edu, Robert Ritcher , Tirumalesh Chalamarla Subject: Re: [PATCH v3 1/2] arm64: Add hypervisor safe helper for checking constant capabilities Message-ID: <20161108181103.GM20591@arm.com> References: <1478613381-5718-1-git-send-email-suzuki.poulose@arm.com> <1478613381-5718-2-git-send-email-suzuki.poulose@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1478613381-5718-2-git-send-email-suzuki.poulose@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 Tue, Nov 08, 2016 at 01:56:20PM +0000, Suzuki K Poulose wrote: > The hypervisor may not have full access to the kernel data structures > and hence cannot safely use cpus_have_cap() helper for checking the > system capability. Add a safe helper for hypervisors to check a constant > system capability, which *doesn't* fall back to checking the bitmap > maintained by the kernel. With this, make the cpus_have_cap() only > check the bitmask and force constant cap checks to use the new API > for quicker checks. > > Cc: Robert Ritcher > Cc: Tirumalesh Chalamarla > Cc: Marc Zyngier > Cc: Catalin Marinas > Cc: Will Deacon > Signed-off-by: Suzuki K Poulose > --- > arch/arm64/include/asm/cpufeature.h | 19 ++++++++++++------- > arch/arm64/kernel/cpufeature.c | 2 +- > arch/arm64/kernel/process.c | 2 +- > drivers/irqchip/irq-gic-v3.c | 13 +------------ It might be worth having the GIC changes as a separate patch, but either way: Reviewed-by: Will Deacon Will