Received: by 10.223.176.46 with SMTP id f43csp3260187wra; Mon, 22 Jan 2018 11:00:02 -0800 (PST) X-Google-Smtp-Source: AH8x22427GEq3Fb7Urh3GPGpDhgagTIgsN0RJ4qKdveSwtEnYMIZHWHKBRCzDLFAydQT0ms1rzFw X-Received: by 10.107.149.149 with SMTP id x143mr9851886iod.194.1516647601983; Mon, 22 Jan 2018 11:00:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516647601; cv=none; d=google.com; s=arc-20160816; b=byDPFG6w9Pa+4RWzpktUGE3XsJC3N1l3Brb37Sul+E2R6d83dLGK/S8KIeSKshRz4E e/8g66VEryqJt56rHDnrR4mCVzNw3Y8laCyBBN4q7rZGrAG0coFX9JgWQwMyW3CS0vtY 9npdOXbC+eGh17YrfCrryodmK3MJ+iyxywQY4er8Wacg5Ee7ebQuY8m7jey3mvisBa13 YZcRDaiiubC6h47To0S0XAGo+cTdHkofw1M3ZlOSCqLJD5inJdohRyhDvKDmWsGaK7r9 njDoo8sT6y/Ar1uvkJvulF2alWhrAaIuScFXCwa7hiFFhbyc/4GeHVSKdiF7vXnQKiht v0cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:organization :from:cc:references:to:arc-authentication-results; bh=dcwMOFVB0jjtfxZ88u7HtPRhVMkexjji+hWlhRIwNC8=; b=bJLTdtXoZpDsCnIDXcWfZzaRMNxnWeZuW+GSrIr1gjKqoUa4URSokNJsJIBHkmnCly /jKfeHrGbZ9aW0vlpYMylDwDu3CogHT0vqcpG46daHMH7O2uJrqQqZE/hTYYZjx7UVOn bYdnZBLOZqPNke2092Co/vXJYUi8c6af7o4UeRY+xCfidTBYdq++gP2nBq23tBbxt8cS y8GI8b/5jF9I7c6SI1nDhrzf0KOxLXtpncrfjhldd5Y9nuuyc4v1Az5VPsWJVY7Z5TFE IgxEK/5XpWR1e8X+2F75lDt3lbEz6R52ocFhTbzsgioDqCAkfZyFpw9F0Pshq4SoCzA3 jfww== 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 f185si6624955ith.3.2018.01.22.10.59.48; Mon, 22 Jan 2018 11:00:01 -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 S1751559AbeAVS72 (ORCPT + 99 others); Mon, 22 Jan 2018 13:59:28 -0500 Received: from edison.jonmasters.org ([173.255.233.168]:55824 "EHLO edison.jonmasters.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751156AbeAVS7Z (ORCPT ); Mon, 22 Jan 2018 13:59:25 -0500 Received: from cpe-68-173-157-109.nyc.res.rr.com ([68.173.157.109] helo=washington.bos.jonmasters.org) by edison.jonmasters.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1edhJT-0003oo-JD; Mon, 22 Jan 2018 18:59:23 +0000 To: Will Deacon , Jayachandran C References: <20180118135354.GB20783@arm.com> <1516364568-95577-1-git-send-email-jnair@caviumnetworks.com> <1516364568-95577-2-git-send-email-jnair@caviumnetworks.com> <20180122114155.GC15456@arm.com> Cc: marc.zyngier@arm.com, linux-arm-kernel@lists.infradead.org, lorenzo.pieralisi@arm.com, ard.biesheuvel@linaro.org, catalin.marinas@arm.com, linux-kernel@vger.kernel.org, labbott@redhat.com, christoffer.dall@linaro.org, suzuki.poulose@arm.com From: Jon Masters Organization: World Organi{s,z}ation Of Broken Dreams Message-ID: <13e17bd2-b83c-6c67-eb0c-c80604b7dcc3@jonmasters.org> Date: Mon, 22 Jan 2018 13:59:17 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <20180122114155.GC15456@arm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 68.173.157.109 X-SA-Exim-Mail-From: jcm@jonmasters.org X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on edison.jonmasters.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED autolearn=ham version=3.3.1 Subject: Re: [PATCH v3 2/2] arm64: Turn on KPTI only on CPUs that need it X-SA-Exim-Version: 4.2.1 (built Sun, 08 Nov 2009 07:31:22 +0000) X-SA-Exim-Scanned: Yes (on edison.jonmasters.org) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/22/2018 06:41 AM, Will Deacon wrote: > On Fri, Jan 19, 2018 at 04:22:48AM -0800, Jayachandran C wrote: >> 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. >> >> Signed-off-by: Jayachandran C >> --- >> arch/arm64/kernel/cpufeature.c | 7 +++++++ >> 1 file changed, 7 insertions(+) >> >> diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c >> index 647d44b..fb698ca 100644 >> --- a/arch/arm64/kernel/cpufeature.c >> +++ b/arch/arm64/kernel/cpufeature.c >> @@ -866,6 +866,13 @@ static bool unmap_kernel_at_el0(const struct arm64_cpu_capabilities *entry, >> 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); > > We'll need to re-jig this to work properly with big/little because this is > only called once, but that's ok for now: > > Acked-by: Will Deacon > > Suzuki has a series reworking much of the cpufeatures code so that we can > do this properly for 4.17. Thanks, much appreciated. Jon.