From patchwork Wed May 30 11:38:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 922733 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40wpWc69KJz9s2S; Wed, 30 May 2018 21:38:36 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1fNzR0-0006GD-EW; Wed, 30 May 2018 11:38:30 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1fNzQw-0006Dp-2A for kernel-team@lists.ubuntu.com; Wed, 30 May 2018 11:38:26 +0000 Received: from mail-wm0-f71.google.com ([74.125.82.71]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1fNzQv-0006SK-R0 for kernel-team@lists.ubuntu.com; Wed, 30 May 2018 11:38:25 +0000 Received: by mail-wm0-f71.google.com with SMTP id a16-v6so12833087wmg.9 for ; Wed, 30 May 2018 04:38:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=pZWjnv56RTuNhzzZmpyq55DrgJRa6W7kL4vJF4oImqQ=; b=e0qGwtZYbwQkFhsrR8DaIRrhokj5WZmXHmZ8MDgZM2MPnVnuzoA19cLXsgA0HwKt7E 8IO7PmnaYU0rpl81mKtkPoN6RVOD0KFUHIzIrQKyOzBZgppUS6hXuHE75u8/MCTFlPd5 fMHyBwL7KtCiPxXr/gL9B63yvbRqeW0IvQ6JLkRvMBwCMlumkABGUk/y9ik7WgAAH2py uVCZKru8AgHZVR2bckeBAVDY7Y+C4I84GddE5ZTojLfkpCoTQaX3LAZtsTcNsVQkMYQd 8AQ6fYRdkl05BvuJWkzgczJFtF416E7vTkSpCh5h2JY5VPUG0ZyA3VJsQdv4mTxZIuS1 oLvQ== X-Gm-Message-State: ALKqPweiK61S2OS+oj33YdU+1Q3IOx7YyoPOq6SDP1zHzZFYqZIlzJJe ZKkRMgEOVZjdU7icaEesWH0UI/eDdfnMH66YlOAcwYoZzcFD7i+pOHoNmSgqFjkwm7OGHH4ViCz 5HRDER3R5cHe372f2F77QptyVGPFbmsVEqRUAE7kBwg== X-Received: by 2002:a50:b7ed:: with SMTP id i42-v6mr3097006ede.284.1527680305420; Wed, 30 May 2018 04:38:25 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK6r0TgiO4ZoJNhP0oSOY+WUAnQZwP0vev1r4sPWSYf7Om44kwkkm0qScRIzD84nBnkUoaPLw== X-Received: by 2002:a50:b7ed:: with SMTP id i42-v6mr3097001ede.284.1527680305317; Wed, 30 May 2018 04:38:25 -0700 (PDT) Received: from localhost.localdomain ([81.221.205.149]) by smtp.gmail.com with ESMTPSA id g1-v6sm9265853edi.41.2018.05.30.04.38.24 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 May 2018 04:38:24 -0700 (PDT) From: Juerg Haefliger X-Google-Original-From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [SRU][Xenial][PATCH 5/6] UBUNTU: SAUCE: x86/pti: Evaluate X86_BUG_CPU_MELTDOWN when pti=auto Date: Wed, 30 May 2018 13:38:16 +0200 Message-Id: <20180530113817.14784-6-juergh@canonical.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180530113817.14784-1-juergh@canonical.com> References: <20180530113817.14784-1-juergh@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" CVE-2018-3639 (x86) Commit f93e1bcdb1dd ("x86/pti: Do not enable PTI on CPUs which are not vulnerable to Meltdown") introduced a smarter detection of CPUs that are not affected by Meltdown. Make use of that when pti=auto which also matches Linus' tree. While at it, remove the unused variable 'enable'. Signed-off-by: Juerg Haefliger --- arch/x86/mm/kaiser.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/x86/mm/kaiser.c b/arch/x86/mm/kaiser.c index 7a72e32e4806..5a2d27a880e9 100644 --- a/arch/x86/mm/kaiser.c +++ b/arch/x86/mm/kaiser.c @@ -278,7 +278,6 @@ static void __init kaiser_init_all_pgds(void) void __init kaiser_check_boottime_disable(void) { - bool enable = true; char arg[5]; int ret; @@ -301,13 +300,11 @@ void __init kaiser_check_boottime_disable(void) goto disable; skip: - if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) + if (!boot_cpu_has_bug(X86_BUG_CPU_MELTDOWN)) goto disable; enable: - if (enable) - setup_force_cpu_cap(X86_FEATURE_KAISER); - + setup_force_cpu_cap(X86_FEATURE_KAISER); return; disable: