Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKernel Build Daemon <kbuild@suse.de>2018-07-11 07:00:26 +0200
committerKernel Build Daemon <kbuild@suse.de>2018-07-11 07:00:26 +0200
commit08f5fed59df17e31e836ed5eeba7b660afa47922 (patch)
treefa899a0746c20c3134a75e63432d4be840dd6d4b
parente5e0e54d6e6987ca347cdb45a556bcd52cd346a0 (diff)
parent19dda0e4a99487f7360980746a39ffd01fb0b297 (diff)
Merge branch 'SLE12-SP3' into SLE12-SP3-AZURE
-rw-r--r--patches.arch/powerpc-64s-Exception-macro-for-stack-frame-and-init.patch96
-rw-r--r--patches.arch/powerpc-64s-Fix-mce-accounting-for-powernv.patch38
-rw-r--r--patches.arch/powerpc-Machine-check-interrupt-is-a-non-maskable-in.patch53
-rw-r--r--patches.fixes/rmdir-rename-do-shrink_dcache_parent-only-on-success.patch103
-rw-r--r--series.conf6
5 files changed, 296 insertions, 0 deletions
diff --git a/patches.arch/powerpc-64s-Exception-macro-for-stack-frame-and-init.patch b/patches.arch/powerpc-64s-Exception-macro-for-stack-frame-and-init.patch
new file mode 100644
index 0000000000..9b8e7a1588
--- /dev/null
+++ b/patches.arch/powerpc-64s-Exception-macro-for-stack-frame-and-init.patch
@@ -0,0 +1,96 @@
+From 0f6383e822f6242cca10a115f89249cc2df18a77 Mon Sep 17 00:00:00 2001
+From: Nicholas Piggin <npiggin@gmail.com>
+Date: Tue, 20 Dec 2016 04:30:03 +1000
+Subject: [PATCH] powerpc/64s: Exception macro for stack frame and initial
+ register save
+
+References: bsc#1094244
+Patch-mainline: v4.12-rc1
+Git-commit: a4087a4d38981bef3de7dd814493df202919cd2e
+
+This code is common to a few exceptions, and another user will be added.
+This causes a trivial change to generated code:
+
+- 604: std r9,416(r1)
+- 608: mfspr r11,314
+- 60c: std r11,368(r1)
+- 610: mfspr r12,315
++ 604: mfspr r11,314
++ 608: mfspr r12,315
++ 60c: std r9,416(r1)
++ 610: std r11,368(r1)
+
+machine_check_powernv_early could also use this, but that requires non
+trivial changes to generated code, so that's for another patch.
+
+Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Acked-by: Michal Suchanek <msuchanek@suse.de>
+---
+ arch/powerpc/include/asm/exception-64s.h | 16 ++++++++++------
+ arch/powerpc/kernel/exceptions-64s.S | 13 ++++---------
+ 2 files changed, 14 insertions(+), 15 deletions(-)
+
+diff --git a/arch/powerpc/include/asm/exception-64s.h b/arch/powerpc/include/asm/exception-64s.h
+index 9969643a3a0d..5bbc43c0200d 100644
+--- a/arch/powerpc/include/asm/exception-64s.h
++++ b/arch/powerpc/include/asm/exception-64s.h
+@@ -358,6 +358,15 @@ do_kvm_##n: \
+
+ #define NOTEST(n)
+
++#define EXCEPTION_PROLOG_COMMON_1() \
++ std r9,_CCR(r1); /* save CR in stackframe */ \
++ std r11,_NIP(r1); /* save SRR0 in stackframe */ \
++ std r12,_MSR(r1); /* save SRR1 in stackframe */ \
++ std r10,0(r1); /* make stack chain pointer */ \
++ std r0,GPR0(r1); /* save r0 in stackframe */ \
++ std r10,GPR1(r1); /* save r1 in stackframe */ \
++
++
+ /*
+ * The common exception prolog is used for all except a few exceptions
+ * such as a segment miss on a kernel address. We have to be prepared
+@@ -382,12 +391,7 @@ do_kvm_##n: \
+ addi r3,r13,area; /* r3 -> where regs are saved*/ \
+ RESTORE_CTR(r1, area); \
+ b bad_stack; \
+-3: std r9,_CCR(r1); /* save CR in stackframe */ \
+- std r11,_NIP(r1); /* save SRR0 in stackframe */ \
+- std r12,_MSR(r1); /* save SRR1 in stackframe */ \
+- std r10,0(r1); /* make stack chain pointer */ \
+- std r0,GPR0(r1); /* save r0 in stackframe */ \
+- std r10,GPR1(r1); /* save r1 in stackframe */ \
++3: EXCEPTION_PROLOG_COMMON_1(); \
+ beq 4f; /* if from kernel mode */ \
+ ACCOUNT_CPU_USER_ENTRY(r9, r10); \
+ SAVE_PPR(area, r9, r10); \
+diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
+index 7d3d6eb4975b..d36e9f798de2 100644
+--- a/arch/powerpc/kernel/exceptions-64s.S
++++ b/arch/powerpc/kernel/exceptions-64s.S
+@@ -1283,17 +1283,12 @@ fwnmi_data_area:
+ .globl hmi_exception_early
+ hmi_exception_early:
+ EXCEPTION_PROLOG_1(PACA_EXGEN, NOTEST, 0xe60)
+- mr r10,r1 /* Save r1 */
+- ld r1,PACAEMERGSP(r13) /* Use emergency stack */
++ mr r10,r1 /* Save r1 */
++ ld r1,PACAEMERGSP(r13) /* Use emergency stack for realmode */
+ subi r1,r1,INT_FRAME_SIZE /* alloc stack frame */
+- std r9,_CCR(r1) /* save CR in stackframe */
+ mfspr r11,SPRN_HSRR0 /* Save HSRR0 */
+- std r11,_NIP(r1) /* save HSRR0 in stackframe */
+- mfspr r12,SPRN_HSRR1 /* Save SRR1 */
+- std r12,_MSR(r1) /* save SRR1 in stackframe */
+- std r10,0(r1) /* make stack chain pointer */
+- std r0,GPR0(r1) /* save r0 in stackframe */
+- std r10,GPR1(r1) /* save r1 in stackframe */
++ mfspr r12,SPRN_HSRR1 /* Save HSRR1 */
++ EXCEPTION_PROLOG_COMMON_1()
+ EXCEPTION_PROLOG_COMMON_2(PACA_EXGEN)
+ EXCEPTION_PROLOG_COMMON_3(0xe60)
+ addi r3,r1,STACK_FRAME_OVERHEAD
+--
+2.13.7
+
diff --git a/patches.arch/powerpc-64s-Fix-mce-accounting-for-powernv.patch b/patches.arch/powerpc-64s-Fix-mce-accounting-for-powernv.patch
new file mode 100644
index 0000000000..c3116e5e94
--- /dev/null
+++ b/patches.arch/powerpc-64s-Fix-mce-accounting-for-powernv.patch
@@ -0,0 +1,38 @@
+From f886f0f6e0e20d53dc36421c2ee83fb9277554af Mon Sep 17 00:00:00 2001
+From: Nicholas Piggin <npiggin@gmail.com>
+Date: Tue, 1 Aug 2017 22:00:51 +1000
+Subject: [PATCH] powerpc/64s: Fix mce accounting for powernv
+
+References: bsc#1094244
+Patch-mainline: v4.14-rc1
+Git-commit: f886f0f6e0e20d53dc36421c2ee83fb9277554af
+
+On 64-bit Book3s, when we're in HV mode, we have already counted the
+machine check exception in machine_check_early().
+
+Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
+[mpe: Use IS_ENABLED() rather than an #ifdef]
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Acked-by: Michal Suchanek <msuchanek@suse.de>
+---
+ arch/powerpc/kernel/traps.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
+index bfcfd9ef09f2..d42c567e3c29 100644
+--- a/arch/powerpc/kernel/traps.c
++++ b/arch/powerpc/kernel/traps.c
+@@ -755,7 +755,9 @@ void machine_check_exception(struct pt_regs *regs)
+ enum ctx_state prev_state = exception_enter();
+ int recover = 0;
+
+- __this_cpu_inc(irq_stat.mce_exceptions);
++ /* 64s accounts the mce in machine_check_early when in HVMODE */
++ if (!IS_ENABLED(CONFIG_PPC_BOOK3S_64) || !cpu_has_feature(CPU_FTR_HVMODE))
++ __this_cpu_inc(irq_stat.mce_exceptions);
+
+ add_taint(TAINT_MACHINE_CHECK, LOCKDEP_NOW_UNRELIABLE);
+
+--
+2.13.7
+
diff --git a/patches.arch/powerpc-Machine-check-interrupt-is-a-non-maskable-in.patch b/patches.arch/powerpc-Machine-check-interrupt-is-a-non-maskable-in.patch
new file mode 100644
index 0000000000..a1a085e9b9
--- /dev/null
+++ b/patches.arch/powerpc-Machine-check-interrupt-is-a-non-maskable-in.patch
@@ -0,0 +1,53 @@
+From b96672dd840f2231c3e0804842d380c401739733 Mon Sep 17 00:00:00 2001
+From: Nicholas Piggin <npiggin@gmail.com>
+Date: Wed, 19 Jul 2017 16:59:12 +1000
+Subject: [PATCH] powerpc: Machine check interrupt is a non-maskable interrupt
+
+References: bsc#1094244
+Patch-mainline: v4.14-rc1
+Git-commit: b96672dd840f2231c3e0804842d380c401739733
+
+Use nmi_enter similarly to system reset interrupts. This uses NMI
+printk NMI buffers and turns off various debugging facilities that
+helps avoid tripping on ourselves or other CPUs.
+
+Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Acked-by: Michal Suchanek <msuchanek@suse.de>
+---
+ arch/powerpc/kernel/traps.c | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
+index 6858d910b47e..ec74e203ee04 100644
+--- a/arch/powerpc/kernel/traps.c
++++ b/arch/powerpc/kernel/traps.c
+@@ -644,8 +644,10 @@ int machine_check_generic(struct pt_regs *regs)
+
+ void machine_check_exception(struct pt_regs *regs)
+ {
+- enum ctx_state prev_state = exception_enter();
+ int recover = 0;
++ bool nested = in_nmi();
++ if (!nested)
++ nmi_enter();
+
+ /* 64s accounts the mce in machine_check_early when in HVMODE */
+ if (!IS_ENABLED(CONFIG_PPC_BOOK3S_64) || !cpu_has_feature(CPU_FTR_HVMODE))
+@@ -677,10 +679,11 @@ void machine_check_exception(struct pt_regs *regs)
+
+ /* Must die if the interrupt is not recoverable */
+ if (!(regs->msr & MSR_RI))
+- panic("Unrecoverable Machine check");
++ nmi_panic(regs, "Unrecoverable Machine check");
+
+ bail:
+- exception_exit(prev_state);
++ if (!nested)
++ nmi_exit();
+ }
+
+ void SMIException(struct pt_regs *regs)
+--
+2.13.7
+
diff --git a/patches.fixes/rmdir-rename-do-shrink_dcache_parent-only-on-success.patch b/patches.fixes/rmdir-rename-do-shrink_dcache_parent-only-on-success.patch
new file mode 100644
index 0000000000..c91e16dd6b
--- /dev/null
+++ b/patches.fixes/rmdir-rename-do-shrink_dcache_parent-only-on-success.patch
@@ -0,0 +1,103 @@
+From 8767712f26d18ac4541e2d0d7be17c40a5911ce4 Mon Sep 17 00:00:00 2001
+From: Al Viro <viro@zeniv.linux.org.uk>
+Date: Sun, 27 May 2018 16:23:51 -0400
+Subject: [PATCH] rmdir(),rename(): do shrink_dcache_parent() only on success
+References: bsc#1100340
+Git-commit: 8767712f26d18ac4541e2d0d7be17c40a5911ce4
+Patch-mainline: v4.18-rc1
+
+Once upon a time ->rmdir() instances used to check if victim inode
+had more than one (in-core) reference and failed with -EBUSY if it
+had. The reason was race avoidance - emptiness check is worthless
+if somebody could just go and create new objects in the victim
+directory afterwards.
+
+With introduction of dcache the checks had been replaced with
+checking the refcount of dentry. However, since a cached negative
+lookup leaves a negative child dentry, such check had lead to false
+positives - with empty foo/ doing stat foo/bar before rmdir foo
+ended up with -EBUSY unless the negative dentry of foo/bar happened
+to be evicted by the time of rmdir(2). That had been fixed by
+doing shrink_dcache_parent() just before the refcount check.
+
+At the same time, ext2_rmdir() has grown a private solution that
+eliminated those -EBUSY - it did something (setting ->i_size to 0)
+which made any subsequent ext2_add_entry() fail.
+
+Unfortunately, even with shrink_dcache_parent() the check had been
+racy - after all, the victim itself could be found by dcache lookup
+just after we'd checked its refcount. That got fixed by a new
+helper (dentry_unhash()) that did shrink_dcache_parent() and unhashed
+the sucker if its refcount ended up equal to 1. That got called before
+->rmdir(), turning the checks in ->rmdir() instances into "if not
+unhashed fail with -EBUSY". Which reduced the boilerplate nicely, but
+had an unpleasant side effect - now shrink_dcache_parent() had been
+done before the emptiness checks, leading to easily triggerable calls
+of shrink_dcache_parent() on arbitrary large subtrees, quite possibly
+nested into each other.
+
+Several years later the ext2-private trick had been generalized -
+(in-core) inodes of dead directories are flagged and calls of
+lookup, readdir and all directory-modifying methods were prevented
+in so marked directories. Remaining boilerplate in ->rmdir() instances
+became redundant and some instances got rid of it.
+
+In 2011 the call of dentry_unhash() got shifted into ->rmdir() instances
+and then killed off in all of them. That has lead to another problem,
+though - in case of successful rmdir we *want* any (negative) child
+dentries dropped and the victim itself made negative. There's no point
+keeping cached negative lookups in foo when we can get the negative
+lookup of foo itself cached. So shrink_dcache_parent() call had been
+restored; unfortunately, it went into the place where dentry_unhash()
+used to be, i.e. before the ->rmdir() call. Note that we don't unhash
+anymore, so any "is it busy" checks would be racy; fortunately, all of
+them are gone.
+
+We should've done that call right *after* successful ->rmdir(). That
+reduces contention caused by tree-walking in shrink_dcache_parent()
+and, especially, contention caused by evictions in two nested subtrees
+going on in parallel. The same goes for directory-overwriting rename() -
+the story there had been parallel to that of rmdir().
+
+Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
+Acked-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
+
+diff --git a/fs/namei.c b/fs/namei.c
+index 186bd2464fd5..269b64a1121a 100644
+
+--- a/fs/namei.c
++++ b/fs/namei.c
+@@ -3847,11 +3847,11 @@ int vfs_rmdir(struct inode *dir, struct dentry *dentry)
+ if (error)
+ goto out;
+
+- shrink_dcache_parent(dentry);
+ error = dir->i_op->rmdir(dir, dentry);
+ if (error)
+ goto out;
+
++ shrink_dcache_parent(dentry);
+ dentry->d_inode->i_flags |= S_DEAD;
+ dont_mount(dentry);
+ detach_mounts(dentry);
+@@ -4434,8 +4434,6 @@ int vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
+ old_dir->i_nlink >= max_links)
+ goto out;
+ }
+- if (is_dir && !(flags & RENAME_EXCHANGE) && target)
+- shrink_dcache_parent(new_dentry);
+ if (!is_dir) {
+ error = try_break_deleg(source, delegated_inode);
+ if (error)
+@@ -4452,8 +4450,10 @@ int vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
+ goto out;
+
+ if (!(flags & RENAME_EXCHANGE) && target) {
+- if (is_dir)
++ if (is_dir) {
++ shrink_dcache_parent(new_dentry);
+ target->i_flags |= S_DEAD;
++ }
+ dont_mount(new_dentry);
+ detach_mounts(new_dentry);
+ }
diff --git a/series.conf b/series.conf
index 90bc5b0284..bbfb1d8984 100644
--- a/series.conf
+++ b/series.conf
@@ -4611,6 +4611,11 @@
patches.arch/powerpc-conditionally-compile-platform-specific-seri.patch
patches.arch/powerpc-signals-Discard-transaction-state-from-signa.patch
+ # bsc#1094244
+ patches.arch/powerpc-64s-Exception-macro-for-stack-frame-and-init.patch
+ patches.arch/powerpc-64s-Fix-mce-accounting-for-powernv.patch
+ patches.arch/powerpc-Machine-check-interrupt-is-a-non-maskable-in.patch
+
########################################################
# powerpc/little endian
########################################################
@@ -6558,6 +6563,7 @@
patches.fixes/mm-page_alloc-do-not-break-_gfp_thisnode-by-zonelist-reset.patch
patches.fixes/Hang-soft-lockup-in-d_invalidate-with-simultaneous-c.patch
patches.fixes/procfs-add-tunable-for-fd-fdinfo-dentry-retention.patch
+ patches.fixes/rmdir-rename-do-shrink_dcache_parent-only-on-success.patch
########################################################
# IPC patches