Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751831AbeAOSBh (ORCPT + 1 other); Mon, 15 Jan 2018 13:01:37 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:44616 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751783AbeAOSBd (ORCPT ); Mon, 15 Jan 2018 13:01:33 -0500 Date: Mon, 15 Jan 2018 18:01:27 +0000 From: Catalin Marinas To: Suzuki K Poulose Cc: will.deacon@arm.com, mark.rutland@arm.com, lorenzo.pieralisi@arm.com, christoffer.dall@linaro.org, ard.biesheuvel@linaro.org, marc.zyngier@arm.com, linux-kernel@vger.kernel.org, shankerd@codeaurora.org, linux-arm-kernel@lists.infradead.org, jnair@caviumnetworks.com Subject: Re: [PATCH v3 11/13] arm64: Implement branch predictor hardening for affected Cortex-A CPUs Message-ID: <20180115180127.jkwe6pbp4j7xcdhl@armageddon.cambridge.arm.com> References: <1515432758-26440-12-git-send-email-will.deacon@arm.com> <20180109161218.2079-1-suzuki.poulose@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180109161218.2079-1-suzuki.poulose@arm.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Tue, Jan 09, 2018 at 04:12:18PM +0000, Suzuki K. Poulose wrote: > arm64: capabilities: Handle duplicate entries for a capability > > Sometimes a single capability could be listed multiple times with > differing matches(), e.g, CPU errata for different MIDR versions. > This breaks verify_local_cpu_feature() and this_cpu_has_cap() as > we stop checking for a capability on a CPU with the first > entry in the given table, which is not sufficient. Make sure we > run the checks for all entries of the same capability. We do > this by fixing __this_cpu_has_cap() to run through all the > entries in the given table for a match and reuse it for > verify_local_cpu_feature(). > > Cc: Mark Rutland > Cc: Will Deacon > Cc: Marc Zyngier > Signed-off-by: Suzuki K Poulose > --- > arch/arm64/kernel/cpufeature.c | 44 ++++++++++++++++++++++-------------------- > 1 file changed, 23 insertions(+), 21 deletions(-) Applied. Thanks. -- Catalin