Received: by 10.223.185.116 with SMTP id b49csp448367wrg; Fri, 16 Feb 2018 01:33:11 -0800 (PST) X-Google-Smtp-Source: AH8x227kJmpEWbc4Q28NGuMiGI8z6Qqx9PZy7euHwPAPOm9/gR0NcxY4H5KCRAc2blyIUb8lkw5z X-Received: by 2002:a17:902:208:: with SMTP id 8-v6mr5323245plc.359.1518773591244; Fri, 16 Feb 2018 01:33:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518773591; cv=none; d=google.com; s=arc-20160816; b=MzVE2xjcHDqlNtx8+3kXnZE8r1cY1zPfw8Z2AdRYe0gu1gf847wGYTjsGBOKNTHDZC EBF1+KjweGgakBgMC0fiiHYds4+J1bwtVXBipoBt3PQlvqgnqPRREtVTK7gpseo8iC0X CRkb156OySH/9IctDIzD4YvHTiipoQWEwtTvwZKNqGbz0TaIAu215qrCux0iMRWaGRS4 qkcdvVlp0XcDsXfpmU60PCOKOZPzrvkIOWI5bL0wjsGszhlXumCEH3MfaLJh1WZK7hSV mPtss6/eCc9OR+kWPkAUuEmvfSNR9cJsGgASblwWOZHK+nFFlnRHTLG2NX1ItS8fzy76 IUEQ== 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=k9gPN6pTLVozOQV+YLT9huuW0cbXmm9lt7/xEzryPbU=; b=GuwLvzGeFe1jtq1iewB/XPDte7R/KU3bEAjM+nvS2e8MuC6lJUinhjouNd1zaac4hr /WGg6P9tKPzet30RCjB5dlFOyYPL2WcIjrMTGIwycq4tw4ktOAmMIRDyYQwvJA2q3f0/ 09EltVzGV+iq6nhZNRk3AgATRKTgkQheqVO6PCLp8Yg4phAYQUrSjki1yprsD+LGuXxO 3HoKy5o+zKqkBihfKsADaZEOrcCBboYQG6XTsWRDENYCPmEHrS9OMeHOiIYVxVgNIPMU 979JueSyjUBsJ8wtMFpiQeqPLPFaG2zqo5zfcFSPru00RytGvRAut65YWcAoouqTv/6A RAgw== 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 w5si5143188pgs.259.2018.02.16.01.32.43; Fri, 16 Feb 2018 01:33:11 -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 S1426495AbeBOQvH (ORCPT + 99 others); Thu, 15 Feb 2018 11:51:07 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:60104 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1423276AbeBOPk0 (ORCPT ); Thu, 15 Feb 2018 10:40:26 -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 927B2115A; Thu, 15 Feb 2018 15:40:25 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Will Deacon , Jayachandran C , Catalin Marinas Subject: [PATCH 4.15 041/202] [Variant 3/Meltdown] arm64: Turn on KPTI only on CPUs that need it Date: Thu, 15 Feb 2018 16:15:41 +0100 Message-Id: <20180215151715.310098043@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: Jayachandran C Commit 0ba2e29c7fc1 upstream. Whitelist Broadcom Vulcan/Cavium ThunderX2 processors in unmap_kernel_at_el0(). These CPUs are not vulnerable to CVE-2017-5754 and do not need KPTI when KASLR is off. Acked-by: Will Deacon Signed-off-by: Jayachandran C Signed-off-by: Catalin Marinas Signed-off-by: Will Deacon Signed-off-by: Greg Kroah-Hartman --- arch/arm64/kernel/cpufeature.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -866,6 +866,13 @@ static bool unmap_kernel_at_el0(const st if (IS_ENABLED(CONFIG_RANDOMIZE_BASE)) return true; + /* Don't force KPTI for CPUs that are not vulnerable */ + switch (read_cpuid_id() & MIDR_CPU_MODEL_MASK) { + case MIDR_CAVIUM_THUNDERX2: + case MIDR_BRCM_VULCAN: + return false; + } + /* Defer to CPU feature registers */ return !cpuid_feature_extract_unsigned_field(pfr0, ID_AA64PFR0_CSV3_SHIFT);