All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/pti: Add pti= cmdline option and documentation
@ 2017-12-12 13:39 Borislav Petkov
  2017-12-12 13:46 ` Juergen Gross
  2017-12-12 14:28 ` Will Deacon
  0 siblings, 2 replies; 5+ messages in thread
From: Borislav Petkov @ 2017-12-12 13:39 UTC (permalink / raw)
  To: X86 ML
  Cc: LKML, Linus Torvalds, Andy Lutomirsky, Peter Zijlstra,
	Dave Hansen, Greg KH, keescook, hughd, Brian Gerst,
	Josh Poimboeuf, Denys Vlasenko, Boris Ostrovsky, Juergen Gross,
	David Laight, Eduardo Valentin, aliguori, Will Deacon,
	daniel.gruss

From: Borislav Petkov <bp@suse.de>

Keep the "nopti" for traditional reasons.

Requested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andy Lutomirsky <luto@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Greg KH <gregkh@linuxfoundation.org>
Cc: keescook@google.com
Cc: hughd@google.com
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: David Laight <David.Laight@aculab.com>
Cc: Eduardo Valentin <eduval@amazon.com>
Cc: aliguori@amazon.com
Cc: Will Deacon <will.deacon@arm.com>
Cc: daniel.gruss@iaik.tugraz.at
---
 Documentation/admin-guide/kernel-parameters.txt |  6 ++++++
 arch/x86/mm/pti.c                               | 18 ++++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 5dfd26265484..520fdec15bbb 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -3255,6 +3255,12 @@
 	pt.		[PARIDE]
 			See Documentation/blockdev/paride.txt.
 
+	pti=		[X86_64]
+			Control user/kernel address space isolation:
+			on - enable
+			off - disable
+			auto - default setting
+
 	pty.legacy_count=
 			[KNL] Number of legacy pty's. Overwrites compiled-in
 			default number.
diff --git a/arch/x86/mm/pti.c b/arch/x86/mm/pti.c
index f48645d2f3fd..4afa16b444b2 100644
--- a/arch/x86/mm/pti.c
+++ b/arch/x86/mm/pti.c
@@ -51,15 +51,33 @@
 void __init pti_check_boottime_disable(void)
 {
 	bool enable = true;
+	char arg[5];
+
+	if (cmdline_find_option(boot_command_line, "pti", arg, sizeof(arg))) {
+		if (!strncmp(arg, "on", 2))
+			goto enable;
+
+		if (!strncmp(arg, "off", 3)) {
+			pr_info("disabled on command line.\n");
+			return;
+		}
+
+		if (!strncmp(arg, "auto", 4))
+			goto skip;
+	}
 
 	if (cmdline_find_option_bool(boot_command_line, "nopti")) {
 		pr_info("disabled on command line.\n");
 		enable = false;
 	}
+
+skip:
 	if (hypervisor_is_type(X86_HYPER_XEN_PV)) {
 		pr_info("disabled on XEN_PV.\n");
 		enable = false;
 	}
+
+enable:
 	if (enable)
 		setup_force_cpu_bug(X86_BUG_CPU_SECURE_MODE_PTI);
 }
-- 
2.13.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86/pti: Add pti= cmdline option and documentation
  2017-12-12 13:39 [PATCH] x86/pti: Add pti= cmdline option and documentation Borislav Petkov
@ 2017-12-12 13:46 ` Juergen Gross
  2017-12-12 14:28 ` Will Deacon
  1 sibling, 0 replies; 5+ messages in thread
From: Juergen Gross @ 2017-12-12 13:46 UTC (permalink / raw)
  To: Borislav Petkov, X86 ML
  Cc: LKML, Linus Torvalds, Andy Lutomirsky, Peter Zijlstra,
	Dave Hansen, Greg KH, keescook, hughd, Brian Gerst,
	Josh Poimboeuf, Denys Vlasenko, Boris Ostrovsky, David Laight,
	Eduardo Valentin, aliguori, Will Deacon, daniel.gruss

On 12/12/17 14:39, Borislav Petkov wrote:
> From: Borislav Petkov <bp@suse.de>
> 
> Keep the "nopti" for traditional reasons.
> 
> Requested-by: Linus Torvalds <torvalds@linux-foundation.org>
> Signed-off-by: Borislav Petkov <bp@suse.de>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86/pti: Add pti= cmdline option and documentation
  2017-12-12 13:39 [PATCH] x86/pti: Add pti= cmdline option and documentation Borislav Petkov
  2017-12-12 13:46 ` Juergen Gross
@ 2017-12-12 14:28 ` Will Deacon
  2017-12-14 15:18   ` Will Deacon
  1 sibling, 1 reply; 5+ messages in thread
From: Will Deacon @ 2017-12-12 14:28 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: X86 ML, LKML, Linus Torvalds, Andy Lutomirsky, Peter Zijlstra,
	Dave Hansen, Greg KH, keescook, hughd, Brian Gerst,
	Josh Poimboeuf, Denys Vlasenko, Boris Ostrovsky, Juergen Gross,
	David Laight, Eduardo Valentin, aliguori, daniel.gruss, tglx

Hi Borislav, [+ tglx]

On Tue, Dec 12, 2017 at 02:39:52PM +0100, Borislav Petkov wrote:
> From: Borislav Petkov <bp@suse.de>
> 
> Keep the "nopti" for traditional reasons.
> 
> Requested-by: Linus Torvalds <torvalds@linux-foundation.org>
> Signed-off-by: Borislav Petkov <bp@suse.de>
> Cc: Linus Torvalds <torvalds@linux-foundation.org>
> Cc: Andy Lutomirsky <luto@kernel.org>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Dave Hansen <dave.hansen@intel.com>
> Cc: Greg KH <gregkh@linuxfoundation.org>
> Cc: keescook@google.com
> Cc: hughd@google.com
> Cc: Brian Gerst <brgerst@gmail.com>
> Cc: Josh Poimboeuf <jpoimboe@redhat.com>
> Cc: Denys Vlasenko <dvlasenk@redhat.com>
> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> Cc: Juergen Gross <jgross@suse.com>
> Cc: David Laight <David.Laight@aculab.com>
> Cc: Eduardo Valentin <eduval@amazon.com>
> Cc: aliguori@amazon.com
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: daniel.gruss@iaik.tugraz.at
> ---
>  Documentation/admin-guide/kernel-parameters.txt |  6 ++++++
>  arch/x86/mm/pti.c                               | 18 ++++++++++++++++++
>  2 files changed, 24 insertions(+)

On arm64, I've gone for kpti=. I'm happy to change this to align with x86,
but the patches are queued now so I don't want to keep changing it.

Is "pti=" definitely what you're going for on x86?

Will

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86/pti: Add pti= cmdline option and documentation
  2017-12-12 14:28 ` Will Deacon
