mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Mathias Krause <minipli@googlemail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Borislav Petkov <bp@alien8.de>,
	"David S. Miller" <davem@davemloft.net>,
	Jesper Nilsson <jesper.nilsson@axis.com>,
	Mikael Starvik <starvik@axis.com>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	x86@kernel.org, linux-kernel@vger.kernel.org,
	"H. Peter Anvin" <hpa@linux.intel.com>
Subject: Re: [PATCH 3/6] x86/cpu: proc - remove "wp" status line in cpuinfo
Date: Tue, 14 Feb 2017 10:13:22 -0800	[thread overview]
Message-ID: <3bd5980f-19fc-9eb4-477c-4786580ceafb@zytor.com> (raw)
In-Reply-To: <1486933932-585-4-git-send-email-minipli@googlemail.com>

On 02/12/17 13:12, Mathias Krause wrote:
> As of commit a5c2a893dbd4 ("x86, 386 removal: Remove
> CONFIG_X86_WP_WORKS_OK") the kernel won't boot if CR0.WP isn't working
> correctly. This makes a process reading this file always see "wp : yes"
> here -- otherwise there would be no process to begin with ;)
> 
> As this status line in /proc/cpuinfo serves no purpose for quite some
> time now, get rid of it.
> 
> Cc: Borislav Petkov <bp@alien8.de>
> Cc: H. Peter Anvin <hpa@linux.intel.com>
> Signed-off-by: Mathias Krause <minipli@googlemail.com>
> ---
>  arch/x86/kernel/cpu/proc.c |    6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/x86/kernel/cpu/proc.c b/arch/x86/kernel/cpu/proc.c
> index 6df621ae62a7..c6c5217a7980 100644
> --- a/arch/x86/kernel/cpu/proc.c
> +++ b/arch/x86/kernel/cpu/proc.c
> @@ -30,8 +30,7 @@ static void show_cpuinfo_misc(struct seq_file *m, struct cpuinfo_x86 *c)
>  		   "coma_bug\t: %s\n"
>  		   "fpu\t\t: %s\n"
>  		   "fpu_exception\t: %s\n"
> -		   "cpuid level\t: %d\n"
> -		   "wp\t\t: yes\n",
> +		   "cpuid level\t: %d\n",
>  		   static_cpu_has_bug(X86_BUG_FDIV) ? "yes" : "no",
>  		   static_cpu_has_bug(X86_BUG_F00F) ? "yes" : "no",
>  		   static_cpu_has_bug(X86_BUG_COMA) ? "yes" : "no",
> @@ -45,8 +44,7 @@ static void show_cpuinfo_misc(struct seq_file *m, struct cpuinfo_x86 *c)
>  	seq_printf(m,
>  		   "fpu\t\t: yes\n"
>  		   "fpu_exception\t: yes\n"
> -		   "cpuid level\t: %d\n"
> -		   "wp\t\t: yes\n",
> +		   "cpuid level\t: %d\n",
>  		   c->cpuid_level);
>  }
>  #endif
> 

Potential userspace breakage, which is why the line was left in the
first place despite its value now being hard-coded.  Removing it will
save a whopping 9 bytes of kernel rodata; this is a very small price to
pay for guaranteeing continued compatibility.

Nacked-by: H. Peter Anvin <hpa@zytor.com>

  parent reply	other threads:[~2017-02-14 18:14 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-12 21:12 [PATCH 0/6] struct cpuinfo_x86 related cleanups Mathias Krause
2017-02-12 21:12 ` [PATCH 1/6] x86: drop unneded members of struct cpuinfo_x86 Mathias Krause
2017-02-14 16:17   ` Borislav Petkov
2017-02-14 16:40     ` Mathias Krause
2017-02-14 17:56     ` Geert Uytterhoeven
2017-02-14 18:21       ` Borislav Petkov
2017-02-14 18:46       ` H. Peter Anvin
2017-03-11 13:34   ` [tip:x86/cpu] x86/cpu: Drop " tip-bot for Mathias Krause
2017-02-12 21:12 ` [PATCH 2/6] x86/cpu: drop wp_works_ok member " Mathias Krause
2017-03-11 13:34   ` [tip:x86/cpu] x86/cpu: Drop " tip-bot for Mathias Krause
2017-02-12 21:12 ` [PATCH 3/6] x86/cpu: proc - remove "wp" status line in cpuinfo Mathias Krause
2017-02-14 16:20   ` Borislav Petkov
2017-02-14 16:47     ` Mathias Krause
2017-02-14 17:11       ` Borislav Petkov
2017-02-14 18:13   ` H. Peter Anvin [this message]
2017-02-14 18:30     ` Borislav Petkov
2017-02-14 21:42     ` Mathias Krause
2017-02-28  7:15       ` Mathias Krause
2017-02-12 21:12 ` [PATCH 4/6] sparc: remove unused wp_works_ok macro Mathias Krause
2017-02-13  2:48   ` David Miller
2017-02-12 21:12 ` [PATCH 5/6] cris: " Mathias Krause
2017-02-13  9:18   ` Jesper Nilsson
2017-02-12 21:12 ` [PATCH 6/6] m68k: paging_init - remove dead code Mathias Krause
2017-02-13  9:05   ` Geert Uytterhoeven

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=3bd5980f-19fc-9eb4-477c-4786580ceafb@zytor.com \
    --to=hpa@zytor.com \
    --cc=akpm@linux-foundation.org \
    --cc=bp@alien8.de \
    --cc=davem@davemloft.net \
    --cc=geert@linux-m68k.org \
    --cc=hpa@linux.intel.com \
    --cc=jesper.nilsson@axis.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=minipli@googlemail.com \
    --cc=starvik@axis.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

Powered by JetHome