linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@linux.intel.com>
To: "H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Linus Torvalds <torvalds@linux-foundation.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Mario Gzuk <mariogzuk@technikz.de>,
	"H. Peter Anvin" <hpa@linux.intel.com>
Subject: [PATCH 5/8] x86, 386 removal: Remove CONFIG_INVLPG
Date: Wed, 28 Nov 2012 11:50:27 -0800	[thread overview]
Message-ID: <1354132230-21854-6-git-send-email-hpa@linux.intel.com> (raw)
In-Reply-To: <1354132230-21854-1-git-send-email-hpa@linux.intel.com>

From: "H. Peter Anvin" <hpa@linux.intel.com>

All 486+ CPUs support INVLPG, so remove the fallback 386 support
code.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
 arch/x86/Kconfig.cpu              | 4 ----
 arch/x86/include/asm/cpufeature.h | 6 ------
 arch/x86/include/asm/tlbflush.h   | 3 ---
 arch/x86/kernel/cpu/amd.c         | 3 ---
 arch/x86/kernel/cpu/intel.c       | 4 ----
 arch/x86/mm/tlb.c                 | 8 +++-----
 6 files changed, 3 insertions(+), 25 deletions(-)

diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu
index 8e5867c..d3bdc18 100644
--- a/arch/x86/Kconfig.cpu
+++ b/arch/x86/Kconfig.cpu
@@ -328,10 +328,6 @@ config X86_INVD_BUG
 config X86_WP_WORKS_OK
 	def_bool y
 
-config X86_INVLPG
-	def_bool y
-	depends on X86_32
-
 config X86_POPAD_OK
 	def_bool y
 	depends on X86_32
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
index 8c297aa..ff8dd62 100644
--- a/arch/x86/include/asm/cpufeature.h
+++ b/arch/x86/include/asm/cpufeature.h
@@ -312,12 +312,6 @@ extern const char * const x86_power_flags[32];
 #define cpu_has_cx16		boot_cpu_has(X86_FEATURE_CX16)
 #define cpu_has_eager_fpu	boot_cpu_has(X86_FEATURE_EAGER_FPU)
 
-#if defined(CONFIG_X86_INVLPG) || defined(CONFIG_X86_64)
-# define cpu_has_invlpg		1
-#else
-# define cpu_has_invlpg		(boot_cpu_data.x86 > 3)
-#endif
-
 #ifdef CONFIG_X86_64
 
 #undef  cpu_has_vme
