Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3334112imu; Fri, 18 Jan 2019 08:38:06 -0800 (PST) X-Google-Smtp-Source: ALg8bN4Ylu2gSn4LwzJBj3maMcJtL5KJp/QNRbbo/oxSU7BN4ivrKZsGzDyXtesUGR5SQE7Wc+5S X-Received: by 2002:a63:e101:: with SMTP id z1mr18453210pgh.310.1547829486385; Fri, 18 Jan 2019 08:38:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547829486; cv=none; d=google.com; s=arc-20160816; b=PpwmcYAwMBVL26xAHteWhL9nITr84RiRs7JkcaBEctu3T9dxIbXii47RVwzrKQOKcz e4p+ZyGNN7ZeDiftDsZIjynEaWO+MFiqQeN6haUgqfuk+R7S0ZAh6yaH6doP7Xfic/Z4 nbNgoqb4kyzrW90qi6FlfE1rsIqfEL8sVg7hPKuNVpTzJ3ab24mQy5sx7iUtSJTmGQyX /W6CDMk34E6OcHyPeTNvLy7UA80+MvCfOhk4wTOt4jv5bHbklgvaFMfUNu73V9O4S2H9 fh0IA1dZVExJWGxnc9+5lYrCrAF9ONwerW/Pdadcr2+0PoTFHKUwTkf738C4qrKhiYbj 7PYA== 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; bh=1KPItTq4TA1OnU0leQ2F83G6AiBD4HjoKZ0PBHOSe9c=; b=cRxnBf8YlT7pZ3QNA8Zvap6zhLvdNe8o6LilzrqVp9O9SERnz5Iqm+wH5Og9y0mbiv LGKjopYJ55y9NviAhdADsGcZM4HWgYwSQGVhk8aL5I8UH0KJcw9ZNSBry/QIk8SZ6BiJ Z0mCKjrXwEff5wWe7FmUug1lEWHWzPUl9PL2js9bARmxlRKwowinUv3ioB1zqxCIcgDA tpmb6xG4NcQJ+gXvXOBjrOTJ47soO1APvgmeb8VjVq0Di6zfPAV3sXX4jqwOlwy1nT+a Uch7MYID4dndn4gHZmTEmaCcNhnbu9C4+eIM8idGxVMsOSgKH2uaaBkG0g4mMVh1mY5k WWyg== 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 a35si4910112pla.226.2019.01.18.08.37.47; Fri, 18 Jan 2019 08:38:06 -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 S1728203AbfARQfr (ORCPT + 99 others); Fri, 18 Jan 2019 11:35:47 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:33760 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727491AbfARQfr (ORCPT ); Fri, 18 Jan 2019 11:35:47 -0500 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 0B13F80D; Fri, 18 Jan 2019 08:35:47 -0800 (PST) Received: from [192.168.100.241] (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 48AD83F557; Fri, 18 Jan 2019 08:35:46 -0800 (PST) Subject: Re: [PATCH v3 3/7] arm64: kpti: move check for non-vulnerable CPUs to a function To: Suzuki K Poulose , linux-arm-kernel@lists.infradead.org Cc: catalin.marinas@arm.com, will.deacon@arm.com, marc.zyngier@arm.com, dave.martin@arm.com, shankerd@codeaurora.org, linux-kernel@vger.kernel.org, ykaukab@suse.de, julien.thierry@arm.com, mlangsdo@redhat.com, Steven.Price@arm.com, stefan.wahren@i2se.com References: <20190109235544.2992426-1-jeremy.linton@arm.com> <20190109235544.2992426-4-jeremy.linton@arm.com> <553c4f17-b504-a7a2-51cf-9c0d6c5d7797@arm.com> From: Jeremy Linton Message-ID: <26cdac8e-ff62-d35c-50ca-a50d86f6651b@arm.com> Date: Fri, 18 Jan 2019 10:35:45 -0600 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: <553c4f17-b504-a7a2-51cf-9c0d6c5d7797@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 01/14/2019 05:32 AM, Suzuki K Poulose wrote: > Hi Jeremy, > > On 09/01/2019 23:55, Jeremy Linton wrote: >> From: Mian Yousaf Kaukab >> >> Add is_meltdown_safe() which is a whitelist of known safe cores. >> >> Signed-off-by: Mian Yousaf Kaukab >> [Moved location of function] >> Signed-off-by: Jeremy Linton >> --- >>   arch/arm64/kernel/cpufeature.c | 15 +++++++++++---- >>   1 file changed, 11 insertions(+), 4 deletions(-) >> >> diff --git a/arch/arm64/kernel/cpufeature.c >> b/arch/arm64/kernel/cpufeature.c >> index 4f272399de89..ab784d7a0083 100644 >> --- a/arch/arm64/kernel/cpufeature.c >> +++ b/arch/arm64/kernel/cpufeature.c >> @@ -947,8 +947,7 @@ has_useable_cnp(const struct >> arm64_cpu_capabilities *entry, int scope) >>   #ifdef CONFIG_UNMAP_KERNEL_AT_EL0 >>   static int __kpti_forced; /* 0: not forced, >0: forced on, <0: >> forced off */ >> -static bool unmap_kernel_at_el0(const struct arm64_cpu_capabilities >> *entry, >> -                int scope) >> +static bool is_cpu_meltdown_safe(void) >>   { >>       /* List of CPUs that are not vulnerable and don't need KPTI */ >>       static const struct midr_range kpti_safe_list[] = { >> @@ -962,6 +961,15 @@ static bool unmap_kernel_at_el0(const struct >> arm64_cpu_capabilities *entry, >>           MIDR_ALL_VERSIONS(MIDR_CORTEX_A73), >>           { /* sentinel */ } >>       }; >> +    if (is_midr_in_range_list(read_cpuid_id(), kpti_safe_list)) > > nit: Does it make sense to rename the list to "meltdown_safe_list", to > match the > function name ? > > Also also, you may do : > >     return is_midr_in_range_list(read_cpuid_id(), kpti_safe_list); > > Either way > > Reviewed-by: Suzuki K Poulose Hi, again. Part of the delay in responding to this one, has been the fact that originally meltodwn_safe() was being used in two places (which is why it was broken out). But that isn't true anymore, and this patch is effectively just fluff, so it seemed appropriate for the chopping block too, which is what i'm planning.