Received: by 10.213.65.68 with SMTP id h4csp702525imn; Fri, 6 Apr 2018 07:32:05 -0700 (PDT) X-Google-Smtp-Source: AIpwx49PbNbOryvPAEz4rbROLerDmhwUcAAxYD4zIXM0Jls18XiBWPMiyVmP+l0F67gihvKkdkV9 X-Received: by 2002:a17:902:8f8c:: with SMTP id z12-v6mr27895867plo.400.1523025125523; Fri, 06 Apr 2018 07:32:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523025125; cv=none; d=google.com; s=arc-20160816; b=J3aGo/xNGVa0zyBv85fWYZdin5DDbs+EMsu50OQtw2f7CFxtC8FT25jCQcD0RSqXxB Cs8K3e2IYC/YHLS8ConKmOQgmEymiTubhYmizNsHTNeijBl7+1Adz+ReczBHfD5M1Z/a kh9x2HsybnzOwTyrQmKJVW+HBhOOuENUgh52j1F+7hxcQ+2Hv6QBq/L1wb/1+bTPxWxH KOUWpfohg8V8IJq5usE4khrDdrFzmHHLZqbeWpI/Eeq+/w3BLsH9BX8VBZTvszl3Jbxp XbbBvEJChzbgWqn9EKG5wYNS3jVN/EB2LxdG7DMZyyy+pNFerAakQfV6SA5iZGXh1MKK Bh5w== 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=Iv5JXZgaKLP4eXy/ibrUlmhvLP5vVkLc7t0dwtokLUI=; b=Ir0sD7AG8RAeNJ7d8HSgWkcG6ireGomOqm8LA13GwUiMek4Bql46s+/Hhkn4N1FZ38 t/Nteu+lNzKR3T1hGue8+pSNHMBLXOtW2+sf3UWW7/9pb8hMET+EY4V5UABbtK4Ql9sY ZSGXfa+KGPYZ10Rxc4zIDEqYH6jw5kp20nQ7Xi5IjQHKMaEcXOWtourVhtZVtiG9+vUs dtEb/omyvD8+Sw74kOXnSs2FGmZy0PUH0S/qz1buPPzbUd/UtdhZx7mgWxAmIvFInBUt vZR22TMHmwO8Qgjmj3i1hKeInuSv3eBfXcFpn5tB0wZ4NP6xVeGbZ57vDgVBCe1QVhrd 2LUA== 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 92-v6si8260307pli.623.2018.04.06.07.31.51; Fri, 06 Apr 2018 07:32:05 -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 S932241AbeDFNhW (ORCPT + 99 others); Fri, 6 Apr 2018 09:37:22 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:60804 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932231AbeDFNhU (ORCPT ); Fri, 6 Apr 2018 09:37:20 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 43150407; Fri, 6 Apr 2018 13:37:05 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Greg Kroah-Hartman , Will Deacon , Jayachandran C , Catalin Marinas , Greg Hackmann , Alex Shi , Mark Rutland Subject: [PATCH 4.9 071/102] arm64: Turn on KPTI only on CPUs that need it Date: Fri, 6 Apr 2018 15:23:52 +0200 Message-Id: <20180406084341.470027340@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180406084331.507038179@linuxfoundation.org> References: <20180406084331.507038179@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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.9-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: Alex Shi [v4.9 backport] Signed-off-by: Mark Rutland [v4.9 backport] Tested-by: Will Deacon Tested-by: Greg Hackmann 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 @@ -766,6 +766,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);