diff --git a/arch/x86/include/asm/tlbflush.h b/arch/x86/include/asm/tlbflush.h
index 74a4433..0fee48e 100644
--- a/arch/x86/include/asm/tlbflush.h
+++ b/arch/x86/include/asm/tlbflush.h
@@ -56,10 +56,7 @@ static inline void __flush_tlb_all(void)
 
 static inline void __flush_tlb_one(unsigned long addr)
 {
-	if (cpu_has_invlpg)
 		__flush_tlb_single(addr);
-	else
-		__flush_tlb();
 }
 
 #define TLB_FLUSH_ALL	-1UL
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index 1b7d165..a025d8c 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -753,9 +753,6 @@ static unsigned int __cpuinit amd_size_cache(struct cpuinfo_x86 *c,
 
 static void __cpuinit cpu_set_tlb_flushall_shift(struct cpuinfo_x86 *c)
 {
-	if (!cpu_has_invlpg)
-		return;
-
 	tlb_flushall_shift = 5;
 
 	if (c->x86 <= 0x11)
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index 198e019..fcaabd0 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -612,10 +612,6 @@ static void __cpuinit intel_tlb_lookup(const unsigned char desc)
 
 static void __cpuinit intel_tlb_flushall_shift_set(struct cpuinfo_x86 *c)
 {
-	if (!cpu_has_invlpg) {
-		tlb_flushall_shift = -1;
-		return;
-	}
 	switch ((c->x86 << 8) + c->x86_model) {
 	case 0x60f: /* original 65 nm celeron/pentium/core2/xeon, "Merom"/"Conroe" */
 	case 0x616: /* single-core 65 nm celeron/core2solo "Merom-L"/"Conroe-L" */
diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
index 60f926c..13a6b29 100644
--- a/arch/x86/mm/tlb.c
+++ b/arch/x86/mm/tlb.c
@@ -104,7 +104,7 @@ static void flush_tlb_func(void *info)
 		return;
 
 	if (this_cpu_read(cpu_tlbstate.state) == TLBSTATE_OK) {
-		if (f->flush_end == TLB_FLUSH_ALL || !cpu_has_invlpg)
+		if (f->flush_end == TLB_FLUSH_ALL)
 			local_flush_tlb();
 		else if (!f->flush_end)
 			__flush_tlb_single(f->flush_start);
@@ -337,10 +337,8 @@ static const struct file_operations fops_tlbflush = {
 
 static int __cpuinit create_tlb_flushall_shift(void)
 {
-	if (cpu_has_invlpg) {
-		debugfs_create_file("tlb_flushall_shift", S_IRUSR | S_IWUSR,
-			arch_debugfs_dir, NULL, &fops_tlbflush);
-	}
+	debugfs_create_file("tlb_flushall_shift", S_IRUSR | S_IWUSR,
+			    arch_debugfs_dir, NULL, &fops_tlbflush);
 	return 0;
 }
 late_initcall(create_tlb_flushall_shift);
-- 
1.7.11.7


  parent reply	other threads:[~2012-11-28 19:52 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-28 19:50 [PATCH 0/8] RFC: Remove 386 support H. Peter Anvin
2012-11-28 19:50 ` [PATCH 1/8] x86, 386 removal: Remove CONFIG_M386 from Kconfig H. Peter Anvin
2012-12-01  0:34   ` [tip:x86/nuke386] " tip-bot for H. Peter Anvin
2012-11-28 19:50 ` [PATCH 2/8] x86, 386 removal: Remove CONFIG_CMPXCHG H. Peter Anvin
2012-12-01  0:35   ` [tip:x86/nuke386] " tip-bot for H. Peter Anvin
2012-11-28 19:50 ` [PATCH 3/8] x86, 386 removal: Remove CONFIG_XADD H. Peter Anvin
2012-11-28 20:30   ` Borislav Petkov
2012-12-01  0:36   ` [tip:x86/nuke386] " tip-bot for H. Peter Anvin
2012-11-28 19:50 ` [PATCH 4/8] x86, 386 removal: Remove CONFIG_BSWAP H. Peter Anvin
2012-12-01  0:37   ` [tip:x86/nuke386] " tip-bot for H. Peter Anvin
2012-11-28 19:50 ` H. Peter Anvin [this message]
2012-12-01  0:38   ` [tip:x86/nuke386] x86, 386 removal: Remove CONFIG_INVLPG tip-bot for H. Peter Anvin
2012-11-28 19:50 ` [PATCH 6/8] x86, 386 removal: Remove CONFIG_X86_WP_WORKS_OK H. Peter Anvin
2012-11-28 20:52   ` Alan Cox
2012-11-28 23:11     ` H. Peter Anvin
2012-12-01  0:42     ` [tip:x86/nuke386] x86, 386 removal: Document Nx586 as a 386 and thus unsupported tip-bot for H. Peter Anvin
2012-12-01  0:39   ` [tip:x86/nuke386] x86, 386 removal: Remove CONFIG_X86_WP_WORKS_OK tip-bot for H. Peter Anvin
2012-11-28 19:50 ` [PATCH 7/8] x86, 386 removal: Remove CONFIG_X86_POPAD_OK H. Peter Anvin
2012-12-01  0:40   ` [tip:x86/nuke386] " tip-bot for H. Peter Anvin
2012-11-28 19:50 ` [PATCH 8/8] x86, cleanups: Simplify sync_core() in the case of no CPUID H. Peter Anvin
2012-11-28 20:41   ` Borislav Petkov
2012-11-29  0:14     ` H. Peter Anvin
2012-11-29  9:13       ` Borislav Petkov
2012-11-29 21:06         ` H. Peter Anvin
2012-11-29 21:18           ` Borislav Petkov
2012-11-29 21:20             ` H. Peter Anvin
2012-11-29 21:31               ` Borislav Petkov
2012-11-29 21:24     ` H. Peter Anvin
2012-11-29 21:34       ` Borislav Petkov
2012-11-30 17:01       ` Linus Torvalds
2012-11-30 17:28         ` Borislav Petkov
2012-11-30 18:03         ` H. Peter Anvin
2012-11-30 18:10           ` Borislav Petkov
2012-11-30 18:40             ` H. Peter Anvin
2012-12-01  0:41   ` [tip:x86/nuke386] " tip-bot for H. Peter Anvin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1354132230-21854-6-git-send-email-hpa@linux.intel.com \
    --to=hpa@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mariogzuk@technikz.de \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).