1. 03 10月, 2012 2 次提交
  2. 30 9月, 2012 3 次提交
  3. 28 9月, 2012 7 次提交
    • T
      x86: Distinguish TLB shootdown interrupts from other functions call interrupts · fd0f5869
      Tomoki Sekiyama 提交于
      As TLB shootdown requests to other CPU cores are now using function call
      interrupts, TLB shootdowns entry in /proc/interrupts is always shown as 0.
      
      This behavior change was introduced by commit 52aec330 ("x86/tlb:
      replace INVALIDATE_TLB_VECTOR by CALL_FUNCTION_VECTOR").
      
      This patch reverts TLB shootdowns entry in /proc/interrupts to count TLB
      shootdowns separately from the other function call interrupts.
      Signed-off-by: NTomoki Sekiyama <tomoki.sekiyama.qu@hitachi.com>
      Link: http://lkml.kernel.org/r/20120926021128.22212.20440.stgit@hpxwAcked-by: NAlex Shi <alex.shi@intel.com>
      Signed-off-by: NH. Peter Anvin <hpa@linux.intel.com>
      fd0f5869
    • G
      um: Preinclude include/linux/kern_levels.h · 9429ec96
      Geert Uytterhoeven 提交于
      The userspace part of UML uses the asm-offsets.h generator mechanism to
      create definitions for UM_KERN_<LEVEL> that match the in-kernel
      KERN_<LEVEL> constant definitions.
      
      As of commit 04d2c8c8 ("printk: convert
      the format for KERN_<LEVEL> to a 2 byte pattern"), KERN_<LEVEL> is no
      longer expanded to the literal '"<LEVEL>"', but to '"\001" "LEVEL"', i.e.
      it contains two parts.
      
      However, the combo of DEFINE_STR() in
      arch/x86/um/shared/sysdep/kernel-offsets.h and sed-y in Kbuild doesn't
      support string literals consisting of multiple parts. Hence for all
      UM_KERN_<LEVEL> definitions, only the SOH character is retained in the actual
      definition, while the remainder ends up in the comment. E.g. in
      include/generated/asm-offsets.h we get
      
          #define UM_KERN_INFO "\001" /* "6" KERN_INFO */
      
      instead of
      
          #define UM_KERN_INFO "\001" "6" /* KERN_INFO */
      
      This causes spurious '^A' output in some kernel messages:
      
          Calibrating delay loop... 4640.76 BogoMIPS (lpj=23203840)
          pid_max: default: 32768 minimum: 301
          Mount-cache hash table entries: 256
          ^AChecking that host ptys support output SIGIO...Yes
          ^AChecking that host ptys support SIGIO on close...No, enabling workaround
          ^AUsing 2.6 host AIO
          NET: Registered protocol family 16
          bio: create slab <bio-0> at 0
          Switching to clocksource itimer
      
      To fix this:
        - Move the mapping from UM_KERN_<LEVEL> to KERN_<LEVEL> from
          arch/um/include/shared/common-offsets.h to
          arch/um/include/shared/user.h, which is preincluded for all userspace
          parts,
        - Preinclude include/linux/kern_levels.h for all userspace parts, to
          obtain the in-kernel KERN_<LEVEL> constant definitions. This doesn't
          violate the kernel/userspace separation, as include/linux/kern_levels.h
          is self-contained and doesn't expose any other kernel internals.
        - Remove the now unused STR() and DEFINE_STR() macros.
      Signed-off-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      9429ec96
    • R
      um: Fix IPC on um · bbb35efc
      Richard Weinberger 提交于
      commit c1d7e01d (ipc: use Kconfig options for __ARCH_WANT_[COMPAT_]IPC_PARSE_VERSION)
      forgot UML and broke IPC on it.
      Also UML has to select ARCH_WANT_IPC_PARSE_VERSION usin Kconfig.
      
      Reported-and-tested-by: <Toralf Förster toralf.foerster@gmx.de>
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      bbb35efc
    • N
      x86/mce: Provide boot argument to honour bios-set CMCI threshold · 450cc201
      Naveen N. Rao 提交于
      The ACPI spec doesn't provide for a way for the bios to pass down
      recommended thresholds to the OS on a _per-bank_ basis. This patch adds
      a new boot option, which if passed, tells Linux to use CMCI thresholds
      set by the bios.
      
      As fail-safe, we initialize threshold to 1 if some banks have not been
      initialized by the bios and warn the user.
      Signed-off-by: NNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
      Signed-off-by: NTony Luck <tony.luck@intel.com>
      450cc201
    • H
      x86, smep, smap: Make the switching functions one-way · b2cc2a07
      H. Peter Anvin 提交于
      There is no fundamental reason why we should switch SMEP and SMAP on
      during early cpu initialization just to switch them off again.  Now
      with %eflags and %cr4 forced to be initialized to a clean state, we
      only need the one-way enable.  Also, make the functions inline to make
      them (somewhat) harder to abuse.
      
      This does mean that SMEP and SMAP do not get initialized anywhere near
      as early.  Even using early_param() instead of __setup() doesn't give
      us control early enough to do this during the early cpu initialization
      phase.  This seems reasonable to me, because SMEP and SMAP should not
      matter until we have userspace to protect ourselves from, but it does
      potentially make it possible for a bug involving a "leak of
      permissions to userspace" to get uncaught.
      Signed-off-by: NH. Peter Anvin <hpa@linux.intel.com>
      b2cc2a07
    • A
      um: kill thread->forking · d2ce4e92
      Al Viro 提交于
      we only use that to tell copy_thread() done by syscall from that
      done by kernel_thread().  However, it's easier to do simply by
      checking PF_KTHREAD in thread flags.
      
      Merge sys_clone() guts for 32bit and 64bit, while we are at it...
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      d2ce4e92
    • A
      um: let signal_delivered() do SIGTRAP on singlestepping into handler · f9a38eac
      Al Viro 提交于
      ... rather than duplicating that in sigframe setup code (and doing that
      inconsistently, at that)
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      f9a38eac
  4. 27 9月, 2012 3 次提交
  5. 26 9月, 2012 10 次提交
  6. 25 9月, 2012 1 次提交
    • F
      cputime: Make finegrained irqtime accounting generally available · fdf9c356
      Frederic Weisbecker 提交于
      There is no known reason for this option to be unavailable on other
      archs than x86. They just need to call enable_sched_clock_irqtime()
      if they have a sufficiently finegrained clock to make it working.
      
      Move it to the general option and let the user choose between
      it and pure tick based or virtual cputime accounting.
      
      Note that virtual cputime accounting already performs a finegrained
      irqtime accounting. CONFIG_IRQ_TIME_ACCOUNTING is a kind of middle ground
      between tick and virtual based accounting. So CONFIG_IRQ_TIME_ACCOUNTING
      and CONFIG_VIRT_CPU_ACCOUNTING are mutually exclusive choices.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      fdf9c356
  7. 24 9月, 2012 1 次提交
    • K
      xen/boot: Disable NUMA for PV guests. · 8d54db79
      Konrad Rzeszutek Wilk 提交于
      The hypervisor is in charge of allocating the proper "NUMA" memory
      and dealing with the CPU scheduler to keep them bound to the proper
      NUMA node. The PV guests (and PVHVM) have no inkling of where they
      run and do not need to know that right now. In the future we will
      need to inject NUMA configuration data (if a guest spans two or more
      NUMA nodes) so that the kernel can make the right choices. But those
      patches are not yet present.
      
      In the meantime, disable the NUMA capability in the PV guest, which
      also fixes a bootup issue. Andre says:
      
      "we see Dom0 crashes due to the kernel detecting the NUMA topology not
      by ACPI, but directly from the northbridge (CONFIG_AMD_NUMA).
      
      This will detect the actual NUMA config of the physical machine, but
      will crash about the mismatch with Dom0's virtual memory. Variation of
      the theme: Dom0 sees what it's not supposed to see.
      
      This happens with the said config option enabled and on a machine where
      this scanning is still enabled (K8 and Fam10h, not Bulldozer class)
      
      We have this dump then:
      NUMA: Warning: node ids are out of bound, from=-1 to=-1 distance=10
      Scanning NUMA topology in Northbridge 24
      Number of physical nodes 4
      Node 0 MemBase 0000000000000000 Limit 0000000040000000
      Node 1 MemBase 0000000040000000 Limit 0000000138000000
      Node 2 MemBase 0000000138000000 Limit 00000001f8000000
      Node 3 MemBase 00000001f8000000 Limit 0000000238000000
      Initmem setup node 0 0000000000000000-0000000040000000
        NODE_DATA [000000003ffd9000 - 000000003fffffff]
      Initmem setup node 1 0000000040000000-0000000138000000
        NODE_DATA [0000000137fd9000 - 0000000137ffffff]
      Initmem setup node 2 0000000138000000-00000001f8000000
        NODE_DATA [00000001f095e000 - 00000001f0984fff]
      Initmem setup node 3 00000001f8000000-0000000238000000
      Cannot find 159744 bytes in node 3
      BUG: unable to handle kernel NULL pointer dereference at (null)
      IP: [<ffffffff81d220e6>] __alloc_bootmem_node+0x43/0x96
      Pid: 0, comm: swapper Not tainted 3.3.6 #1 AMD Dinar/Dinar
      RIP: e030:[<ffffffff81d220e6>]  [<ffffffff81d220e6>] __alloc_bootmem_node+0x43/0x96
      .. snip..
        [<ffffffff81d23024>] sparse_early_usemaps_alloc_node+0x64/0x178
        [<ffffffff81d23348>] sparse_init+0xe4/0x25a
        [<ffffffff81d16840>] paging_init+0x13/0x22
        [<ffffffff81d07fbb>] setup_arch+0x9c6/0xa9b
        [<ffffffff81683954>] ? printk+0x3c/0x3e
        [<ffffffff81d01a38>] start_kernel+0xe5/0x468
        [<ffffffff81d012cf>] x86_64_start_reservations+0xba/0xc1
        [<ffffffff81007153>] ? xen_setup_runstate_info+0x2c/0x36
        [<ffffffff81d050ee>] xen_start_kernel+0x565/0x56c
      "
      
      so we just disable NUMA scanning by setting numa_off=1.
      
      CC: stable@vger.kernel.org
      Reported-and-Tested-by: NAndre Przywara <andre.przywara@amd.com>
      Acked-by: NAndre Przywara <andre.przywara@amd.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      8d54db79
  8. 23 9月, 2012 2 次提交
    • S
      Use get_online_cpus to avoid races involving CPU hotplug · 429227bb
      Silas Boyd-Wickizer 提交于
      If arch/x86/kernel/cpuid.c is a module, a CPU might offline or online
      between the for_each_online_cpu() loop and the call to
      register_hotcpu_notifier in cpuid_init or the call to
      unregister_hotcpu_notifier in cpuid_exit.  The potential races can
      lead to leaks/duplicates, attempts to destroy non-existant devices, or
      random pointer dereferences.
      
      For example, in cpuid_exit if:
      
              for_each_online_cpu(cpu)
                      cpuid_device_destroy(cpu);
              class_destroy(cpuid_class);
              __unregister_chrdev(CPUID_MAJOR, 0, NR_CPUS, "cpu/cpuid");
              <----- CPU onlines
              unregister_hotcpu_notifier(&cpuid_class_cpu_notifier);
      
      the hotcpu notifier will attempt to create a device for the
      cpuid_class, which the module already destroyed.
      
      This fix surrounds for_each_online_cpu and register_hotcpu_notifier or
      unregister_hotcpu_notifier with get_online_cpus+put_online_cpus.
      
      Tested on a VM.
      Signed-off-by: NSilas Boyd-Wickizer <sbw@mit.edu>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      429227bb
    • S
      Use get_online_cpus to avoid races involving CPU hotplug · a2db672a
      Silas Boyd-Wickizer 提交于
      If arch/x86/kernel/msr.c is a module, a CPU might offline or online
      between the for_each_online_cpu(i) loop and the call to
      register_hotcpu_notifier in msr_init or the call to
      unregister_hotcpu_notifier in msr_exit. The potential races can lead
      to leaks/duplicates, attempts to destroy non-existant devices, or
      random pointer dereferences.
      
      For example, in msr_init if:
      
              for_each_online_cpu(i) {
                      err = msr_device_create(i);
                      if (err != 0)
                              goto out_class;
              }
              <----- CPU offlines
              register_hotcpu_notifier(&msr_class_cpu_notifier);
      
      and the CPU never onlines before msr_exit, then the module will never
      call msr_device_destroy for the associated CPU.
      
      This fix surrounds for_each_online_cpu and register_hotcpu_notifier or
      unregister_hotcpu_notifier with get_online_cpus+put_online_cpus.
      
      Tested on a VM.
      Signed-off-by: NSilas Boyd-Wickizer <sbw@mit.edu>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      a2db672a
  9. 22 9月, 2012 11 次提交