Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp542026imm; Wed, 25 Jul 2018 01:36:15 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfKYiYYr/khs0p6MUuqFCNxxSqOPrttFpDh1W0QeeWDlYep3wUxsQibLIOkNkr6r+PKhyXd X-Received: by 2002:a62:1f8c:: with SMTP id l12-v6mr21426833pfj.143.1532507775227; Wed, 25 Jul 2018 01:36:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532507775; cv=none; d=google.com; s=arc-20160816; b=JM85BYtA7zLsX1liDWF+e3ky9diNz9tO9twtP8zsDL8pq2v6CHkDlCuo6xIlg0xKxh yDEA8Sw+vdy7YaSWy4BECLoi4iQI72ZSvgoZDfdV7nFkkUcki/ed+R9JaI0uHryizolk keRO48YOiJCKlyeOPuJQxWXbDYYiml+tcSiyWAg32/6jLAr02r7P3vGbjqeD0KhKPRCn 8Cxi5WBMgcIo4T901JA3KhCftfbLelwKqqOEp4YCTHMslGBUGCauqRMwtbaMmGaiyCHw oZ1ChFWSKgFsKkHderPAVm6oYWGTLgjl8pC0GsQP2UWIdLwcT5/+LHg/Ztq6OisnxPer l4pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=NfE5OnHerJc6GVLjCpNOJrSAFd48zvzq8OnqwDE2ZqY=; b=K7tY8pTzA4rN86ieQ6qN7Wx7Tewyduk35EfFijfQgwkyqxSRPFoypLBxJsQtntgfim tGfFZW70DADew+pLHafY3qri5XaNksSUXWRTlDVGXxwpITIMjLW61RwkQDH4V9XXE9dE s5tM/X4fpAVsIG7EpFlO89IasDBJ0eBsFHHHc7aB+qS32on+c7ok6sEpQY4VY12LNb8b JFVVY0BRoHGoEv/oWGl+/537w0m/VLcRyKJghvYjEokaLsYLHzyqSIxihI5nKq+C04E9 Cf8LL+uXHgdpWPUVrcI2qWmN82DphSAFz7O/2DgMNA5gLFBKrUTGrnIp8yO+7j3RLdeQ PH5g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l18-v6si12656693pgi.249.2018.07.25.01.35.59; Wed, 25 Jul 2018 01:36:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728613AbeGYJpr (ORCPT + 99 others); Wed, 25 Jul 2018 05:45:47 -0400 Received: from mx2.suse.de ([195.135.220.15]:59980 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728540AbeGYJpr (ORCPT ); Wed, 25 Jul 2018 05:45:47 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D63C6AD9B; Wed, 25 Jul 2018 08:35:08 +0000 (UTC) From: Dirk Mueller To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, Catalin Marinas , Will Deacon , Alex Graf , Dave Martin , Dirk Mueller , Suzuki K Poulose , Marc Zyngier Subject: [PATCH] arm64: Check for errata before evaluating cpu features Date: Wed, 25 Jul 2018 10:35:04 +0200 Message-Id: <20180725083504.25836-1-dmueller@suse.com> X-Mailer: git-send-email 2.18.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: d3aec8a28be3b8 ("arm64: capabilities: Restrict KPTI detection to boot-time CPUs") CC: Suzuki K Poulose CC: Marc Zyngier Signed-off-by: Dirk Mueller --- arch/arm64/kernel/cpufeature.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index f24892a40d2c..c6d80743f4ed 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -1351,9 +1351,9 @@ static void __update_cpu_capabilities(const struct arm64_cpu_capabilities *caps, 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) @@ -1408,8 +1408,8 @@ __enable_cpu_capabilities(const struct arm64_cpu_capabilities *caps, 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); } /* -- 2.18.0