]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Dec 2012 18:26:59 +0000 (10:26 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Dec 2012 18:26:59 +0000 (10:26 -0800)
added patches:
arm-kirkwood-update-pci-e-fixup.patch
mm-soft-offline-split-thp-at-the-beginning-of-soft_offline_page.patch
mm-vmemmap-fix-wrong-use-of-virt_to_page.patch
x86-fpu-avoid-fpu-lazy-restore-after-suspend.patch

queue-3.4/arm-kirkwood-update-pci-e-fixup.patch [new file with mode: 0644]
queue-3.4/mm-soft-offline-split-thp-at-the-beginning-of-soft_offline_page.patch [new file with mode: 0644]
queue-3.4/mm-vmemmap-fix-wrong-use-of-virt_to_page.patch [new file with mode: 0644]
queue-3.4/series
queue-3.4/x86-fpu-avoid-fpu-lazy-restore-after-suspend.patch [new file with mode: 0644]

diff --git a/queue-3.4/arm-kirkwood-update-pci-e-fixup.patch b/queue-3.4/arm-kirkwood-update-pci-e-fixup.patch
new file mode 100644 (file)
index 0000000..5eb53e0
--- /dev/null
@@ -0,0 +1,60 @@
+From 1dc831bf53fddcc6443f74a39e72db5bcea4f15d Mon Sep 17 00:00:00 2001
+From: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
+Date: Wed, 21 Nov 2012 00:19:06 -0700
+Subject: ARM: Kirkwood: Update PCI-E fixup
+
+From: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
+
+commit 1dc831bf53fddcc6443f74a39e72db5bcea4f15d upstream.
+
+- The code relies on rc_pci_fixup being called, which only happens
+  when CONFIG_PCI_QUIRKS is enabled, so add that to Kconfig. Omitting
+  this causes a booting failure with a non-obvious cause.
+- Update rc_pci_fixup to set the class properly, copying the
+  more modern style from other places
+- Correct the rc_pci_fixup comment
+
+Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
+Signed-off-by: Jason Cooper <jason@lakedaemon.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arm/Kconfig              |    1 +
+ arch/arm/mach-kirkwood/pcie.c |   11 ++++++++---
+ 2 files changed, 9 insertions(+), 3 deletions(-)
+
+--- a/arch/arm/Kconfig
++++ b/arch/arm/Kconfig
+@@ -579,6 +579,7 @@ config ARCH_KIRKWOOD
+       bool "Marvell Kirkwood"
+       select CPU_FEROCEON
+       select PCI
++      select PCI_QUIRKS
+       select ARCH_REQUIRE_GPIOLIB
+       select GENERIC_CLOCKEVENTS
+       select NEED_MACH_IO_H
+--- a/arch/arm/mach-kirkwood/pcie.c
++++ b/arch/arm/mach-kirkwood/pcie.c
+@@ -212,14 +212,19 @@ static int __init kirkwood_pcie_setup(in
+       return 1;
+ }
++/*
++ * The root complex has a hardwired class of PCI_CLASS_MEMORY_OTHER, when it
++ * is operating as a root complex this needs to be switched to
++ * PCI_CLASS_BRIDGE_HOST or Linux will errantly try to process the BAR's on
++ * the device. Decoding setup is handled by the orion code.
++ */
+ static void __devinit rc_pci_fixup(struct pci_dev *dev)
+ {
+-      /*
+-       * Prevent enumeration of root complex.
+-       */
+       if (dev->bus->parent == NULL && dev->devfn == 0) {
+               int i;
++              dev->class &= 0xff;
++              dev->class |= PCI_CLASS_BRIDGE_HOST << 8;
+               for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
+                       dev->resource[i].start = 0;
+                       dev->resource[i].end   = 0;
diff --git a/queue-3.4/mm-soft-offline-split-thp-at-the-beginning-of-soft_offline_page.patch b/queue-3.4/mm-soft-offline-split-thp-at-the-beginning-of-soft_offline_page.patch
new file mode 100644 (file)
index 0000000..e6332c0
--- /dev/null
@@ -0,0 +1,47 @@
+From 783657a7dc20e5c0efbc9a09a9dd38e238a723da Mon Sep 17 00:00:00 2001
+From: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
+Date: Thu, 29 Nov 2012 13:54:34 -0800
+Subject: mm: soft offline: split thp at the beginning of soft_offline_page()
+
+From: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
+
+commit 783657a7dc20e5c0efbc9a09a9dd38e238a723da upstream.
+
+When we try to soft-offline a thp tail page, put_page() is called on the
+tail page unthinkingly and VM_BUG_ON is triggered in put_compound_page().
+
+This patch splits thp before going into the main body of soft-offlining.
+
+Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
+Cc: Andi Kleen <andi@firstfloor.org>
+Cc: Tony Luck <tony.luck@intel.com>
+Cc: Andi Kleen <andi.kleen@intel.com>
+Cc: Wu Fengguang <fengguang.wu@intel.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ mm/memory-failure.c |    8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+--- a/mm/memory-failure.c
++++ b/mm/memory-failure.c
+@@ -1481,9 +1481,17 @@ int soft_offline_page(struct page *page,
+ {
+       int ret;
+       unsigned long pfn = page_to_pfn(page);
++      struct page *hpage = compound_trans_head(page);
+       if (PageHuge(page))
+               return soft_offline_huge_page(page, flags);
++      if (PageTransHuge(hpage)) {
++              if (PageAnon(hpage) && unlikely(split_huge_page(hpage))) {
++                      pr_info("soft offline: %#lx: failed to split THP\n",
++                              pfn);
++                      return -EBUSY;
++              }
++      }
+       ret = get_any_page(page, pfn, flags);
+       if (ret < 0)
diff --git a/queue-3.4/mm-vmemmap-fix-wrong-use-of-virt_to_page.patch b/queue-3.4/mm-vmemmap-fix-wrong-use-of-virt_to_page.patch
new file mode 100644 (file)
index 0000000..4b9adf7
--- /dev/null
@@ -0,0 +1,80 @@
+From ae64ffcac35de0db628ba9631edf8ff34c5cd7ac Mon Sep 17 00:00:00 2001
+From: Jianguo Wu <wujianguo@huawei.com>
+Date: Thu, 29 Nov 2012 13:54:21 -0800
+Subject: mm/vmemmap: fix wrong use of virt_to_page
+
+From: Jianguo Wu <wujianguo@huawei.com>
+
+commit ae64ffcac35de0db628ba9631edf8ff34c5cd7ac upstream.
+
+I enable CONFIG_DEBUG_VIRTUAL and CONFIG_SPARSEMEM_VMEMMAP, when doing
+memory hotremove, there is a kernel BUG at arch/x86/mm/physaddr.c:20.
+
+It is caused by free_section_usemap()->virt_to_page(), virt_to_page() is
+only used for kernel direct mapping address, but sparse-vmemmap uses
+vmemmap address, so it is going wrong here.
+
+  ------------[ cut here ]------------
+  kernel BUG at arch/x86/mm/physaddr.c:20!
+  invalid opcode: 0000 [#1] SMP
+  Modules linked in: acpihp_drv acpihp_slot edd cpufreq_conservative cpufreq_userspace cpufreq_powersave acpi_cpufreq mperf fuse vfat fat loop dm_mod coretemp kvm crc32c_intel ipv6 ixgbe igb iTCO_wdt i7core_edac edac_core pcspkr iTCO_vendor_support ioatdma microcode joydev sr_mod i2c_i801 dca lpc_ich mfd_core mdio tpm_tis i2c_core hid_generic tpm cdrom sg tpm_bios rtc_cmos button ext3 jbd mbcache usbhid hid uhci_hcd ehci_hcd usbcore usb_common sd_mod crc_t10dif processor thermal_sys hwmon scsi_dh_alua scsi_dh_hp_sw scsi_dh_rdac scsi_dh_emc scsi_dh ata_generic ata_piix libata megaraid_sas scsi_mod
+  CPU 39
+  Pid: 6454, comm: sh Not tainted 3.7.0-rc1-acpihp-final+ #45 QCI QSSC-S4R/QSSC-S4R
+  RIP: 0010:[<ffffffff8103c908>]  [<ffffffff8103c908>] __phys_addr+0x88/0x90
+  RSP: 0018:ffff8804440d7c08  EFLAGS: 00010006
+  RAX: 0000000000000006 RBX: ffffea0012000000 RCX: 000000000000002c
+  ...
+
+Signed-off-by: Jianguo Wu <wujianguo@huawei.com>
+Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
+Reviewd-by: Wen Congyang <wency@cn.fujitsu.com>
+Acked-by: Johannes Weiner <hannes@cmpxchg.org>
+Reviewed-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
+Reviewed-by: Michal Hocko <mhocko@suse.cz>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ mm/sparse.c |   10 ++++------
+ 1 file changed, 4 insertions(+), 6 deletions(-)
+
+--- a/mm/sparse.c
++++ b/mm/sparse.c
+@@ -619,7 +619,7 @@ static void __kfree_section_memmap(struc
+ {
+       return; /* XXX: Not implemented yet */
+ }
+-static void free_map_bootmem(struct page *page, unsigned long nr_pages)
++static void free_map_bootmem(struct page *memmap, unsigned long nr_pages)
+ {
+ }
+ #else
+@@ -660,10 +660,11 @@ static void __kfree_section_memmap(struc
+                          get_order(sizeof(struct page) * nr_pages));
+ }
+-static void free_map_bootmem(struct page *page, unsigned long nr_pages)
++static void free_map_bootmem(struct page *memmap, unsigned long nr_pages)
+ {
+       unsigned long maps_section_nr, removing_section_nr, i;
+       unsigned long magic;
++      struct page *page = virt_to_page(memmap);
+       for (i = 0; i < nr_pages; i++, page++) {
+               magic = (unsigned long) page->lru.next;
+@@ -712,13 +713,10 @@ static void free_section_usemap(struct p
+        */
+       if (memmap) {
+-              struct page *memmap_page;
+-              memmap_page = virt_to_page(memmap);
+-
+               nr_pages = PAGE_ALIGN(PAGES_PER_SECTION * sizeof(struct page))
+                       >> PAGE_SHIFT;
+-              free_map_bootmem(memmap_page, nr_pages);
++              free_map_bootmem(memmap, nr_pages);
+       }
+ }
index 5d7672d84398bdc74c915e0080f25470d8fbb0df..c64e0644adf547603aa344ad5487fe51882a6ea3 100644 (file)
@@ -3,3 +3,7 @@ dove-fix-irq_to_pmu.patch
 drm-radeon-dce4-don-t-use-radeon_crtc-for-vblank-callback.patch
 drm-radeon-properly-handle-mc_stop-mc_resume-on-evergreen-v2.patch
 drm-radeon-properly-track-the-crtc-not_enabled-case-evergreen_mc_stop.patch
+mm-vmemmap-fix-wrong-use-of-virt_to_page.patch
+mm-soft-offline-split-thp-at-the-beginning-of-soft_offline_page.patch
+arm-kirkwood-update-pci-e-fixup.patch
+x86-fpu-avoid-fpu-lazy-restore-after-suspend.patch
diff --git a/queue-3.4/x86-fpu-avoid-fpu-lazy-restore-after-suspend.patch b/queue-3.4/x86-fpu-avoid-fpu-lazy-restore-after-suspend.patch
new file mode 100644 (file)
index 0000000..2207399
--- /dev/null
@@ -0,0 +1,80 @@
+From 644c154186386bb1fa6446bc5e037b9ed098db46 Mon Sep 17 00:00:00 2001
+From: Vincent Palatin <vpalatin@chromium.org>
+Date: Fri, 30 Nov 2012 12:15:32 -0800
+Subject: x86, fpu: Avoid FPU lazy restore after suspend
+
+From: Vincent Palatin <vpalatin@chromium.org>
+
+commit 644c154186386bb1fa6446bc5e037b9ed098db46 upstream.
+
+When a cpu enters S3 state, the FPU state is lost.
+After resuming for S3, if we try to lazy restore the FPU for a process running
+on the same CPU, this will result in a corrupted FPU context.
+
+Ensure that "fpu_owner_task" is properly invalided when (re-)initializing a CPU,
+so nobody will try to lazy restore a state which doesn't exist in the hardware.
+
+Tested with a 64-bit kernel on a 4-core Ivybridge CPU with eagerfpu=off,
+by doing thousands of suspend/resume cycles with 4 processes doing FPU
+operations running. Without the patch, a process is killed after a
+few hundreds cycles by a SIGFPE.
+
+Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
+Cc: Duncan Laurie <dlaurie@chromium.org>
+Cc: Olof Johansson <olofj@chromium.org>
+Link: http://lkml.kernel.org/r/1354306532-1014-1-git-send-email-vpalatin@chromium.org
+Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/x86/include/asm/fpu-internal.h |   15 +++++++++------
+ arch/x86/kernel/smpboot.c           |    5 +++++
+ 2 files changed, 14 insertions(+), 6 deletions(-)
+
+--- a/arch/x86/include/asm/fpu-internal.h
++++ b/arch/x86/include/asm/fpu-internal.h
+@@ -334,14 +334,17 @@ static inline void __thread_fpu_begin(st
+ typedef struct { int preload; } fpu_switch_t;
+ /*
+- * FIXME! We could do a totally lazy restore, but we need to
+- * add a per-cpu "this was the task that last touched the FPU
+- * on this CPU" variable, and the task needs to have a "I last
+- * touched the FPU on this CPU" and check them.
++ * Must be run with preemption disabled: this clears the fpu_owner_task,
++ * on this CPU.
+  *
+- * We don't do that yet, so "fpu_lazy_restore()" always returns
+- * false, but some day..
++ * This will disable any lazy FPU state restore of the current FPU state,
++ * but if the current thread owns the FPU, it will still be saved by.
+  */
++static inline void __cpu_disable_lazy_restore(unsigned int cpu)
++{
++      per_cpu(fpu_owner_task, cpu) = NULL;
++}
++
+ static inline int fpu_lazy_restore(struct task_struct *new, unsigned int cpu)
+ {
+       return new == percpu_read_stable(fpu_owner_task) &&
+--- a/arch/x86/kernel/smpboot.c
++++ b/arch/x86/kernel/smpboot.c
+@@ -66,6 +66,8 @@
+ #include <asm/mwait.h>
+ #include <asm/apic.h>
+ #include <asm/io_apic.h>
++#include <asm/i387.h>
++#include <asm/fpu-internal.h>
+ #include <asm/setup.h>
+ #include <asm/uv/uv.h>
+ #include <linux/mc146818rtc.h>
+@@ -851,6 +853,9 @@ int __cpuinit native_cpu_up(unsigned int
+       per_cpu(cpu_state, cpu) = CPU_UP_PREPARE;
++      /* the FPU context is blank, nobody can own it */
++      __cpu_disable_lazy_restore(cpu);
++
+       err = do_boot_cpu(apicid, cpu);
+       if (err) {
+               pr_debug("do_boot_cpu failed %d\n", err);