diff options
author | Ben Hutchings <ben@decadent.org.uk> | 2018-09-29 18:29:49 +0100 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2018-09-29 18:29:49 +0100 |
commit | 0599e25a503c18130bd2a8152003102cd4bdb192 (patch) | |
tree | 42eb36518a8e6d9f627e512b08758f12a5a0226e /queue-3.16 | |
parent | 6e7a94e2c6827d7fe3d6be5fee521b65d20f296a (diff) | |
download | linux-stable-queue-0599e25a503c18130bd2a8152003102cd4bdb192.tar.gz |
Add some build and warning fixes
Diffstat (limited to 'queue-3.16')
4 files changed, 165 insertions, 0 deletions
diff --git a/queue-3.16/mm-vmstat-make-nr_tlb_remote_flush_received-available-even-on-up.patch b/queue-3.16/mm-vmstat-make-nr_tlb_remote_flush_received-available-even-on-up.patch new file mode 100644 index 00000000..6dfed246 --- /dev/null +++ b/queue-3.16/mm-vmstat-make-nr_tlb_remote_flush_received-available-even-on-up.patch @@ -0,0 +1,35 @@ +From: Andy Lutomirski <luto@kernel.org> +Date: Mon, 5 Jun 2017 07:40:25 -0700 +Subject: mm/vmstat: Make NR_TLB_REMOTE_FLUSH_RECEIVED available even on UP + +commit 5dd0b16cdaff9b94da06074d5888b03235c0bf17 upstream. + +This fixes CONFIG_SMP=n, CONFIG_DEBUG_TLBFLUSH=y without introducing +further #ifdef soup. Caught by a Kbuild bot randconfig build. + +Signed-off-by: Andy Lutomirski <luto@kernel.org> +Cc: Borislav Petkov <bp@alien8.de> +Cc: Linus Torvalds <torvalds@linux-foundation.org> +Cc: Peter Zijlstra <peterz@infradead.org> +Cc: Thomas Gleixner <tglx@linutronix.de> +Fixes: ce4a4e565f52 ("x86/mm: Remove the UP asm/tlbflush.h code, always use the (formerly) SMP code") +Link: http://lkml.kernel.org/r/76da9a3cc4415996f2ad2c905b93414add322021.1496673616.git.luto@kernel.org +Signed-off-by: Ingo Molnar <mingo@kernel.org> +Signed-off-by: Ben Hutchings <ben@decadent.org.uk> +--- + include/linux/vm_event_item.h | 2 -- + 1 file changed, 2 deletions(-) + +--- a/include/linux/vm_event_item.h ++++ b/include/linux/vm_event_item.h +@@ -73,10 +73,8 @@ enum vm_event_item { PGPGIN, PGPGOUT, PS + THP_ZERO_PAGE_ALLOC_FAILED, + #endif + #ifdef CONFIG_DEBUG_TLBFLUSH +-#ifdef CONFIG_SMP + NR_TLB_REMOTE_FLUSH, /* cpu tried to flush others' tlbs */ + NR_TLB_REMOTE_FLUSH_RECEIVED,/* cpu received ipi for flush */ +-#endif /* CONFIG_SMP */ + NR_TLB_LOCAL_FLUSH_ALL, + NR_TLB_LOCAL_FLUSH_ONE, + #endif /* CONFIG_DEBUG_TLBFLUSH */ diff --git a/queue-3.16/series b/queue-3.16/series index 8e94089f..4a3fb17c 100644 --- a/queue-3.16/series +++ b/queue-3.16/series @@ -120,3 +120,6 @@ x86-speculation-l1tf-make-pmd-pud_mknotpresent-invert.patch x86-mm-pat-make-set_memory_np-l1tf-safe.patch x86-mm-kmmio-make-the-tracer-robust-against-l1tf.patch x86-speculation-l1tf-suggest-what-to-do-on-systems-with-too-much-ram.patch +via-cuda-use-spinlock_irq_save-restore-instead-of-enable-disable_irq.patch +x86-tools-fix-gcc-7-warning-in-relocs.c.patch +mm-vmstat-make-nr_tlb_remote_flush_received-available-even-on-up.patch diff --git a/queue-3.16/via-cuda-use-spinlock_irq_save-restore-instead-of-enable-disable_irq.patch b/queue-3.16/via-cuda-use-spinlock_irq_save-restore-instead-of-enable-disable_irq.patch new file mode 100644 index 00000000..781a0ff0 --- /dev/null +++ b/queue-3.16/via-cuda-use-spinlock_irq_save-restore-instead-of-enable-disable_irq.patch @@ -0,0 +1,77 @@ +From: Finn Thain <fthain@telegraphics.com.au> +Date: Sat, 31 Dec 2016 19:56:26 -0500 +Subject: via-cuda: Use spinlock_irq_save/restore instead of enable/disable_irq + +commit ac39452e942af6a212e8f89e8a36b71354323845 upstream. + +The cuda_start() function uses spinlock_irq_save/restore for mutual +exclusion. Let's have cuda_poll() do the same when polling the VIA +interrupt. + +The benefit to disabling local irqs when the interrupt is being polled +is that the interrupt handler now has the same timing properties +regardless of whether it is invoked normally or from cuda_poll(). + +This driver was written back when local irqs remained enabled during +execution of interrupt handlers and cuda_poll() was probably trying +to achieve the same effect by use of enable/disable_irq. + +Tested-by: Stan Johnson <userm57@yahoo.com> +Signed-off-by: Finn Thain <fthain@telegraphics.com.au> +Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> +[bwh: Backported to 3.16: adjust context] +Signed-off-by: Ben Hutchings <ben@decadent.org.uk> +--- + drivers/macintosh/via-cuda.c | 16 +++++----------- + 1 file changed, 5 insertions(+), 11 deletions(-) + +--- a/drivers/macintosh/via-cuda.c ++++ b/drivers/macintosh/via-cuda.c +@@ -432,26 +432,20 @@ cuda_start(void) + void + cuda_poll(void) + { +- /* cuda_interrupt only takes a normal lock, we disable +- * interrupts here to avoid re-entering and thus deadlocking. +- */ +- if (cuda_irq) +- disable_irq(cuda_irq); +- cuda_interrupt(0, NULL); +- if (cuda_irq) +- enable_irq(cuda_irq); ++ cuda_interrupt(0, NULL); + } + + static irqreturn_t + cuda_interrupt(int irq, void *arg) + { ++ unsigned long flags; + int status; + struct adb_request *req = NULL; + unsigned char ibuf[16]; + int ibuf_len = 0; + int complete = 0; + +- spin_lock(&cuda_lock); ++ spin_lock_irqsave(&cuda_lock, flags); + + /* On powermacs, this handler is registered for the VIA IRQ. But they use + * just the shift register IRQ -- other VIA interrupt sources are disabled. +@@ -464,7 +458,7 @@ cuda_interrupt(int irq, void *arg) + #endif + { + if ((in_8(&via[IFR]) & SR_INT) == 0) { +- spin_unlock(&cuda_lock); ++ spin_unlock_irqrestore(&cuda_lock, flags); + return IRQ_NONE; + } else { + out_8(&via[IFR], SR_INT); +@@ -593,7 +587,7 @@ cuda_interrupt(int irq, void *arg) + default: + printk("cuda_interrupt: unknown cuda_state %d?\n", cuda_state); + } +- spin_unlock(&cuda_lock); ++ spin_unlock_irqrestore(&cuda_lock, flags); + if (complete && req) { + void (*done)(struct adb_request *) = req->done; + mb(); diff --git a/queue-3.16/x86-tools-fix-gcc-7-warning-in-relocs.c.patch b/queue-3.16/x86-tools-fix-gcc-7-warning-in-relocs.c.patch new file mode 100644 index 00000000..ec0205f7 --- /dev/null +++ b/queue-3.16/x86-tools-fix-gcc-7-warning-in-relocs.c.patch @@ -0,0 +1,50 @@ +From: Markus Trippelsdorf <markus@trippelsdorf.de> +Date: Thu, 15 Dec 2016 13:45:13 +0100 +Subject: x86/tools: Fix gcc-7 warning in relocs.c +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +commit 7ebb916782949621ff6819acf373a06902df7679 upstream. + +gcc-7 warns: + +In file included from arch/x86/tools/relocs_64.c:17:0: +arch/x86/tools/relocs.c: In function ‘process_64’: +arch/x86/tools/relocs.c:953:2: warning: argument 1 null where non-null expected [-Wnonnull] + qsort(r->offset, r->count, sizeof(r->offset[0]), cmp_relocs); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +In file included from arch/x86/tools/relocs.h:6:0, + from arch/x86/tools/relocs_64.c:1: +/usr/include/stdlib.h:741:13: note: in a call to function ‘qsort’ declared here + extern void qsort + +This happens because relocs16 is not used for ELF_BITS == 64, +so there is no point in trying to sort it. + +Make the sort_relocs(&relocs16) call 32bit only. + +Signed-off-by: Markus Trippelsdorf <markus@trippelsdorf.de> +Link: http://lkml.kernel.org/r/20161215124513.GA289@x4 +Signed-off-by: Thomas Gleixner <tglx@linutronix.de> +[bwh: Backported to 3.16: Also make sort_relocs(&relocs64) conditional, + which was done upstream in commit 6d24c5f72dfb "x86-64: Handle PC-relative + relocations on per-CPU data".] +Signed-off-by: Ben Hutchings <ben@decadent.org.uk> +--- +--- a/arch/x86/tools/relocs.c ++++ b/arch/x86/tools/relocs.c +@@ -984,9 +984,12 @@ static void emit_relocs(int as_text, int + die("Segment relocations found but --realmode not specified\n"); + + /* Order the relocations for more efficient processing */ +- sort_relocs(&relocs16); + sort_relocs(&relocs32); ++#if ELF_BITS == 64 + sort_relocs(&relocs64); ++#else ++ sort_relocs(&relocs16); ++#endif + + /* Print the relocations */ + if (as_text) { |