Received: by 10.223.185.116 with SMTP id b49csp68142wrg; Thu, 15 Feb 2018 16:44:16 -0800 (PST) X-Google-Smtp-Source: AH8x227UFXLcMEFGYc4uGzl5nPYwU6lvRQMKiZp1RyQLoK0PNw1nLiUhTIonKi6heMN57WfQyUGM X-Received: by 10.99.96.77 with SMTP id u74mr3681797pgb.453.1518741855919; Thu, 15 Feb 2018 16:44:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518741855; cv=none; d=google.com; s=arc-20160816; b=Qh7c+07RU4RlTxtyt7PwLovbPGwtAEhHwz9Sjt0gZ/Jn1nrl4ZsnfGkARXICoX5TI4 uurXPxscSQ8eB3wps0foOyQJ5R0twk3ZdW7XMEaDi+ruprF5smm8hJpR4nnN/6tGOcFQ y6Y8Fd8pFNbVPesYSQ1stmH1E4NU1zzgJ51r1VICr7VnIegMsHroIDiqMuT/VXw5OiuW +K2g1bqYTPPNCUGHkHdzD+nppi7R6/MNl4BX5ttg25mZBPh+q8lrgrJTCew2513UfwU1 2W6ZgaGb1Vk6juW9VnTA/4AfQi+kEqP5xcjY8mag/msSdGR4F0IbeTWQfWh/xlubtboq BqWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=dNvsdDxQQ8TcTqNw1te6QIoTjbyz7H4I7cXoxGBj/HA=; b=KvgeMIXTbB/Fa5jgsIOJGq34bqep3ulhEV+5K5H8Uzvdy1cZDE6UWpP3gtd7hgvwGr dPPvuDrIpUDzQ1kOL1hcKh40v83unkx9aNBM7X5F3SPjf1sTcwILYmk5n7pW1k7SQ7/+ zYZd1L3+8TCaQcnVI4+WxAI/ALKGm9BjW1xkdLXDkco+9f073Hwh4HSgpgoz51mXy+I6 mdvaltIaSOyRPnpXQb7bn2Q9/fdzsKfX15rOrtVfspux78MhZWCfXbTI2RbpgtYTIS2N qVKkA3KH4Roz2KF/NJSJwkgAxE7yVMfqXGHAEnNT/LAaURb8zbiR/RX9vJPQquV6pF2c mExg== 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 z28si3613488pfd.376.2018.02.15.16.44.01; Thu, 15 Feb 2018 16:44:15 -0800 (PST) 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 S1423620AbeBOPjy (ORCPT + 99 others); Thu, 15 Feb 2018 10:39:54 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:59890 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1423370AbeBOPjv (ORCPT ); Thu, 15 Feb 2018 10:39:51 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 3260B1113; Thu, 15 Feb 2018 15:39:50 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Will Deacon , Stephen Boyd , Catalin Marinas Subject: [PATCH 4.15 029/202] [Variant 3/Meltdown] arm64: cpu_errata: Add Kryo to Falkor 1003 errata Date: Thu, 15 Feb 2018 16:15:29 +0100 Message-Id: <20180215151714.479254507@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180215151712.768794354@linuxfoundation.org> References: <20180215151712.768794354@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Stephen Boyd Commit bb48711800e6 upstream. The Kryo CPUs are also affected by the Falkor 1003 errata, so we need to do the same workaround on Kryo CPUs. The MIDR is slightly more complicated here, where the PART number is not always the same when looking at all the bits from 15 to 4. Drop the lower 8 bits and just look at the top 4 to see if it's '2' and then consider those as Kryo CPUs. This covers all the combinations without having to list them all out. Fixes: 38fd94b0275c ("arm64: Work around Falkor erratum 1003") Acked-by: Will Deacon Signed-off-by: Stephen Boyd Signed-off-by: Catalin Marinas Signed-off-by: Will Deacon Conflicts: arch/arm64/include/asm/cputype.h Signed-off-by: Greg Kroah-Hartman --- Documentation/arm64/silicon-errata.txt | 2 +- arch/arm64/include/asm/cputype.h | 2 ++ arch/arm64/kernel/cpu_errata.c | 21 +++++++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) --- a/Documentation/arm64/silicon-errata.txt +++ b/Documentation/arm64/silicon-errata.txt @@ -72,7 +72,7 @@ stable kernels. | Hisilicon | Hip0{6,7} | #161010701 | N/A | | Hisilicon | Hip07 | #161600802 | HISILICON_ERRATUM_161600802 | | | | | | -| Qualcomm Tech. | Falkor v1 | E1003 | QCOM_FALKOR_ERRATUM_1003 | +| Qualcomm Tech. | Kryo/Falkor v1 | E1003 | QCOM_FALKOR_ERRATUM_1003 | | Qualcomm Tech. | Falkor v1 | E1009 | QCOM_FALKOR_ERRATUM_1009 | | Qualcomm Tech. | QDF2400 ITS | E0065 | QCOM_QDF2400_ERRATUM_0065 | | Qualcomm Tech. | Falkor v{1,2} | E1041 | QCOM_FALKOR_ERRATUM_1041 | --- a/arch/arm64/include/asm/cputype.h +++ b/arch/arm64/include/asm/cputype.h @@ -92,6 +92,7 @@ #define QCOM_CPU_PART_FALKOR_V1 0x800 #define QCOM_CPU_PART_FALKOR 0xC00 +#define QCOM_CPU_PART_KRYO 0x200 #define MIDR_CORTEX_A53 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A53) #define MIDR_CORTEX_A57 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A57) @@ -101,6 +102,7 @@ #define MIDR_THUNDERX_83XX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX_83XX) #define MIDR_QCOM_FALKOR_V1 MIDR_CPU_MODEL(ARM_CPU_IMP_QCOM, QCOM_CPU_PART_FALKOR_V1) #define MIDR_QCOM_FALKOR MIDR_CPU_MODEL(ARM_CPU_IMP_QCOM, QCOM_CPU_PART_FALKOR) +#define MIDR_QCOM_KRYO MIDR_CPU_MODEL(ARM_CPU_IMP_QCOM, QCOM_CPU_PART_KRYO) #ifndef __ASSEMBLY__ --- a/arch/arm64/kernel/cpu_errata.c +++ b/arch/arm64/kernel/cpu_errata.c @@ -30,6 +30,20 @@ is_affected_midr_range(const struct arm6 entry->midr_range_max); } +static bool __maybe_unused +is_kryo_midr(const struct arm64_cpu_capabilities *entry, int scope) +{ + u32 model; + + WARN_ON(scope != SCOPE_LOCAL_CPU || preemptible()); + + model = read_cpuid_id(); + model &= MIDR_IMPLEMENTOR_MASK | (0xf00 << MIDR_PARTNUM_SHIFT) | + MIDR_ARCHITECTURE_MASK; + + return model == entry->midr_model; +} + static bool has_mismatched_cache_line_size(const struct arm64_cpu_capabilities *entry, int scope) @@ -169,6 +183,13 @@ const struct arm64_cpu_capabilities arm6 MIDR_CPU_VAR_REV(0, 0), MIDR_CPU_VAR_REV(0, 0)), }, + { + .desc = "Qualcomm Technologies Kryo erratum 1003", + .capability = ARM64_WORKAROUND_QCOM_FALKOR_E1003, + .def_scope = SCOPE_LOCAL_CPU, + .midr_model = MIDR_QCOM_KRYO, + .matches = is_kryo_midr, + }, #endif #ifdef CONFIG_QCOM_FALKOR_ERRATUM_1009 {