@ 2017-12-14 15:18   ` Will Deacon
  2017-12-18 12:33     ` Ingo Molnar
  0 siblings, 1 reply; 5+ messages in thread
From: Will Deacon @ 2017-12-14 15:18 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: X86 ML, LKML, Linus Torvalds, Andy Lutomirsky, Peter Zijlstra,
	Dave Hansen, Greg KH, keescook, hughd, Brian Gerst,
	Josh Poimboeuf, Denys Vlasenko, Boris Ostrovsky, Juergen Gross,
	David Laight, Eduardo Valentin, aliguori, daniel.gruss, tglx

On Tue, Dec 12, 2017 at 02:28:56PM +0000, Will Deacon wrote:
> On Tue, Dec 12, 2017 at 02:39:52PM +0100, Borislav Petkov wrote:
> > From: Borislav Petkov <bp@suse.de>
> > 
> > Keep the "nopti" for traditional reasons.
> > 
> > Requested-by: Linus Torvalds <torvalds@linux-foundation.org>
> > Signed-off-by: Borislav Petkov <bp@suse.de>
> > Cc: Linus Torvalds <torvalds@linux-foundation.org>
> > Cc: Andy Lutomirsky <luto@kernel.org>
> > Cc: Peter Zijlstra <peterz@infradead.org>
> > Cc: Dave Hansen <dave.hansen@intel.com>
> > Cc: Greg KH <gregkh@linuxfoundation.org>
> > Cc: keescook@google.com
> > Cc: hughd@google.com
> > Cc: Brian Gerst <brgerst@gmail.com>
> > Cc: Josh Poimboeuf <jpoimboe@redhat.com>
> > Cc: Denys Vlasenko <dvlasenk@redhat.com>
> > Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> > Cc: Juergen Gross <jgross@suse.com>
> > Cc: David Laight <David.Laight@aculab.com>
> > Cc: Eduardo Valentin <eduval@amazon.com>
> > Cc: aliguori@amazon.com
> > Cc: Will Deacon <will.deacon@arm.com>
> > Cc: daniel.gruss@iaik.tugraz.at
> > ---
> >  Documentation/admin-guide/kernel-parameters.txt |  6 ++++++
> >  arch/x86/mm/pti.c                               | 18 ++++++++++++++++++
> >  2 files changed, 24 insertions(+)
> 
> On arm64, I've gone for kpti=. I'm happy to change this to align with x86,
> but the patches are queued now so I don't want to keep changing it.
> 
> Is "pti=" definitely what you're going for on x86?

It was pointed out to me yesterday that "kpti" can be pronounced "cuppatea",
whereas "pti" doesn't roll off the tongue nearly so easily this side of the
pond.

But I would still like to avoid divergence on the name.

Will

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86/pti: Add pti= cmdline option and documentation
  2017-12-14 15:18   ` Will Deacon
@ 2017-12-18 12:33     ` Ingo Molnar
  0 siblings, 0 replies; 5+ messages in thread
From: Ingo Molnar @ 2017-12-18 12:33 UTC (permalink / raw)
  To: Will Deacon
  Cc: Borislav Petkov, X86 ML, LKML, Linus Torvalds, Andy Lutomirsky,
	Peter Zijlstra, Dave Hansen, Greg KH, keescook, hughd,
	Brian Gerst, Josh Poimboeuf, Denys Vlasenko, Boris Ostrovsky,
	Juergen Gross, David Laight, Eduardo Valentin, aliguori,
	daniel.gruss, tglx


* Will Deacon <will.deacon@arm.com> wrote:

> But I would still like to avoid divergence on the name.

Please rename it to 'PTI' to sync the naming with x86.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-12-18 12:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-12 13:39 [PATCH] x86/pti: Add pti= cmdline option and documentation Borislav Petkov
2017-12-12 13:46 ` Juergen Gross
2017-12-12 14:28 ` Will Deacon
2017-12-14 15:18   ` Will Deacon
2017-12-18 12:33     ` Ingo Molnar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.