From patchwork Thu Jan 16 23:18:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 233776 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 62146C3F68F for ; Thu, 16 Jan 2020 23:34:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 35F9420684 for ; Thu, 16 Jan 2020 23:34:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579217689; bh=UYFTwy/8mNp/kF5FDWrxnpyRxnkxPblHvy8mqx408r4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Xjf/lnZmGW8RYVKzzCkq7DsJrEUF5PF1YvX7CyvR6VJvO81eMtahHZjZGX4zTyPJr pOQoLPVem3W+fk6JNzRY0odXFQWCdgQSoWndmEJNtlrH1Jp9rj+DZMA6MndfmQjQTU lrPxViy5sy6Y/Ppm9fo3Tql38wQI5RDSz//i8BnU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391581AbgAPXeo (ORCPT ); Thu, 16 Jan 2020 18:34:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:43228 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404249AbgAPXdJ (ORCPT ); Thu, 16 Jan 2020 18:33:09 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 19A5D20661; Thu, 16 Jan 2020 23:33:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579217588; bh=UYFTwy/8mNp/kF5FDWrxnpyRxnkxPblHvy8mqx408r4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Bd5iygsfBm1DDayRXMz3004rzB5uCXxg2bKCDTAalTeId6lSHzkHqMf7D+Ig3q5cp CAcE7WPHcfCb2gAFQWqwKjnlH8//2403jDX04ZuSiuKb32SV7Qomw7BvMZUSuJgAu4 dksmxauGHW0ByS0G9MhFqkZYWo6VmlRBOmB3ZJNc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Suzuki K Poulose , Marc Zyngier , Dirk Mueller , Will Deacon , Juerg Haefliger Subject: [PATCH 4.14 33/71] arm64: Check for errata before evaluating cpu features Date: Fri, 17 Jan 2020 00:18:31 +0100 Message-Id: <20200116231714.391385773@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200116231709.377772748@linuxfoundation.org> References: <20200116231709.377772748@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Dirk Mueller commit dc0e36581eb2da1aa3c63ceeff0f10ef1e899b2a upstream. Since commit d3aec8a28be3b8 ("arm64: capabilities: Restrict KPTI detection to boot-time CPUs") we rely on errata flags being already populated during feature enumeration. The order of errata and features was flipped as part of commit ed478b3f9e4a ("arm64: capabilities: Group handling of features and errata workarounds"). Return to the orginal order of errata and feature evaluation to ensure errata flags are present during feature evaluation. Fixes: ed478b3f9e4a ("arm64: capabilities: Group handling of features and errata workarounds") CC: Suzuki K Poulose CC: Marc Zyngier Signed-off-by: Dirk Mueller Reviewed-by: Suzuki K Poulose Signed-off-by: Will Deacon Signed-off-by: Juerg Haefliger Signed-off-by: Greg Kroah-Hartman --- arch/arm64/kernel/cpufeature.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -1278,9 +1278,9 @@ static void __update_cpu_capabilities(co static void update_cpu_capabilities(u16 scope_mask) { - __update_cpu_capabilities(arm64_features, scope_mask, "detected:"); __update_cpu_capabilities(arm64_errata, scope_mask, "enabling workaround for"); + __update_cpu_capabilities(arm64_features, scope_mask, "detected:"); } static int __enable_cpu_capability(void *arg) @@ -1335,8 +1335,8 @@ __enable_cpu_capabilities(const struct a static void __init enable_cpu_capabilities(u16 scope_mask) { - __enable_cpu_capabilities(arm64_features, scope_mask); __enable_cpu_capabilities(arm64_errata, scope_mask); + __enable_cpu_capabilities(arm64_features, scope_mask); } /*