public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Hansen <dave@sr71.net>
To: linux-kernel@vger.kernel.org
Cc: x86@kernel.org, hpa@zytor.com, tglx@linutronix.de,
	mingo@redhat.com, fenghua.yu@intel.com,
	Dave Hansen <dave@sr71.net>,
	dave.hansen@linux.intel.com, bp@suse.de
Subject: [PATCH 1/3] x86: axe the lightly-used cpu_has_pae
Date: Thu, 11 Sep 2014 14:15:11 -0700	[thread overview]
Message-ID: <20140911211511.AD76E774@viggo.jf.intel.com> (raw)
In-Reply-To: <20140911211510.D032EC3B@viggo.jf.intel.com>


From: Dave Hansen <dave.hansen@linux.intel.com>

cpu_has_pae is only referenced in one place: the X86_32 kexec
code (in a file not even built on 64-bit).  It hardly warrants
its own macro, or the trouble we go to ensuring that it can't
be called in X86_64 code.

Axe the macro and replace it with a direct cpu feature check.

Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Acked-by: Borislav Petkov <bp@suse.de>
---

 b/arch/x86/include/asm/cpufeature.h  |    4 ----
 b/arch/x86/kernel/machine_kexec_32.c |    3 ++-
 2 files changed, 2 insertions(+), 5 deletions(-)

diff -puN arch/x86/include/asm/cpufeature.h~x86-axe-cpu_has_pae arch/x86/include/asm/cpufeature.h
--- a/arch/x86/include/asm/cpufeature.h~x86-axe-cpu_has_pae	2014-08-13 13:39:06.903716185 -0700
+++ b/arch/x86/include/asm/cpufeature.h	2014-08-13 13:39:19.610291207 -0700
@@ -300,7 +300,6 @@ extern const char * const x86_bug_flags[
 #define cpu_has_de		boot_cpu_has(X86_FEATURE_DE)
 #define cpu_has_pse		boot_cpu_has(X86_FEATURE_PSE)
 #define cpu_has_tsc		boot_cpu_has(X86_FEATURE_TSC)
-#define cpu_has_pae		boot_cpu_has(X86_FEATURE_PAE)
 #define cpu_has_pge		boot_cpu_has(X86_FEATURE_PGE)
 #define cpu_has_apic		boot_cpu_has(X86_FEATURE_APIC)
 #define cpu_has_sep		boot_cpu_has(X86_FEATURE_SEP)
@@ -358,9 +357,6 @@ extern const char * const x86_bug_flags[
 #undef  cpu_has_vme
 #define cpu_has_vme		0
 
-#undef  cpu_has_pae
-#define cpu_has_pae		___BUG___
-
 #undef  cpu_has_k6_mtrr
 #define cpu_has_k6_mtrr		0
 
diff -puN arch/x86/kernel/machine_kexec_32.c~x86-axe-cpu_has_pae arch/x86/kernel/machine_kexec_32.c
--- a/arch/x86/kernel/machine_kexec_32.c~x86-axe-cpu_has_pae	2014-08-13 13:39:06.905716275 -0700
+++ b/arch/x86/kernel/machine_kexec_32.c	2014-08-13 13:39:06.937717723 -0700
@@ -247,7 +247,8 @@ void machine_kexec(struct kimage *image)
 	/* now call it */
 	image->start = relocate_kernel_ptr((unsigned long)image->head,
 					   (unsigned long)page_list,
-					   image->start, cpu_has_pae,
+					   image->start,
+					   boot_cpu_has(X86_FEATURE_PAE),
 					   image->preserve_context);
 
 #ifdef CONFIG_KEXEC_JUMP
_

  reply	other threads:[~2014-09-11 21:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-11 21:15 [PATCH 0/3] [v3] x86: disabled features macros Dave Hansen
2014-09-11 21:15 ` Dave Hansen [this message]
2014-09-11 21:34   ` [tip:x86/cpufeature] x86: Axe the lightly-used cpu_has_pae tip-bot for Dave Hansen
2014-09-11 21:15 ` [PATCH 2/3] x86: introduce disabled-features Dave Hansen
2014-09-11 21:34   ` [tip:x86/cpufeature] x86: Introduce disabled-features tip-bot for Dave Hansen
2014-09-11 21:15 ` [PATCH 3/3] x86: add more disabled features Dave Hansen
2014-09-11 21:34   ` [tip:x86/cpufeature] x86: Add " tip-bot for Dave Hansen

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=20140911211511.AD76E774@viggo.jf.intel.com \
    --to=dave@sr71.net \
    --cc=bp@suse.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=fenghua.yu@intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.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