1. 08 7月, 2011 1 次提交
  2. 07 7月, 2011 2 次提交
    • M
      x86: Don't use the EFI reboot method by default · f70e957c
      Matthew Garrett 提交于
      Testing suggests that at least some Lenovos and some Intels will
      fail to reboot via EFI, attempting to jump to an unmapped
      physical address. In the long run we could handle this by
      providing a page table with a 1:1 mapping of physical addresses,
      but for now it's probably just easier to assume that ACPI or
      legacy methods will be present and reboot via those.
      Signed-off-by: NMatthew Garrett <mjg@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Alan Cox <alan@linux.intel.com>
      Link: http://lkml.kernel.org/r/1309985557-15350-1-git-send-email-mjg@redhat.comSigned-off-by: NIngo Molnar <mingo@elte.hu>
      f70e957c
    • K
      x86, suspend: Restore MISC_ENABLE MSR in realmode wakeup · 7a313666
      Kees Cook 提交于
      Some BIOSes will reset the Intel MISC_ENABLE MSR (specifically the
      XD_DISABLE bit) when resuming from S3, which can interact poorly with
      ebba638a. In 32bit PAE mode, this can
      lead to a fault when EFER is restored by the kernel wakeup routines,
      due to it setting the NX bit for a CPU that (thanks to the BIOS reset)
      now incorrectly thinks it lacks the NX feature. (64bit is not affected
      because it uses a common CPU bring-up that specifically handles the
      XD_DISABLE bit.)
      
      The need for MISC_ENABLE being restored so early is specific to the S3
      resume path. Normally, MISC_ENABLE is saved in save_processor_state(),
      but this happens after the resume header is created, so just reproduce
      the logic here. (acpi_suspend_lowlevel() creates the header, calls
      do_suspend_lowlevel, which calls save_processor_state(), so the saved
      processor context isn't available during resume header creation.)
      
      [ hpa: Consider for stable if OK in mainline ]
      Signed-off-by: NKees Cook <kees.cook@canonical.com>
      Link: http://lkml.kernel.org/r/20110707011034.GA8523@outflux.netSigned-off-by: NH. Peter Anvin <hpa@zytor.com>
      Cc: Rafael J. Wysocki <rjw@sisk.pl>
      Cc: <stable@kernel.org> 2.6.38+
      7a313666
  3. 06 7月, 2011 1 次提交
  4. 01 7月, 2011 1 次提交
    • T
      x86-32, NUMA: Fix boot regression caused by NUMA init unification on highmem machines · a26474e8
      Tejun Heo 提交于
      During 32/64 NUMA init unification, commit 797390d8 ("x86-32,
      NUMA: use sparse_memory_present_with_active_regions()") made
      32bit mm init call memory_present() automatically from
      active_regions instead of leaving it to each NUMA init path.
      
      This commit description is inaccurate - memory_present() calls
      aren't the same for flat and numaq.  After the commit,
      memory_present() is only called for the intersection of e820 and
      NUMA layout.  Before, on flatmem, memory_present() would be
      called from 0 to max_pfn.  After, it would be called only on the
      areas that e820 indicates to be populated.
      
      This is how x86_64 works and should be okay as memmap is allowed
      to contain holes; however, x86_32 DISCONTIGMEM is missing
      early_pfn_valid(), which makes memmap_init_zone() assume that
      memmap doesn't contain any hole.  This leads to the following
      oops if e820 map contains holes as it often does on machine with
      near or more 4GiB of memory by calling pfn_to_page() on a pfn
      which isn't mapped to a NUMA node, a reported by Conny Seidel:
      
        BUG: unable to handle kernel paging request at 000012b0
        IP: [<c1aa13ce>] memmap_init_zone+0x6c/0xf2
        *pdpt =3D 0000000000000000 *pde =3D f000eef3f000ee00
        Oops: 0000 [#1] SMP
        last sysfs file:
        Modules linked in:
      
        Pid: 0, comm: swapper Not tainted 2.6.39-rc5-00164-g797390d8 #1 To Be Filled By O.E.M. To Be Filled By O.E.M./E350M1
        EIP: 0060:[<c1aa13ce>] EFLAGS: 00010012 CPU: 0
        EIP is at memmap_init_zone+0x6c/0xf2
        EAX: 00000000 EBX: 000a8000 ECX: 000a7fff EDX: f2c00b80
        ESI: 000a8000 EDI: f2c00800 EBP: c19ffe54 ESP: c19ffe34
         DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
        Process swapper (pid: 0, ti=3Dc19fe000 task=3Dc1a07f60 task.ti=3Dc19fe000)
        Stack:
         00000002 00000000 0023f000 00000000 10000000 00000a00 f2c00000 f2c00b58
         c19ffeb0 c1a80f24 000375fe 00000000 f2c00800 00000800 00000100 00000030
         c1abb768 0000003c 00000000 00000000 00000004 00207a02 f2c00800 000375fe
        Call Trace:
         [<c1a80f24>] free_area_init_node+0x358/0x385
         [<c1a81384>] free_area_init_nodes+0x420/0x487
         [<c1a79326>] paging_init+0x114/0x11b
         [<c1a6cb13>] setup_arch+0xb37/0xc0a
         [<c1a69554>] start_kernel+0x76/0x316
         [<c1a690a8>] i386_start_kernel+0xa8/0xb0
      
      This patch fixes the bug by defining early_pfn_valid() to be the
      same as pfn_valid() when DISCONTIGMEM.
      Reported-bisected-and-tested-by: NConny Seidel <conny.seidel@amd.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: hans.rosenfeld@amd.com
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Conny Seidel <conny.seidel@amd.com>
      Link: http://lkml.kernel.org/r/20110628094107.GB3386@htj.dyndns.orgSigned-off-by: NIngo Molnar <mingo@elte.hu>
      a26474e8
  5. 30 6月, 2011 2 次提交
    • K
      xen/pci: Use the INT_SRC_OVR IRQ (instead of GSI) to preset the ACPI SCI IRQ. · 155a16f2
      Konrad Rzeszutek Wilk 提交于
      In the past we would use the GSI value to preset the ACPI SCI
      IRQ which worked great as GSI == IRQ:
      
      ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 low level)
      
      While that is most often seen, there are some oddities:
      
      ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 20 low level)
      
      which means that GSI 20 (or pin 20) is to be overriden for IRQ 9.
      Our code that presets the interrupt for ACPI SCI however would
      use the GSI 20 instead of IRQ 9 ending up with:
      
      xen: sci override: global_irq=20 trigger=0 polarity=1
      xen: registering gsi 20 triggering 0 polarity 1
      xen: --> pirq=20 -> irq=20
      xen: acpi sci 20
      .. snip..
      calling  acpi_init+0x0/0xbc @ 1
      ACPI: SCI (IRQ9) allocation failed
      ACPI Exception: AE_NOT_ACQUIRED, Unable to install System Control Interrupt handler (20110413/evevent-119)
      ACPI: Unable to start the ACPI Interpreter
      
      as the ACPI interpreter made a call to 'acpi_gsi_to_irq' which got nine.
      It used that value to request an IRQ (request_irq) and since that was not
      present it failed.
      
      The fix is to recognize that for interrupts that are overriden (in our
      case we only care about the ACPI SCI) we should use the IRQ number
      to present the IRQ instead of the using GSI. End result is that we get:
      
      xen: sci override: global_irq=20 trigger=0 polarity=1
      xen: registering gsi 20 triggering 0 polarity 1
      xen: --> pirq=20 -> irq=9 (gsi=9)
      xen: acpi sci 9
      
      which fixes the ACPI interpreter failing on startup.
      
      CC: stable@kernel.org
      Reported-by: NLiwei <xieliwei@gmail.com>
      Tested-by: NLiwei <xieliwei@gmail.com>
      [http://lists.xensource.com/archives/html/xen-devel/2011-06/msg01727.html]
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      155a16f2
    • K
      xen/mmu: Fix for linker errors when CONFIG_SMP is not defined. · 32dd1194
      Konrad Rzeszutek Wilk 提交于
      Simple enough - we use an extern defined symbol which is not
      defined when CONFIG_SMP is not defined. This fixes the linker
      dying.
      
      CC: stable@kernel.org
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      32dd1194
  6. 29 6月, 2011 1 次提交
  7. 28 6月, 2011 2 次提交
    • J
      watchdog: Intel SCU Watchdog: Fix build and remove duplicate code · e376fd66
      Jesper Juhl 提交于
      Trying to build the Intel SCU Watchdog fails for me with gcc 4.6.0 -
      $ gcc --version | head -n 1
      gcc (GCC) 4.6.0 20110513 (prerelease)
      
      like this :
        CC      drivers/watchdog/intel_scu_watchdog.o
      In file included from drivers/watchdog/intel_scu_watchdog.c:49:0:
      /home/jj/src/linux-2.6/arch/x86/include/asm/apb_timer.h: In function ‘apbt_time_init’:
      /home/jj/src/linux-2.6/arch/x86/include/asm/apb_timer.h:65:42: warning: ‘return’ with a value, in function returning void [enabled by default]
      drivers/watchdog/intel_scu_watchdog.c: In function ‘intel_scu_watchdog_init’:
      drivers/watchdog/intel_scu_watchdog.c:468:2: error: implicit declaration of function ‘sfi_get_mtmr’ [-Werror=implicit-function-declaration]
      drivers/watchdog/intel_scu_watchdog.c:468:32: warning: assignment makes pointer from integer without a cast [enabled by default]
      cc1: some warnings being treated as errors
      
      make[1]: *** [drivers/watchdog/intel_scu_watchdog.o] Error 1
      make: *** [drivers/watchdog/intel_scu_watchdog.o] Error 2
      
      Additionally, linux/types.h is needlessly being included twice in 
      drivers/watchdog/intel_scu_watchdog.c
      Signed-off-by: NJesper Juhl <jj@chaosbits.net>
      Signed-off-by: NWim Van Sebroeck <wim@iguana.be>
      e376fd66
    • K
      Fix node_start/end_pfn() definition for mm/page_cgroup.c · c6830c22
      KAMEZAWA Hiroyuki 提交于
      commit 21a3c964 uses node_start/end_pfn(nid) for detection start/end
      of nodes. But, it's not defined in linux/mmzone.h but defined in
      /arch/???/include/mmzone.h which is included only under
      CONFIG_NEED_MULTIPLE_NODES=y.
      
      Then, we see
        mm/page_cgroup.c: In function 'page_cgroup_init':
        mm/page_cgroup.c:308: error: implicit declaration of function 'node_start_pfn'
        mm/page_cgroup.c:309: error: implicit declaration of function 'node_end_pfn'
      
      So, fixiing page_cgroup.c is an idea...
      
      But node_start_pfn()/node_end_pfn() is a very generic macro and
      should be implemented in the same manner for all archs.
      (m32r has different implementation...)
      
      This patch removes definitions of node_start/end_pfn() in each archs
      and defines a unified one in linux/mmzone.h. It's not under
      CONFIG_NEED_MULTIPLE_NODES, now.
      
      A result of macro expansion is here (mm/page_cgroup.c)
      
      for !NUMA
       start_pfn = ((&contig_page_data)->node_start_pfn);
        end_pfn = ({ pg_data_t *__pgdat = (&contig_page_data); __pgdat->node_start_pfn + __pgdat->node_spanned_pages;});
      
      for NUMA (x86-64)
        start_pfn = ((node_data[nid])->node_start_pfn);
        end_pfn = ({ pg_data_t *__pgdat = (node_data[nid]); __pgdat->node_start_pfn + __pgdat->node_spanned_pages;});
      
      Changelog:
       - fixed to avoid using "nid" twice in node_end_pfn() macro.
      Reported-and-acked-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Reported-and-tested-by: NIngo Molnar <mingo@elte.hu>
      Acked-by: NMel Gorman <mgorman@suse.de>
      Signed-off-by: NKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c6830c22
  8. 20 6月, 2011 5 次提交
  9. 19 6月, 2011 1 次提交
  10. 17 6月, 2011 1 次提交
    • K
      xen/setup: Fix for incorrect xen_extra_mem_start. · acd049c6
      Konrad Rzeszutek Wilk 提交于
      The earlier attempts (24bdb0b6)
      at fixing this problem caused other problems to surface (PV guests
      with no PCI passthrough would have SWIOTLB turned on - which meant
      64MB of precious contingous DMA32 memory being eaten up per guest).
      The problem was: "on xen we add an extra memory region at the end of
      the e820, and on this particular machine this extra memory region
      would start below 4g and cross over the 4g boundary:
      
      [0xfee01000-0x192655000)
      
      Unfortunately e820_end_of_low_ram_pfn does not expect an
      e820 layout like that so it returns 4g, therefore initial_memory_mapping
      will map [0 - 0x100000000), that is a memory range that includes some
      reserved memory regions."
      
      The memory range was the IOAPIC regions, and with the 1-1 mapping
      turned on, it would map them as RAM, not as MMIO regions. This caused
      the hypervisor to complain. Fortunately this is experienced only under
      the initial domain so we guard for it.
      Acked-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      acd049c6
  11. 16 6月, 2011 2 次提交
  12. 15 6月, 2011 2 次提交
  13. 14 6月, 2011 1 次提交
  14. 10 6月, 2011 2 次提交
    • J
      treewide: Convert uses of struct resource to resource_size(ptr) · 28f65c11
      Joe Perches 提交于
      Several fixes as well where the +1 was missing.
      
      Done via coccinelle scripts like:
      
      @@
      struct resource *ptr;
      @@
      
      - ptr->end - ptr->start + 1
      + resource_size(ptr)
      
      and some grep and typing.
      
      Mostly uncompiled, no cross-compilers.
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      28f65c11
    • M
      exec: delay address limit change until point of no return · dac853ae
      Mathias Krause 提交于
      Unconditionally changing the address limit to USER_DS and not restoring
      it to its old value in the error path is wrong because it prevents us
      using kernel memory on repeated calls to this function.  This, in fact,
      breaks the fallback of hard coded paths to the init program from being
      ever successful if the first candidate fails to load.
      
      With this patch applied switching to USER_DS is delayed until the point
      of no return is reached which makes it possible to have a multi-arch
      rootfs with one arch specific init binary for each of the (hard coded)
      probed paths.
      
      Since the address limit is already set to USER_DS when start_thread()
      will be invoked, this redundancy can be safely removed.
      Signed-off-by: NMathias Krause <minipli@googlemail.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: stable@kernel.org
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      dac853ae
  15. 09 6月, 2011 2 次提交
  16. 08 6月, 2011 1 次提交
    • T
      x86: cpu-hotplug: Prevent softirq wakeup on wrong CPU · fd8a7de1
      Thomas Gleixner 提交于
      After a newly plugged CPU sets the cpu_online bit it enables
      interrupts and goes idle. The cpu which brought up the new cpu waits
      for the cpu_online bit and when it observes it, it sets the cpu_active
      bit for this cpu. The cpu_active bit is the relevant one for the
      scheduler to consider the cpu as a viable target.
      
      With forced threaded interrupt handlers which imply forced threaded
      softirqs we observed the following race:
      
      cpu 0                         cpu 1
      
      bringup(cpu1);
                                    set_cpu_online(smp_processor_id(), true);
      		              local_irq_enable();
      while (!cpu_online(cpu1));
                                    timer_interrupt()
                                      -> wake_up(softirq_thread_cpu1);
                                           -> enqueue_on(softirq_thread_cpu1, cpu0);
      
                                                                              ^^^^
      
      cpu_notify(CPU_ONLINE, cpu1);
        -> sched_cpu_active(cpu1)
           -> set_cpu_active((cpu1, true);
      
      When an interrupt happens before the cpu_active bit is set by the cpu
      which brought up the newly onlined cpu, then the scheduler refuses to
      enqueue the woken thread which is bound to that newly onlined cpu on
      that newly onlined cpu due to the not yet set cpu_active bit and
      selects a fallback runqueue. Not really an expected and desirable
      behaviour.
      
      So far this has only been observed with forced hard/softirq threading,
      but in theory this could happen without forced threaded hard/softirqs
      as well. It's probably unobservable as it would take a massive
      interrupt storm on the newly onlined cpu which causes the softirq loop
      to wake up the softirq thread and an even longer delay of the cpu
      which waits for the cpu_online bit.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: NPeter Zijlstra <peterz@infradead.org>
      Cc: stable@kernel.org # 2.6.39
      fd8a7de1
  17. 07 6月, 2011 1 次提交
    • J
      x86/amd-iommu: Fix boot crash with hidden PCI devices · 26018874
      Joerg Roedel 提交于
      Some PCIe cards ship with a PCI-PCIe bridge which is not
      visible as a PCI device in Linux. But the device-id of the
      bridge is present in the IOMMU tables which causes a boot
      crash in the IOMMU driver.
      This patch fixes by removing these cards from the IOMMU
      handling. This is a pure -stable fix, a real fix to handle
      this situation appriatly will follow for the next merge
      window.
      
      Cc: stable@kernel.org	# > 2.6.32
      Signed-off-by: NJoerg Roedel <joerg.roedel@amd.com>
      26018874
  18. 06 6月, 2011 3 次提交
  19. 04 6月, 2011 1 次提交
  20. 02 6月, 2011 1 次提交
    • M
      x86/PCI/ACPI: fix type mismatch · 6e33a852
      Márton Németh 提交于
      The flags field of struct resource from linux/ioport.h is "unsigned
      long". Change the "type" parameter of coalesce_windows() function to
      match that field. This fixes the following warning messages when
      compiling with "make C=1 W=1 bzImage modules":
      
      arch/x86/pci/acpi.c: In function ‘coalesce_windows’:
      arch/x86/pci/acpi.c:198: warning: conversion to ‘long unsigned int’ from ‘int’ may change the sign of the result
      arch/x86/pci/acpi.c:203: warning: conversion to ‘long unsigned int’ from ‘int’ may change the sign of the result
      Signed-off-by: NMárton Németh <nm127@freemail.hu>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      6e33a852
  21. 30 5月, 2011 4 次提交
  22. 29 5月, 2011 3 次提交
    • L
      x86 idle: deprecate mwait_idle() and "idle=mwait" cmdline param · 5d4c47e0
      Len Brown 提交于
      mwait_idle() is a C1-only idle loop intended to be more efficient
      than HLT on SMP hardware that supports it.
      
      But mwait_idle() has been replaced by the more general
      mwait_idle_with_hints(), which handles both C1 and deeper C-states.
      ACPI uses only mwait_idle_with_hints(), and never uses mwait_idle().
      
      Deprecate mwait_idle() and the "idle=mwait" cmdline param
      to simplify the x86 idle code.
      
      After this change, kernels configured with
      (!CONFIG_ACPI=n && !CONFIG_INTEL_IDLE=n) when run on hardware
      that support MWAIT will simply use HLT.  If MWAIT is desired
      on those systems, cpuidle and the cpuidle drivers above
      can be used.
      
      cc: x86@kernel.org
      cc: stable@kernel.org # .39.x
      Signed-off-by: NLen Brown <len.brown@intel.com>
      5d4c47e0
    • L
      x86 idle: deprecate "no-hlt" cmdline param · cdaab4a0
      Len Brown 提交于
      We'd rather that modern machines not check if HLT works on
      every entry into idle, for the benefit of machines that had
      marginal electricals 15-years ago.  If those machines are still running
      the upstream kernel, they can use "idle=poll".  The only difference
      will be that they'll now invoke HLT in machine_hlt().
      
      cc: x86@kernel.org # .39.x
      Signed-off-by: NLen Brown <len.brown@intel.com>
      cdaab4a0
    • L
      x86 idle APM: deprecate CONFIG_APM_CPU_IDLE · 99c63221
      Len Brown 提交于
      We don't want to export the pm_idle function pointer to modules.
      Currently CONFIG_APM_CPU_IDLE w/ CONFIG_APM_MODULE forces us to.
      
      CONFIG_APM_CPU_IDLE is of dubious value, it runs only on 32-bit
      uniprocessor laptops that are over 10 years old.  It calls into
      the BIOS during idle, and is known to cause a number of machines
      to fail.
      
      Removing CONFIG_APM_CPU_IDLE and will allow us to stop exporting
      pm_idle.  Any systems that were calling into the APM BIOS
      at run-time will simply use HLT instead.
      
      cc: x86@kernel.org
      cc: Jiri Kosina <jkosina@suse.cz>
      cc: stable@kernel.org # .39.x
      Signed-off-by: NLen Brown <len.brown@intel.com>
      99c63221