--- /dev/null
+From stable-bounces@linux.kernel.org Tue Mar 11 11:02:27 2008
+Date: Tue, 11 Mar 2008 01:50:07 GMT
+Message-Id: <200803110150.m2B1o7Zj007176@hera.kernel.org>
+From: jejb@kernel.org
+To: jejb@kernel.org, stable@kernel.org
+Subject: drivers: fix dma_get_required_mask
+
+commit: e88a0c2ca81207a75afe5bbb8020541dabf606ac
+From: James Bottomley <James.Bottomley@HansenPartnership.com>
+Date: Sun, 9 Mar 2008 11:57:56 -0500
+Subject: drivers: fix dma_get_required_mask
+
+There's a bug in the current implementation of dma_get_required_mask()
+where it ands the returned mask with the current device mask. This
+rather defeats the purpose if you're using the call to determine what
+your mask should be (since you will at that time have the default
+DMA_32BIT_MASK). This bug results in any driver that uses this function
+*always* getting a 32 bit mask, which is wrong.
+
+Fix by removing the and with dev->dma_mask.
+
+Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
+Cc: stable <stable@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+---
+ drivers/base/platform.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/base/platform.c
++++ b/drivers/base/platform.c
+@@ -647,7 +647,7 @@ u64 dma_get_required_mask(struct device
+ high_totalram += high_totalram - 1;
+ mask = (((u64)high_totalram) << 32) + 0xffffffff;
+ }
+- return mask & *dev->dma_mask;
++ return mask;
+ }
+ EXPORT_SYMBOL_GPL(dma_get_required_mask);
+ #endif
--- /dev/null
+From stable-bounces@linux.kernel.org Tue Mar 11 11:00:25 2008
+Date: Tue, 11 Mar 2008 01:50:06 GMT
+Message-Id: <200803110150.m2B1o6T1007120@hera.kernel.org>
+From: jejb@kernel.org
+To: jejb@kernel.org, stable@kernel.org
+Subject: iov_iter_advance() fix
+
+commit: f7009264c519603b8ec67c881bd368a56703cfc9
+From: Nick Piggin <npiggin@suse.de>
+Date: Mon, 10 Mar 2008 11:43:59 -0700
+Subject: iov_iter_advance() fix
+
+iov_iter_advance() skips over zero-length iovecs, however it does not properly
+terminate at the end of the iovec array. Fix this by checking against
+i->count before we skip a zero-length iov.
+
+The bug was reproduced with a test program that continually randomly creates
+iovs to writev. The fix was also verified with the same program and also it
+could verify that the correct data was contained in the file after each
+writev.
+
+Signed-off-by: Nick Piggin <npiggin@suse.de>
+Tested-by: "Kevin Coffman" <kwc@citi.umich.edu>
+Cc: "Alexey Dobriyan" <adobriyan@gmail.com>
+Cc: <stable@kernel.org>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+---
+ mm/filemap.c | 22 ++++++++++------------
+ 1 file changed, 10 insertions(+), 12 deletions(-)
+
+--- a/mm/filemap.c
++++ b/mm/filemap.c
+@@ -1725,21 +1725,27 @@ size_t iov_iter_copy_from_user(struct pa
+ }
+ EXPORT_SYMBOL(iov_iter_copy_from_user);
+
+-static void __iov_iter_advance_iov(struct iov_iter *i, size_t bytes)
++void iov_iter_advance(struct iov_iter *i, size_t bytes)
+ {
++ BUG_ON(i->count < bytes);
++
+ if (likely(i->nr_segs == 1)) {
+ i->iov_offset += bytes;
++ i->count -= bytes;
+ } else {
+ const struct iovec *iov = i->iov;
+ size_t base = i->iov_offset;
+
+ /*
+ * The !iov->iov_len check ensures we skip over unlikely
+- * zero-length segments.
++ * zero-length segments (without overruning the iovec).
+ */
+- while (bytes || !iov->iov_len) {
+- int copy = min(bytes, iov->iov_len - base);
++ while (bytes || unlikely(!iov->iov_len && i->count)) {
++ int copy;
+
++ copy = min(bytes, iov->iov_len - base);
++ BUG_ON(!i->count || i->count < copy);
++ i->count -= copy;
+ bytes -= copy;
+ base += copy;
+ if (iov->iov_len == base) {
+@@ -1751,14 +1757,6 @@ static void __iov_iter_advance_iov(struc
+ i->iov_offset = base;
+ }
+ }
+-
+-void iov_iter_advance(struct iov_iter *i, size_t bytes)
+-{
+- BUG_ON(i->count < bytes);
+-
+- __iov_iter_advance_iov(i, bytes);
+- i->count -= bytes;
+-}
+ EXPORT_SYMBOL(iov_iter_advance);
+
+ /*
ipcomp-disable-bh-on-output-when-using-shared-tfm.patch
irq_noprobe-helper-functions.patch
mips-mark-all-but-i8259-interrupts-as-no-probe.patch
+ub-fix-up-the-conversion-to-sg_init_table.patch
+x86-clear-df-before-calling-signal-handler.patch
+iov_iter_advance-fix.patch
+drivers-fix-dma_get_required_mask.patch
+x86-adjust-enable_nmi_through_lvt0.patch
--- /dev/null
+From stable-bounces@linux.kernel.org Tue Mar 11 10:47:24 2008
+From: Oliver Pinter <oliver.pntr@gmail.com>
+To: stable@kernel.org
+Date: Fri, 7 Mar 2008 17:36:54 +0100
+Message-Id: <200803071736.54369.oliver.pntr@gmail.com>
+Subject: [PATCH] ub: fix up the conversion to sg_init_table()
+
+>From 541645be8bbb67d39113096263dcf00615d789e3 Mon Sep 17 00:00:00 2001
+From: Pete Zaitcev <zaitcev@redhat.com>
+Date: Sat, 9 Feb 2008 00:10:17 -0800
+
+Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
+Cc: "Oliver Pinter" <oliver.pntr@gmail.com>
+Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
+Cc: Greg KH <greg@kroah.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+---
+ drivers/block/ub.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/block/ub.c
++++ b/drivers/block/ub.c
+@@ -657,7 +657,6 @@ static int ub_request_fn_1(struct ub_lun
+ if ((cmd = ub_get_cmd(lun)) == NULL)
+ return -1;
+ memset(cmd, 0, sizeof(struct ub_scsi_cmd));
+- sg_init_table(cmd->sgv, UB_MAX_REQ_SG);
+
+ blkdev_dequeue_request(rq);
+
+@@ -668,6 +667,7 @@ static int ub_request_fn_1(struct ub_lun
+ /*
+ * get scatterlist from block layer
+ */
++ sg_init_table(&urq->sgv[0], UB_MAX_REQ_SG);
+ n_elem = blk_rq_map_sg(lun->disk->queue, rq, &urq->sgv[0]);
+ if (n_elem < 0) {
+ /* Impossible, because blk_rq_map_sg should not hit ENOMEM. */
--- /dev/null
+From stable-bounces@linux.kernel.org Tue Mar 11 11:09:24 2008
+Date: Tue, 11 Mar 2008 11:30:25 +0100 (CET)
+From: Thomas Gleixner <tglx@linutronix.de>
+To: Justin Piszcz <jpiszcz@lucidpixels.com>
+Message-ID: <alpine.LFD.1.00.0803111104550.3781@apollo.tec.linutronix.de>
+Cc: LKML <linux-kernel@vger.kernel.org>, Stable Team <stable@kernel.org>
+Subject: x86: adjust enable_NMI_through_LVT0()
+
+commit e94271017f0933b29362a3c9dea5a6b9d04d98e1
+From: Jan Beulich <jbeulich@novell.com>
+Date: Wed Jan 30 13:31:24 2008 +0100
+
+Its previous use in a call to on_each_cpu() was pointless, as at the
+time that code gets executed only one CPU is online. Further, the
+function can be __cpuinit, and for this to work without
+CONFIG_HOTPLUG_CPU setup_nmi() must also get an attribute (this one
+can even be __init; on 64-bits check_timer() also was lacking that
+attribute).
+
+Signed-off-by: Jan Beulich <jbeulich@novell.com>
+Signed-off-by: Ingo Molnar <mingo@elte.hu>
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+[ tglx@linutronix.de: backport to 2.6.24.3]
+Cc: Justin Piszcz <jpiszcz@lucidpixels.com>
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+---
+ arch/x86/kernel/apic_32.c | 2 +-
+ arch/x86/kernel/apic_64.c | 2 +-
+ arch/x86/kernel/io_apic_32.c | 4 ++--
+ arch/x86/kernel/io_apic_64.c | 6 +++---
+ arch/x86/kernel/smpboot_32.c | 2 +-
+ arch/x86/kernel/smpboot_64.c | 2 +-
+ include/asm-x86/apic_32.h | 2 +-
+ include/asm-x86/io_apic_64.h | 2 +-
+ 8 files changed, 11 insertions(+), 11 deletions(-)
+
+--- a/arch/x86/kernel/apic_32.c
++++ b/arch/x86/kernel/apic_32.c
+@@ -154,7 +154,7 @@ unsigned long safe_apic_wait_icr_idle(vo
+ /**
+ * enable_NMI_through_LVT0 - enable NMI through local vector table 0
+ */
+-void enable_NMI_through_LVT0 (void * dummy)
++void __cpuinit enable_NMI_through_LVT0(void)
+ {
+ unsigned int v = APIC_DM_NMI;
+
+--- a/arch/x86/kernel/apic_64.c
++++ b/arch/x86/kernel/apic_64.c
+@@ -151,7 +151,7 @@ unsigned int safe_apic_wait_icr_idle(voi
+ return send_status;
+ }
+
+-void enable_NMI_through_LVT0 (void * dummy)
++void enable_NMI_through_LVT0(void)
+ {
+ unsigned int v;
+
+--- a/arch/x86/kernel/io_apic_32.c
++++ b/arch/x86/kernel/io_apic_32.c
+@@ -2080,7 +2080,7 @@ static struct irq_chip lapic_chip __read
+ .eoi = ack_apic,
+ };
+
+-static void setup_nmi (void)
++static void __init setup_nmi(void)
+ {
+ /*
+ * Dirty trick to enable the NMI watchdog ...
+@@ -2093,7 +2093,7 @@ static void setup_nmi (void)
+ */
+ apic_printk(APIC_VERBOSE, KERN_INFO "activating NMI Watchdog ...");
+
+- on_each_cpu(enable_NMI_through_LVT0, NULL, 1, 1);
++ enable_NMI_through_LVT0();
+
+ apic_printk(APIC_VERBOSE, " done.\n");
+ }
+--- a/arch/x86/kernel/io_apic_64.c
++++ b/arch/x86/kernel/io_apic_64.c
+@@ -1565,7 +1565,7 @@ static struct hw_interrupt_type lapic_ir
+ .end = end_lapic_irq,
+ };
+
+-static void setup_nmi (void)
++static void __init setup_nmi(void)
+ {
+ /*
+ * Dirty trick to enable the NMI watchdog ...
+@@ -1578,7 +1578,7 @@ static void setup_nmi (void)
+ */
+ printk(KERN_INFO "activating NMI Watchdog ...");
+
+- enable_NMI_through_LVT0(NULL);
++ enable_NMI_through_LVT0();
+
+ printk(" done.\n");
+ }
+@@ -1654,7 +1654,7 @@ static inline void unlock_ExtINT_logic(v
+ *
+ * FIXME: really need to revamp this for modern platforms only.
+ */
+-static inline void check_timer(void)
++static inline void __init check_timer(void)
+ {
+ struct irq_cfg *cfg = irq_cfg + 0;
+ int apic1, pin1, apic2, pin2;
+--- a/arch/x86/kernel/smpboot_32.c
++++ b/arch/x86/kernel/smpboot_32.c
+@@ -405,7 +405,7 @@ static void __cpuinit start_secondary(vo
+ setup_secondary_clock();
+ if (nmi_watchdog == NMI_IO_APIC) {
+ disable_8259A_irq(0);
+- enable_NMI_through_LVT0(NULL);
++ enable_NMI_through_LVT0();
+ enable_8259A_irq(0);
+ }
+ /*
+--- a/arch/x86/kernel/smpboot_64.c
++++ b/arch/x86/kernel/smpboot_64.c
+@@ -338,7 +338,7 @@ void __cpuinit start_secondary(void)
+
+ if (nmi_watchdog == NMI_IO_APIC) {
+ disable_8259A_irq(0);
+- enable_NMI_through_LVT0(NULL);
++ enable_NMI_through_LVT0();
+ enable_8259A_irq(0);
+ }
+
+--- a/include/asm-x86/apic_32.h
++++ b/include/asm-x86/apic_32.h
+@@ -109,7 +109,7 @@ extern void setup_boot_APIC_clock (void)
+ extern void setup_secondary_APIC_clock (void);
+ extern int APIC_init_uniprocessor (void);
+
+-extern void enable_NMI_through_LVT0 (void * dummy);
++extern void enable_NMI_through_LVT0(void);
+
+ #define ARCH_APICTIMER_STOPS_ON_C3 1
+
+--- a/include/asm-x86/io_apic_64.h
++++ b/include/asm-x86/io_apic_64.h
+@@ -129,7 +129,7 @@ extern int io_apic_set_pci_routing (int
+
+ extern int sis_apic_bug; /* dummy */
+
+-void enable_NMI_through_LVT0 (void * dummy);
++void enable_NMI_through_LVT0(void);
+
+ extern spinlock_t i8259A_lock;
+
--- /dev/null
+From aurelien@aurel32.net Tue Mar 11 10:41:45 2008
+Date: Sat, 8 Mar 2008 11:43:52 +0100
+From: Aurelien Jarno <aurelien@aurel32.net>
+To: Greg Kroah-Hartman <greg@kroah.com>, Chris Wright <chrisw@sous-sol.org>
+Cc: stable@kernel.org, Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>
+Subject: x86: Clear DF before calling signal handler
+Message-ID: <20080308104352.GA18303@hall.aurel32.net>
+
+x86: Clear DF before calling signal handler
+
+The Linux kernel currently does not clear the direction flag before
+calling a signal handler, whereas the x86/x86-64 ABI requires that.
+This become a real problem with gcc version 4.3, which assumes that
+the direction flag is correctly cleared at the entry of a function.
+
+This patches changes the setup_frame() functions to clear the
+direction before entering the signal handler.
+
+This is a backport of patch e40cd10ccff3d9fbffd57b93780bee4b7b9bff51
+("x86: clear DF before calling signal handler") that has been applied
+in 2.6.25-rc.
+
+Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+---
+ arch/x86/ia32/ia32_signal.c | 4 ++--
+ arch/x86/kernel/signal_32.c | 4 ++--
+ arch/x86/kernel/signal_64.c | 2 +-
+ 3 files changed, 5 insertions(+), 5 deletions(-)
+
+--- a/arch/x86/ia32/ia32_signal.c
++++ b/arch/x86/ia32/ia32_signal.c
+@@ -494,7 +494,7 @@ int ia32_setup_frame(int sig, struct k_s
+ regs->ss = __USER32_DS;
+
+ set_fs(USER_DS);
+- regs->eflags &= ~TF_MASK;
++ regs->eflags &= ~(TF_MASK | X86_EFLAGS_DF);
+ if (test_thread_flag(TIF_SINGLESTEP))
+ ptrace_notify(SIGTRAP);
+
+@@ -600,7 +600,7 @@ int ia32_setup_rt_frame(int sig, struct
+ regs->ss = __USER32_DS;
+
+ set_fs(USER_DS);
+- regs->eflags &= ~TF_MASK;
++ regs->eflags &= ~(TF_MASK | X86_EFLAGS_DF);
+ if (test_thread_flag(TIF_SINGLESTEP))
+ ptrace_notify(SIGTRAP);
+
+--- a/arch/x86/kernel/signal_32.c
++++ b/arch/x86/kernel/signal_32.c
+@@ -396,7 +396,7 @@ static int setup_frame(int sig, struct k
+ * The tracer may want to single-step inside the
+ * handler too.
+ */
+- regs->eflags &= ~TF_MASK;
++ regs->eflags &= ~(TF_MASK | X86_EFLAGS_DF);
+ if (test_thread_flag(TIF_SINGLESTEP))
+ ptrace_notify(SIGTRAP);
+
+@@ -489,7 +489,7 @@ static int setup_rt_frame(int sig, struc
+ * The tracer may want to single-step inside the
+ * handler too.
+ */
+- regs->eflags &= ~TF_MASK;
++ regs->eflags &= ~(TF_MASK | X86_EFLAGS_DF);
+ if (test_thread_flag(TIF_SINGLESTEP))
+ ptrace_notify(SIGTRAP);
+
+--- a/arch/x86/kernel/signal_64.c
++++ b/arch/x86/kernel/signal_64.c
+@@ -295,7 +295,7 @@ static int setup_rt_frame(int sig, struc
+ see include/asm-x86_64/uaccess.h for details. */
+ set_fs(USER_DS);
+
+- regs->eflags &= ~TF_MASK;
++ regs->eflags &= ~(TF_MASK | X86_EFLAGS_DF);
+ if (test_thread_flag(TIF_SINGLESTEP))
+ ptrace_notify(SIGTRAP);
+ #ifdef DEBUG_SIG