Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2045703imm; Mon, 16 Jul 2018 00:49:56 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd9w+vXPRhCMEVEXXKgJp/SOzkxmN7BokfC8DH1iACzVjqTGxzKAOWn+yDqEzk6auaM63k1 X-Received: by 2002:a63:788b:: with SMTP id t133-v6mr9799731pgc.329.1531727396625; Mon, 16 Jul 2018 00:49:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531727396; cv=none; d=google.com; s=arc-20160816; b=uXWaCadwwRR+oEsXTmXC5XHerCn92XM36xI0i0e21+DzVWsgImta1OxUpa+aMvnAnp d4ByuXs38OLpTYB+0l2G/onbq4Po85I43C9Z5Isperw10YWm6qq4wTwcR3l2qfylNedr I8P5umko7oUQiK/JXjXI0XlHoMKwlfUqZj2KWwJYobL/oJVbvUcX7mWuOdk2+8jV54/+ wfCCOaWKQx3tpTVcCkwfjt4p1BpWhj3K9gNXX6IN6xLdp7EXRYlbzpmtq4uSCOVFji9S 8szBP9tZMQQAvogvRhJt7+4vIQLM7RaIbJj8plVuRQR8nLK97qL4Ql28TFvAW4x00v+/ 9XgQ== 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=tldmmb3hYgMDRyNWoNc7nRyzo2cG4cSL7IgbhBfTi+U=; b=kfFmdX5U7Q3/yicbrXSHFMS711xs9MgMJ0/RireoSGa4KlortgFexVFXaGtK/M5mGJ PdYaagaUTU0pCm2yBzGOYfEKEdmiO690ldpYVYi+CcCiAYFT8X0YZUGwPcqpE6c0QBqx WPSxxmFTkxZqNlRXBCM1MI5xPqOtrtV+uGbtfq4yRdhjRAm5P3mjhtWahx5sqCwt5M08 PmLBUSzrl327BQLQV/ZsMXePAwQuCKFI4wsJM8xLMIZau3BkIeoGS3hI2ws6TzOKpw4m zxrBVSwUwbX9LwCfZ/L+YdHemeTp1XkQ2A34qcqbmNMeNBCfYXSp9LQ9xhEuKqXE4Mcf B9jg== 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 u5-v6si18844988pls.372.2018.07.16.00.49.41; Mon, 16 Jul 2018 00:49:56 -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 S2389324AbeGPIK0 (ORCPT + 99 others); Mon, 16 Jul 2018 04:10:26 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:48184 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388522AbeGPIKY (ORCPT ); Mon, 16 Jul 2018 04:10:24 -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 3DB5BCA5; Mon, 16 Jul 2018 07:44:21 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Borislav Petkov , Josh Triplett , Thomas Gleixner , "Srivatsa S. Bhat" , "Matt Helsley (VMware)" , Alexey Makhalov , Bo Gan Subject: [PATCH 4.4 18/43] x86/cpu: Provide a config option to disable static_cpu_has Date: Mon, 16 Jul 2018 09:36:23 +0200 Message-Id: <20180716073513.830018745@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180716073511.796555857@linuxfoundation.org> References: <20180716073511.796555857@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.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Borislav Petkov commit 6e1315fe82308cd29e7550eab967262e8bbc71a3 upstream This brings .text savings of about ~1.6K when building a tinyconfig. It is off by default so nothing changes for the default. Kconfig help text from Josh. Signed-off-by: Borislav Petkov Reviewed-by: Josh Triplett Link: http://lkml.kernel.org/r/1449481182-27541-5-git-send-email-bp@alien8.de Signed-off-by: Thomas Gleixner Signed-off-by: Srivatsa S. Bhat Reviewed-by: Matt Helsley (VMware) Reviewed-by: Alexey Makhalov Reviewed-by: Bo Gan Signed-off-by: Greg Kroah-Hartman --- arch/x86/Kconfig | 11 +++++++++++ arch/x86/include/asm/cpufeature.h | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -346,6 +346,17 @@ config X86_FEATURE_NAMES If in doubt, say Y. +config X86_FAST_FEATURE_TESTS + bool "Fast CPU feature tests" if EMBEDDED + default y + ---help--- + Some fast-paths in the kernel depend on the capabilities of the CPU. + Say Y here for the kernel to patch in the appropriate code at runtime + based on the capabilities of the CPU. The infrastructure for patching + code at runtime takes up some additional space; space-constrained + embedded systems may wish to say N here to produce smaller, slightly + slower code. + config X86_X2APIC bool "Support x2apic" depends on X86_LOCAL_APIC && X86_64 && (IRQ_REMAP || HYPERVISOR_GUEST) --- a/arch/x86/include/asm/cpufeature.h +++ b/arch/x86/include/asm/cpufeature.h @@ -422,7 +422,7 @@ extern const char * const x86_bug_flags[ * fast paths and boot_cpu_has() otherwise! */ -#if __GNUC__ >= 4 +#if __GNUC__ >= 4 && defined(CONFIG_X86_FAST_FEATURE_TESTS) extern void warn_pre_alternatives(void); extern bool __static_cpu_has_safe(u16 bit);