Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp556138imm; Wed, 25 Jul 2018 01:57:20 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcdpXFCEvlLsGZjncFmB0FMUAkBeTRs41w+RF6aXWgmg/bU0TAvVvlN98BI0Bnzkzwfxl9w X-Received: by 2002:a63:3f05:: with SMTP id m5-v6mr19444640pga.51.1532509040306; Wed, 25 Jul 2018 01:57:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532509040; cv=none; d=google.com; s=arc-20160816; b=YmZL8hOXGyWMcqG7oBDxiKyKpnN3kZPF9HbOR1t1QvrszlCLfTVcYKqqL3UfKP+vVi bU3Czl0rmqM3QfOIUw/q2GBq7+xRMGuFjlzaHhjbjuOCdaq5IJv6R7yReKluWYDDjmwF wZiq5iZohFVpUshacfLdmZiPwFxqjyV1xNlDBE+yry2Q58CyItQF74veI5ZW/tUOXY1u 4lU685Vk78jbfn+cWENxoKhUEsjtvEZt77O+P5kSyoFKpSEn6I+pZHQnaYnAcEv8HqDg 6WJ7YFfpsyv1MzNmN2jXAPaZ3ZMINiL5XuHnedzb2H2rttjv0bDmGibcNLqH+nn9KouZ on5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=sBV55t490FkBDhOs/j4oJYOiQUP9/VBzMtFc4l8Og2E=; b=FQTylZJQD5oRxdoPyc+Wl9OrqFJM4x0UwgvW48TOb2s2JMJDaxLNqgZ4jm4pwaSw4l HGBF8rC5GblPldauRF8fyz5RpR7Xu5zmg+KtYoY8bBaLufky+gN6cq/9Uc4J9ynNHi5q mtIO+MIuwcva9Q8CvcaT9k3ygQXJo+yv4t2zVSPiRxyY7sUOUXtDiGX0vMQ7gGAG5G9D kN1xjTztqmYvn4mOJvJInP7xr4ARHiwCg96Y9q5e/TpZxfxCMZJiB1spvxPRI5Inck8B bg0B6jdC0RkAhZL1MIiD7SJd0FLBIVpocXoHnH0zI6B42jz77YdSqajuc8xxbUQo4uSF P7VQ== 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 i38-v6si12709871pgm.394.2018.07.25.01.57.05; Wed, 25 Jul 2018 01:57:20 -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 S1728653AbeGYKGv (ORCPT + 99 others); Wed, 25 Jul 2018 06:06:51 -0400 Received: from foss.arm.com ([217.140.101.70]:34226 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728553AbeGYKGu (ORCPT ); Wed, 25 Jul 2018 06:06:50 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6B0EB80D; Wed, 25 Jul 2018 01:56:08 -0700 (PDT) Received: from e103592.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E670D3F237; Wed, 25 Jul 2018 01:56:06 -0700 (PDT) Date: Wed, 25 Jul 2018 09:56:04 +0100 From: Dave Martin To: Suzuki K Poulose Cc: Dirk Mueller , linux-arm-kernel@lists.infradead.org, Marc Zyngier , Catalin Marinas , Will Deacon , linux-kernel@vger.kernel.org, Alex Graf Subject: Re: [PATCH] arm64: Check for errata before evaluating cpu features Message-ID: <20180725085604.GB4240@e103592.cambridge.arm.com> References: <20180725083504.25836-1-dmueller@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 25, 2018 at 09:51:53AM +0100, Suzuki K Poulose wrote: > On 07/25/2018 09:35 AM, Dirk Mueller wrote: > >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 > > It would be good to add "Fixes: ed478b3f9e4a" (instead), just to make > sure this gets fixed everywhere the original problem appears. > > >--- > > 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); I forget why these were originally reordered in ed478b3f9e4a. Was there any real reason for it? I also notice in that commit that after the detection pass, we set things up (in update_cpu_capabilities(), enable_cpu_capabilities()) in the order errata, features. Does this matter for anything? Cheers ---Dave > > Reviewed-by: Suzuki K Poulose > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel