Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp553020imm; Wed, 25 Jul 2018 01:52:33 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdVa2y177y/WhqK93XC/1YJzSwBvfU0byNu2OiKEK7k6rQJ/4PvwgB4D7Huex38rvPelxjD X-Received: by 2002:a17:902:aa4b:: with SMTP id c11-v6mr8130648plr.344.1532508753878; Wed, 25 Jul 2018 01:52:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532508753; cv=none; d=google.com; s=arc-20160816; b=cRZUfl2JVm4aRHWT5stqpTI1iFE1Su/k47lUhD2S+eDRdxXz3H2aDUWDBMOm0fUwix d7wof3jSEjXedyKFFHtPxo31Zl9rw0j8S68tmgzek0KR3pb784EcOFflcor5foGaxG5m bzy6Ak1qYvCXB7bopNyuQxaUyRxOz2ul9Q9zwJtjFZQw26rAmQIQuVfdPBLgcdtejSkY bqCNMpWfFwhHMpUDOTSm/HRRCNtGYnz/k7P32yguR3pu48SnLcu6TWoOnSvXp5L0NvvX BN2K5gla58bud+s3dXxi3ZwFzcEtOA2hAf4Eu7Ua0lC/LqgPMbWg/C40RUTUM/EHolN7 hSNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=xJbAVVnxA5REgIvJvkgyl9uymEGVIxRcJrnw4qQNegM=; b=dgVT3to94vuNohl0rGcSnykxDGhGsz9XPWkWLaAChK7oaepLwaQCCvuhJvwpvwff+Y 26ELYUs3CpgGL59gouZT9EQb4Mn0LYyuf0hbmu3QhW2YEWZ+WTYHOsGBbFPvu3/iyNta XWwzh0lf4fGgh5cNAScx+4PsNgtD7KOqIXYx0LqvwqwXp2oO6FLP9a0rlB8jE8LMVtOT H+pOn9E/eSm8LO+/JOfHc2KuE0NwDIbNmKPYFTrYIKuUxKJ7UwxigipkP1TdT/038gxx ZGxgMqNbnk3IzE2OUqizr5OJ+SF9Wy8mO6j65zjkoM91eV1LBdTox4RQZ+DOAKNlBe8e ThCg== 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.52.18; Wed, 25 Jul 2018 01:52:33 -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 S1728600AbeGYKCE (ORCPT + 99 others); Wed, 25 Jul 2018 06:02:04 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:34170 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728126AbeGYKCE (ORCPT ); Wed, 25 Jul 2018 06:02:04 -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 95D5680D; Wed, 25 Jul 2018 01:51:22 -0700 (PDT) Received: from [10.37.10.30] (unknown [10.37.10.30]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AE6023F237; Wed, 25 Jul 2018 01:51:20 -0700 (PDT) Subject: Re: [PATCH] arm64: Check for errata before evaluating cpu features To: Dirk Mueller , linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, Catalin Marinas , Will Deacon , Alex Graf , Dave Martin , Marc Zyngier References: <20180725083504.25836-1-dmueller@suse.com> From: Suzuki K Poulose Message-ID: Date: Wed, 25 Jul 2018 09:51:53 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180725083504.25836-1-dmueller@suse.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); Reviewed-by: Suzuki K Poulose