x86/paravirt: Remove 'noreplace-paravirt' cmdline option
authorJosh Poimboeuf <[email protected]>
Wed, 31 Jan 2018 04:13:33 +0000 (22:13 -0600)
committerThomas Gleixner <[email protected]>
Wed, 31 Jan 2018 09:37:45 +0000 (10:37 +0100)
The 'noreplace-paravirt' option disables paravirt patching, leaving the
original pv indirect calls in place.

That's highly incompatible with retpolines, unless we want to uglify
paravirt even further and convert the paravirt calls to retpolines.

As far as I can tell, the option doesn't seem to be useful for much
other than introducing surprising corner cases and making the kernel
vulnerable to Spectre v2.  It was probably a debug option from the early
paravirt days.  So just remove it.

Signed-off-by: Josh Poimboeuf <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Reviewed-by: Juergen Gross <[email protected]>
Cc: Andrea Arcangeli <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Andi Kleen <[email protected]>
Cc: Ashok Raj <[email protected]>
Cc: Greg KH <[email protected]>
Cc: Jun Nakajima <[email protected]>
Cc: Tim Chen <[email protected]>
Cc: Rusty Russell <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: Asit Mallick <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Jason Baron <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: Alok Kataria <[email protected]>
Cc: Arjan Van De Ven <[email protected]>
Cc: David Woodhouse <[email protected]>
Cc: Dan Williams <[email protected]>
Link: https://lkml.kernel.org/r/20180131041333.2x6blhxirc2kclrq@treble
Documentation/admin-guide/kernel-parameters.txt
arch/x86/kernel/alternative.c

index 46b26bfee27ba81267703a1ceac7c0e082f1e5ec..1e762c210f1b4afa6a4789f9b9842c30d58775fe 100644 (file)
        norandmaps      Don't use address space randomization.  Equivalent to
                        echo 0 > /proc/sys/kernel/randomize_va_space
 
-       noreplace-paravirt      [X86,IA-64,PV_OPS] Don't patch paravirt_ops
-
        noreplace-smp   [X86-32,SMP] Don't replace SMP instructions
                        with UP alternatives
 
index 30571fdaaf6ff9d54efb5e3b3c07f41a7e473a55..a481763a37763ada0586d2486f3a062066a3712d 100644 (file)
@@ -46,17 +46,6 @@ static int __init setup_noreplace_smp(char *str)
 }
 __setup("noreplace-smp", setup_noreplace_smp);
 
-#ifdef CONFIG_PARAVIRT
-static int __initdata_or_module noreplace_paravirt = 0;
-
-static int __init setup_noreplace_paravirt(char *str)
-{
-       noreplace_paravirt = 1;
-       return 1;
-}
-__setup("noreplace-paravirt", setup_noreplace_paravirt);
-#endif
-
 #define DPRINTK(fmt, args...)                                          \
 do {                                                                   \
        if (debug_alternative)                                          \
@@ -599,9 +588,6 @@ void __init_or_module apply_paravirt(struct paravirt_patch_site *start,
        struct paravirt_patch_site *p;
        char insnbuf[MAX_PATCH_LEN];
 
-       if (noreplace_paravirt)
-               return;
-
        for (p = start; p < end; p++) {
                unsigned int used;