]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 18 May 2020 07:49:23 +0000 (09:49 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 18 May 2020 07:49:23 +0000 (09:49 +0200)
added patches:
gcc-10-avoid-shadowing-standard-library-free-in-crypto.patch
x86-paravirt-remove-the-unused-irq_enable_sysexit-pv-op.patch

queue-4.4/gcc-10-avoid-shadowing-standard-library-free-in-crypto.patch [new file with mode: 0644]
queue-4.4/series
queue-4.4/x86-paravirt-remove-the-unused-irq_enable_sysexit-pv-op.patch [new file with mode: 0644]

diff --git a/queue-4.4/gcc-10-avoid-shadowing-standard-library-free-in-crypto.patch b/queue-4.4/gcc-10-avoid-shadowing-standard-library-free-in-crypto.patch
new file mode 100644 (file)
index 0000000..a555b43
--- /dev/null
@@ -0,0 +1,87 @@
+From 1a263ae60b04de959d9ce9caea4889385eefcc7b Mon Sep 17 00:00:00 2001
+From: Linus Torvalds <torvalds@linux-foundation.org>
+Date: Sat, 9 May 2020 15:58:04 -0700
+Subject: gcc-10: avoid shadowing standard library 'free()' in crypto
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Linus Torvalds <torvalds@linux-foundation.org>
+
+commit 1a263ae60b04de959d9ce9caea4889385eefcc7b upstream.
+
+gcc-10 has started warning about conflicting types for a few new
+built-in functions, particularly 'free()'.
+
+This results in warnings like:
+
+   crypto/xts.c:325:13: warning: conflicting types for built-in function ‘free’; expected ‘void(void *)’ [-Wbuiltin-declaration-mismatch]
+
+because the crypto layer had its local freeing functions called
+'free()'.
+
+Gcc-10 is in the wrong here, since that function is marked 'static', and
+thus there is no chance of confusion with any standard library function
+namespace.
+
+But the simplest thing to do is to just use a different name here, and
+avoid this gcc mis-feature.
+
+[ Side note: gcc knowing about 'free()' is in itself not the
+  mis-feature: the semantics of 'free()' are special enough that a
+  compiler can validly do special things when seeing it.
+
+  So the mis-feature here is that gcc thinks that 'free()' is some
+  restricted name, and you can't shadow it as a local static function.
+
+  Making the special 'free()' semantics be a function attribute rather
+  than tied to the name would be the much better model ]
+
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ crypto/lrw.c |    4 ++--
+ crypto/xts.c |    4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+--- a/crypto/lrw.c
++++ b/crypto/lrw.c
+@@ -377,7 +377,7 @@ out_put_alg:
+       return inst;
+ }
+-static void free(struct crypto_instance *inst)
++static void free_inst(struct crypto_instance *inst)
+ {
+       crypto_drop_spawn(crypto_instance_ctx(inst));
+       kfree(inst);
+@@ -386,7 +386,7 @@ static void free(struct crypto_instance
+ static struct crypto_template crypto_tmpl = {
+       .name = "lrw",
+       .alloc = alloc,
+-      .free = free,
++      .free = free_inst,
+       .module = THIS_MODULE,
+ };
+--- a/crypto/xts.c
++++ b/crypto/xts.c
+@@ -334,7 +334,7 @@ out_put_alg:
+       return inst;
+ }
+-static void free(struct crypto_instance *inst)
++static void free_inst(struct crypto_instance *inst)
+ {
+       crypto_drop_spawn(crypto_instance_ctx(inst));
+       kfree(inst);
+@@ -343,7 +343,7 @@ static void free(struct crypto_instance
+ static struct crypto_template crypto_tmpl = {
+       .name = "xts",
+       .alloc = alloc,
+-      .free = free,
++      .free = free_inst,
+       .module = THIS_MODULE,
+ };
index 1872a7a1f5198b694834352c0e3f592841aa8ad6..36ef862e7b956aa128d0d78661172f316ad39a34 100644 (file)
@@ -64,3 +64,5 @@ block-defer-timeouts-to-a-workqueue.patch
 blk-mq-allow-timeouts-to-run-while-queue-is-freezing.patch
 blk-mq-sync-the-update-nr_hw_queues-with-blk_mq_queue_tag_busy_iter.patch
 blk-mq-allow-blocking-queue-tag-iter-callbacks.patch
+x86-paravirt-remove-the-unused-irq_enable_sysexit-pv-op.patch
+gcc-10-avoid-shadowing-standard-library-free-in-crypto.patch
diff --git a/queue-4.4/x86-paravirt-remove-the-unused-irq_enable_sysexit-pv-op.patch b/queue-4.4/x86-paravirt-remove-the-unused-irq_enable_sysexit-pv-op.patch
new file mode 100644 (file)
index 0000000..6551e96
--- /dev/null
@@ -0,0 +1,223 @@
+From 88c15ec90ff16880efab92b519436ee17b198477 Mon Sep 17 00:00:00 2001
+From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
+Date: Thu, 19 Nov 2015 16:55:46 -0500
+Subject: x86/paravirt: Remove the unused irq_enable_sysexit pv op
+
+From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
+
+commit 88c15ec90ff16880efab92b519436ee17b198477 upstream.
+
+As result of commit "x86/xen: Avoid fast syscall path for Xen PV
+guests", the irq_enable_sysexit pv op is not called by Xen PV guests
+anymore and since they were the only ones who used it we can
+safely remove it.
+
+Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
+Reviewed-by: Borislav Petkov <bp@suse.de>
+Acked-by: Andy Lutomirski <luto@kernel.org>
+Cc: Andrew Morton <akpm@linux-foundation.org>
+Cc: Andy Lutomirski <luto@amacapital.net>
+Cc: Borislav Petkov <bp@alien8.de>
+Cc: Brian Gerst <brgerst@gmail.com>
+Cc: Denys Vlasenko <dvlasenk@redhat.com>
+Cc: H. Peter Anvin <hpa@zytor.com>
+Cc: Linus Torvalds <torvalds@linux-foundation.org>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Cc: david.vrabel@citrix.com
+Cc: konrad.wilk@oracle.com
+Cc: virtualization@lists.linux-foundation.org
+Cc: xen-devel@lists.xenproject.org
+Link: http://lkml.kernel.org/r/1447970147-1733-3-git-send-email-boris.ostrovsky@oracle.com
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/x86/entry/entry_32.S             |    8 ++------
+ arch/x86/include/asm/paravirt.h       |    7 -------
+ arch/x86/include/asm/paravirt_types.h |    9 ---------
+ arch/x86/kernel/asm-offsets.c         |    3 ---
+ arch/x86/kernel/paravirt.c            |    7 -------
+ arch/x86/kernel/paravirt_patch_32.c   |    2 --
+ arch/x86/kernel/paravirt_patch_64.c   |    1 -
+ arch/x86/xen/enlighten.c              |    3 ---
+ arch/x86/xen/xen-asm_32.S             |   14 --------------
+ arch/x86/xen/xen-ops.h                |    3 ---
+ 10 files changed, 2 insertions(+), 55 deletions(-)
+
+--- a/arch/x86/entry/entry_32.S
++++ b/arch/x86/entry/entry_32.S
+@@ -331,7 +331,8 @@ sysenter_past_esp:
+        * Return back to the vDSO, which will pop ecx and edx.
+        * Don't bother with DS and ES (they already contain __USER_DS).
+        */
+-      ENABLE_INTERRUPTS_SYSEXIT
++      sti
++      sysexit
+ .pushsection .fixup, "ax"
+ 2:    movl    $0, PT_FS(%esp)
+@@ -554,11 +555,6 @@ ENTRY(native_iret)
+       iret
+       _ASM_EXTABLE(native_iret, iret_exc)
+ END(native_iret)
+-
+-ENTRY(native_irq_enable_sysexit)
+-      sti
+-      sysexit
+-END(native_irq_enable_sysexit)
+ #endif
+ ENTRY(overflow)
+--- a/arch/x86/include/asm/paravirt.h
++++ b/arch/x86/include/asm/paravirt.h
+@@ -938,13 +938,6 @@ extern void default_banner(void);
+       push %ecx; push %edx;                           \
+       call PARA_INDIRECT(pv_cpu_ops+PV_CPU_read_cr0); \
+       pop %edx; pop %ecx
+-
+-#define ENABLE_INTERRUPTS_SYSEXIT                                     \
+-      PARA_SITE(PARA_PATCH(pv_cpu_ops, PV_CPU_irq_enable_sysexit),    \
+-                CLBR_NONE,                                            \
+-                jmp PARA_INDIRECT(pv_cpu_ops+PV_CPU_irq_enable_sysexit))
+-
+-
+ #else /* !CONFIG_X86_32 */
+ /*
+--- a/arch/x86/include/asm/paravirt_types.h
++++ b/arch/x86/include/asm/paravirt_types.h
+@@ -162,15 +162,6 @@ struct pv_cpu_ops {
+       u64 (*read_pmc)(int counter);
+-#ifdef CONFIG_X86_32
+-      /*
+-       * Atomically enable interrupts and return to userspace.  This
+-       * is only used in 32-bit kernels.  64-bit kernels use
+-       * usergs_sysret32 instead.
+-       */
+-      void (*irq_enable_sysexit)(void);
+-#endif
+-
+       /*
+        * Switch to usermode gs and return to 64-bit usermode using
+        * sysret.  Only used in 64-bit kernels to return to 64-bit
+--- a/arch/x86/kernel/asm-offsets.c
++++ b/arch/x86/kernel/asm-offsets.c
+@@ -65,9 +65,6 @@ void common(void) {
+       OFFSET(PV_IRQ_irq_disable, pv_irq_ops, irq_disable);
+       OFFSET(PV_IRQ_irq_enable, pv_irq_ops, irq_enable);
+       OFFSET(PV_CPU_iret, pv_cpu_ops, iret);
+-#ifdef CONFIG_X86_32
+-      OFFSET(PV_CPU_irq_enable_sysexit, pv_cpu_ops, irq_enable_sysexit);
+-#endif
+       OFFSET(PV_CPU_read_cr0, pv_cpu_ops, read_cr0);
+       OFFSET(PV_MMU_read_cr2, pv_mmu_ops, read_cr2);
+ #endif
+--- a/arch/x86/kernel/paravirt.c
++++ b/arch/x86/kernel/paravirt.c
+@@ -168,9 +168,6 @@ unsigned paravirt_patch_default(u8 type,
+               ret = paravirt_patch_ident_64(insnbuf, len);
+       else if (type == PARAVIRT_PATCH(pv_cpu_ops.iret) ||
+-#ifdef CONFIG_X86_32
+-               type == PARAVIRT_PATCH(pv_cpu_ops.irq_enable_sysexit) ||
+-#endif
+                type == PARAVIRT_PATCH(pv_cpu_ops.usergs_sysret32) ||
+                type == PARAVIRT_PATCH(pv_cpu_ops.usergs_sysret64))
+               /* If operation requires a jmp, then jmp */
+@@ -226,7 +223,6 @@ static u64 native_steal_clock(int cpu)
+ /* These are in entry.S */
+ extern void native_iret(void);
+-extern void native_irq_enable_sysexit(void);
+ extern void native_usergs_sysret32(void);
+ extern void native_usergs_sysret64(void);
+@@ -385,9 +381,6 @@ __visible struct pv_cpu_ops pv_cpu_ops =
+       .load_sp0 = native_load_sp0,
+-#if defined(CONFIG_X86_32)
+-      .irq_enable_sysexit = native_irq_enable_sysexit,
+-#endif
+ #ifdef CONFIG_X86_64
+ #ifdef CONFIG_IA32_EMULATION
+       .usergs_sysret32 = native_usergs_sysret32,
+--- a/arch/x86/kernel/paravirt_patch_32.c
++++ b/arch/x86/kernel/paravirt_patch_32.c
+@@ -5,7 +5,6 @@ DEF_NATIVE(pv_irq_ops, irq_enable, "sti"
+ DEF_NATIVE(pv_irq_ops, restore_fl, "push %eax; popf");
+ DEF_NATIVE(pv_irq_ops, save_fl, "pushf; pop %eax");
+ DEF_NATIVE(pv_cpu_ops, iret, "iret");
+-DEF_NATIVE(pv_cpu_ops, irq_enable_sysexit, "sti; sysexit");
+ DEF_NATIVE(pv_mmu_ops, read_cr2, "mov %cr2, %eax");
+ DEF_NATIVE(pv_mmu_ops, write_cr3, "mov %eax, %cr3");
+ DEF_NATIVE(pv_mmu_ops, read_cr3, "mov %cr3, %eax");
+@@ -46,7 +45,6 @@ unsigned native_patch(u8 type, u16 clobb
+               PATCH_SITE(pv_irq_ops, restore_fl);
+               PATCH_SITE(pv_irq_ops, save_fl);
+               PATCH_SITE(pv_cpu_ops, iret);
+-              PATCH_SITE(pv_cpu_ops, irq_enable_sysexit);
+               PATCH_SITE(pv_mmu_ops, read_cr2);
+               PATCH_SITE(pv_mmu_ops, read_cr3);
+               PATCH_SITE(pv_mmu_ops, write_cr3);
+--- a/arch/x86/kernel/paravirt_patch_64.c
++++ b/arch/x86/kernel/paravirt_patch_64.c
+@@ -12,7 +12,6 @@ DEF_NATIVE(pv_mmu_ops, write_cr3, "movq
+ DEF_NATIVE(pv_cpu_ops, clts, "clts");
+ DEF_NATIVE(pv_cpu_ops, wbinvd, "wbinvd");
+-DEF_NATIVE(pv_cpu_ops, irq_enable_sysexit, "swapgs; sti; sysexit");
+ DEF_NATIVE(pv_cpu_ops, usergs_sysret64, "swapgs; sysretq");
+ DEF_NATIVE(pv_cpu_ops, usergs_sysret32, "swapgs; sysretl");
+ DEF_NATIVE(pv_cpu_ops, swapgs, "swapgs");
+--- a/arch/x86/xen/enlighten.c
++++ b/arch/x86/xen/enlighten.c
+@@ -1240,10 +1240,7 @@ static const struct pv_cpu_ops xen_cpu_o
+       .iret = xen_iret,
+ #ifdef CONFIG_X86_64
+-      .usergs_sysret32 = xen_sysret32,
+       .usergs_sysret64 = xen_sysret64,
+-#else
+-      .irq_enable_sysexit = xen_sysexit,
+ #endif
+       .load_tr_desc = paravirt_nop,
+--- a/arch/x86/xen/xen-asm_32.S
++++ b/arch/x86/xen/xen-asm_32.S
+@@ -35,20 +35,6 @@ check_events:
+       ret
+ /*
+- * We can't use sysexit directly, because we're not running in ring0.
+- * But we can easily fake it up using iret.  Assuming xen_sysexit is
+- * jumped to with a standard stack frame, we can just strip it back to
+- * a standard iret frame and use iret.
+- */
+-ENTRY(xen_sysexit)
+-      movl PT_EAX(%esp), %eax                 /* Shouldn't be necessary? */
+-      orl $X86_EFLAGS_IF, PT_EFLAGS(%esp)
+-      lea PT_EIP(%esp), %esp
+-
+-      jmp xen_iret
+-ENDPROC(xen_sysexit)
+-
+-/*
+  * This is run where a normal iret would be run, with the same stack setup:
+  *    8: eflags
+  *    4: cs
+--- a/arch/x86/xen/xen-ops.h
++++ b/arch/x86/xen/xen-ops.h
+@@ -139,9 +139,6 @@ DECL_ASM(void, xen_restore_fl_direct, un
+ /* These are not functions, and cannot be called normally */
+ __visible void xen_iret(void);
+-#ifdef CONFIG_X86_32
+-__visible void xen_sysexit(void);
+-#endif
+ __visible void xen_sysret32(void);
+ __visible void xen_sysret64(void);
+ __visible void xen_adjust_exception_frame(void);