1. 05 1月, 2009 1 次提交
  2. 31 12月, 2008 2 次提交
  3. 26 12月, 2008 1 次提交
  4. 25 12月, 2008 1 次提交
    • F
      tracing/ftrace: don't trace on early stage of a secondary cpu boot, v3 · 0ca59dd9
      Frederic Weisbecker 提交于
      Impact: fix a crash/hard-reboot on certain configs while enabling cpu runtime
      
      On some archs, the boot of a secondary cpu can have an early fragile state.
      On x86-64, the pda is not initialized on the first stage of a cpu boot but
      it is needed to get the cpu number and the current task pointer. This data
      is needed during tracing. As they were dereferenced at this stage, we got a
      crash while tracing a cpu being enabled at runtime.
      
      Some other archs like ia64 can have such kind of issue too.
      
      Changes on v2:
      
      We dropped the previous solution of a per-arch called function to guess the
      current state of a cpu. That could slow down the tracing.
      
      This patch removes the -pg flag on arch/x86/kernel/cpu/common.c where
      the low level cpu boot functions exist, on start_secondary() and a helper
      function used at this stage.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Acked-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      0ca59dd9
  5. 20 12月, 2008 1 次提交
  6. 19 12月, 2008 1 次提交
  7. 17 12月, 2008 5 次提交
  8. 13 12月, 2008 1 次提交
    • R
      cpumask: change cpumask_scnprintf, cpumask_parse_user, cpulist_parse, and... · 29c0177e
      Rusty Russell 提交于
      cpumask: change cpumask_scnprintf, cpumask_parse_user, cpulist_parse, and cpulist_scnprintf to take pointers.
      
      Impact: change calling convention of existing cpumask APIs
      
      Most cpumask functions started with cpus_: these have been replaced by
      cpumask_ ones which take struct cpumask pointers as expected.
      
      These four functions don't have good replacement names; fortunately
      they're rarely used, so we just change them over.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: NMike Travis <travis@sgi.com>
      Acked-by: NIngo Molnar <mingo@elte.hu>
      Cc: paulus@samba.org
      Cc: mingo@redhat.com
      Cc: tony.luck@intel.com
      Cc: ralf@linux-mips.org
      Cc: Greg Kroah-Hartman <gregkh@suse.de>
      Cc: cl@linux-foundation.org
      Cc: srostedt@redhat.com
      29c0177e
  9. 12 12月, 2008 1 次提交
  10. 30 11月, 2008 1 次提交
  11. 26 11月, 2008 2 次提交
    • A
      tracing: add "power-tracer": C/P state tracer to help power optimization · f3f47a67
      Arjan van de Ven 提交于
      Impact: new "power-tracer" ftrace plugin
      
      This patch adds a C/P-state ftrace plugin that will generate
      detailed statistics about the C/P-states that are being used,
      so that we can look at detailed decisions that the C/P-state
      code is making, rather than the too high level "average"
      that we have today.
      
      An example way of using this is:
      
       mount -t debugfs none /sys/kernel/debug
       echo cstate > /sys/kernel/debug/tracing/current_tracer
       echo 1 > /sys/kernel/debug/tracing/tracing_enabled
       sleep 1
       echo 0 > /sys/kernel/debug/tracing/tracing_enabled
       cat /sys/kernel/debug/tracing/trace | perl scripts/trace/cstate.pl > out.svg
      Signed-off-by: NArjan van de Ven <arjan@linux.intel.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      f3f47a67
    • A
      [CPUFREQ] powernow-k8: ignore out-of-range PstateStatus value · a266d9f1
      Andreas Herrmann 提交于
      A workaround for AMD CPU family 11h erratum 311 might cause that the
      P-state Status Register shows a "current P-state" which is larger than
      the "current P-state limit" in P-state Current Limit Register. For the
      wrong P-state value there is no ACPI _PSS object defined and
      powernow-k8/cpufreq can't determine the proper CPU frequency for that
      state.
      
      As a consequence this can cause a panic during boot (potentially with
      all recent kernel versions -- at least I have reproduced it with
      various 2.6.27 kernels and with the current .28 series), as an
      example:
      
      powernow-k8: Found 1 AMD Turion(tm)X2 Ultra DualCore Mobile ZM-82 processors (2 \
      )
      powernow-k8:    0 : pstate 0 (2200 MHz)
      powernow-k8:    1 : pstate 1 (1100 MHz)
      powernow-k8:    2 : pstate 2 (600 MHz)
      BUG: unable to handle kernel paging request at ffff88086e7528b8
      IP: [<ffffffff80486361>] cpufreq_stats_update+0x4a/0x5f
      PGD 202063 PUD 0
      Oops: 0002 [#1] SMP
      last sysfs file:
      CPU 1
      Modules linked in:
      Pid: 1, comm: swapper Not tainted 2.6.28-rc3-dirty #16
      RIP: 0010:[<ffffffff80486361>]  [<ffffffff80486361>] cpufreq_stats_update+0x4a/0\
      f
      Synaptics claims to have extended capabilities, but I'm not able to read them.<6\
      6
      RAX: 0000000000000000 RBX: 0000000000000001 RCX: ffff88006e7528c0
      RDX: 00000000ffffffff RSI: ffff88006e54af00 RDI: ffffffff808f056c
      RBP: 00000000fffee697 R08: 0000000000000003 R09: ffff88006e73f080
      R10: 0000000000000001 R11: 00000000002191c0 R12: ffff88006fb83c10
      R13: 00000000ffffffff R14: 0000000000000001 R15: 0000000000000000
      FS:  0000000000000000(0000) GS:ffff88006fb50740(0000) knlGS:0000000000000000
      Unable to initialize Synaptics hardware.
      CS:  0010 DS: 0018 ES: 0018 CR0: 000000008005003b
      CR2: ffff88086e7528b8 CR3: 0000000000201000 CR4: 00000000000006e0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      Process swapper (pid: 1, threadinfo ffff88006fb82000, task ffff88006fb816d0)
      Stack:
       ffff88006e74da50 0000000000000000 ffff88006e54af00 ffffffff804863c7
       ffff88006e74da50 0000000000000000 00000000ffffffff 0000000000000000
       ffff88006fb83c10 ffffffff8024b46c ffffffff808f0560 ffff88006fb83c10
      Call Trace:
       [<ffffffff804863c7>] ? cpufreq_stat_notifier_trans+0x51/0x83
       [<ffffffff8024b46c>] ? notifier_call_chain+0x29/0x4c
       [<ffffffff8024b561>] ? __srcu_notifier_call_chain+0x46/0x61
       [<ffffffff8048496d>] ? cpufreq_notify_transition+0x93/0xa9
       [<ffffffff8021ab8d>] ? powernowk8_target+0x1e8/0x5f3
       [<ffffffff80486687>] ? cpufreq_governor_performance+0x1b/0x20
       [<ffffffff80484886>] ? __cpufreq_governor+0x71/0xa8
       [<ffffffff80484b21>] ? __cpufreq_set_policy+0x101/0x13e
       [<ffffffff80485bcd>] ? cpufreq_add_dev+0x3f0/0x4cd
       [<ffffffff8048577a>] ? handle_update+0x0/0x8
       [<ffffffff803c2062>] ? sysdev_driver_register+0xb6/0x10d
       [<ffffffff8056592c>] ? powernowk8_init+0x0/0x7e
       [<ffffffff8048604c>] ? cpufreq_register_driver+0x8f/0x140
       [<ffffffff80209056>] ? _stext+0x56/0x14f
       [<ffffffff802c2234>] ? proc_register+0x122/0x17d
       [<ffffffff802c23a0>] ? create_proc_entry+0x73/0x8a
       [<ffffffff8025c259>] ? register_irq_proc+0x92/0xaa
       [<ffffffff8025c2c8>] ? init_irq_proc+0x57/0x69
       [<ffffffff807fc85f>] ? kernel_init+0x116/0x169
       [<ffffffff8020cc79>] ? child_rip+0xa/0x11
       [<ffffffff807fc749>] ? kernel_init+0x0/0x169
       [<ffffffff8020cc6f>] ? child_rip+0x0/0x11
      Code: 05 c5 83 36 00 48 c7 c2 48 5d 86 80 48 8b 04 d8 48 8b 40 08 48 8b 34 02 48\
      
      RIP  [<ffffffff80486361>] cpufreq_stats_update+0x4a/0x5f
       RSP <ffff88006fb83b20>
      CR2: ffff88086e7528b8
      ---[ end trace 0678bac75e67a2f7 ]---
      Kernel panic - not syncing: Attempted to kill init!
      
      In short, aftereffect of the wrong P-state is that
      cpufreq_stats_update() uses "-1" as index for some array in
      
      cpufreq_stats_update (unsigned int cpu)
      {
      ...
           if (stat->time_in_state)
                      stat->time_in_state[stat->last_index] =
                              cputime64_add(stat->time_in_state[stat->last_index],
                                            cputime_sub(cur_time, stat->last_time));
      ...
      }
      
      Fortunately, the wrong P-state value is returned only if the core is
      in P-state 0. This fix solves the problem by detecting the
      out-of-range P-state, ignoring it, and using "0" instead.
      
      Cc: Mark Langsdorf <mark.langsdorf@amd.com>
      Signed-off-by: NAndreas Herrmann <andreas.herrmann3@amd.com>
      Signed-off-by: NDave Jones <davej@redhat.com>
      a266d9f1
  12. 23 11月, 2008 2 次提交
    • H
      x86: hypervisor - fix sparse warnings · 4e42ebd5
      Hannes Eder 提交于
      Impact: fix sparse build warning
      
      Fix the following sparse warnings:
      
        arch/x86/kernel/cpu/hypervisor.c:37:15: warning: symbol
        'get_hypervisor_tsc_freq' was not declared. Should it be static?
        arch/x86/kernel/cpu/hypervisor.c:53:16: warning: symbol
        'init_hypervisor' was not declared. Should it be static?
      Signed-off-by: NHannes Eder <hannes@hanneseder.net>
      Cc: "Alok N Kataria" <akataria@vmware.com>
      Cc: "Dan Hecht" <dhecht@vmware.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      4e42ebd5
    • H
      x86: vmware - fix sparse warnings · c450d780
      Hannes Eder 提交于
      Impact: fix sparse build warning
      
      Fix the following sparse warnings:
      
      arch/x86/kernel/cpu/vmware.c:69:5: warning: symbol 'vmware_platform'
      was not declared. Should it be static?
      arch/x86/kernel/cpu/vmware.c:89:15: warning: symbol
      'vmware_get_tsc_khz' was not declared. Should it be static?
      arch/x86/kernel/cpu/vmware.c:107:16: warning: symbol
      'vmware_set_feature_bits' was not declared. Should it be static?
      Signed-off-by: NHannes Eder <hannes@hanneseder.net>
      Cc: "Alok N Kataria" <akataria@vmware.com>
      Cc: "Dan Hecht" <dhecht@vmware.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      c450d780
  13. 10 11月, 2008 1 次提交
  14. 05 11月, 2008 1 次提交
    • A
      x86: vmware: look for DMI string in the product serial key · fd8cd7e1
      Alok Kataria 提交于
      Impact: Should permit VMware detection on older platforms where the
      vendor is changed.  Could theoretically cause a regression if some
      weird serial number scheme contains the string "VMware" by pure
      chance.  Seems unlikely, especially with the mixed case.
      
      In some user configured cases, VMware may choose not to put a VMware specific
      DMI string, but the product serial key is always there and is VMware specific.
      Add a interface to check the serial key, when checking for VMware in the DMI
      information.
      Signed-off-by: NAlok N Kataria <akataria@vmware.com>
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      fd8cd7e1
  15. 04 11月, 2008 1 次提交
    • A
      x86: VMware: Fix vmware_get_tsc code · 6bdbfe99
      Alok Kataria 提交于
      Impact: Fix possible failure to calibrate the TSC on Vmware near 4 GHz
      
      The current version of the code to get the tsc frequency from
      the VMware hypervisor, will be broken on processor with frequency
      (4G-1) HZ, because on such processors eax will have UINT_MAX
      and that would be legitimate.
      We instead check that EBX did change to decide if we were able to
      read the frequency from the hypervisor.
      Signed-off-by: NAlok N Kataria <akataria@vmware.com>
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      6bdbfe99
  16. 02 11月, 2008 2 次提交
    • A
      x86: Add a synthetic TSC_RELIABLE feature bit. · eca0cd02
      Alok Kataria 提交于
      Impact: Changes timebase calibration on Vmware.
      
      Use the synthetic TSC_RELIABLE bit to workaround virtualization anomalies.
      
      Virtual TSCs can be kept nearly in sync, but because the virtual TSC
      offset is set by software, it's not perfect.  So, the TSC
      synchronization test can fail. Even then the TSC can be used as a
      clocksource since the VMware platform exports a reliable TSC to the
      guest for timekeeping purposes. Use this bit to check if we need to
      skip the TSC sync checks.
      
      Along with this also set the CONSTANT_TSC bit when on VMware, since we
      still want to use TSC as clocksource on VM running over hardware which
      has unsynchronized TSC's (opteron's), since the hypervisor will take
      care of providing consistent TSC to the guest.
      Signed-off-by: NAlok N Kataria <akataria@vmware.com>
      Signed-off-by: NDan Hecht <dhecht@vmware.com>
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      eca0cd02
    • A
      x86: Hypervisor detection and get tsc_freq from hypervisor · 88b094fb
      Alok Kataria 提交于
      Impact: Changes timebase calibration on Vmware.
      
      v3->v2 : Abstract the hypervisor detection and feature (tsc_freq) request
      	 behind a hypervisor.c file
      v2->v1 : Add a x86_hyper_vendor field to the cpuinfo_x86 structure.
      	 This avoids multiple calls to the hypervisor detection function.
      
      This patch adds function to detect if we are running under VMware.
      The current way to check if we are on VMware is following,
      #  check if "hypervisor present bit" is set, if so read the 0x40000000
         cpuid leaf and check for "VMwareVMware" signature.
      #  if the above fails, check the DMI vendors name for "VMware" string
         if we find one we query the VMware hypervisor port to check if we are
         under VMware.
      
      The DMI + "VMware hypervisor port check" is needed for older VMware products,
      which don't implement the hypervisor signature cpuid leaf.
      Also note that since we are checking for the DMI signature the hypervisor
      port should never be accessed on native hardware.
      
      This patch also adds a hypervisor_get_tsc_freq function, instead of
      calibrating the frequency which can be error prone in virtualized
      environment, we ask the hypervisor for it. We get the frequency from
      the hypervisor by accessing the hypervisor port if we are running on VMware.
      Other hypervisors too can add code to the generic routine to get frequency on
      their platform.
      Signed-off-by: NAlok N Kataria <akataria@vmware.com>
      Signed-off-by: NDan Hecht <dhecht@vmware.com>
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      88b094fb
  17. 31 10月, 2008 5 次提交
  18. 28 10月, 2008 1 次提交
  19. 23 10月, 2008 1 次提交
  20. 22 10月, 2008 1 次提交
    • L
      x86/proc: fix /proc/cpuinfo cpu offline bug · bc8bcc79
      Lai Jiangshan 提交于
      Impact: fix missing CPUs in /proc/cpuinfo after CPU hotunplug/hotreplug
      
      In my test, I found that if a cpu has been offline,
      the next cpus may not be shown in the /proc/cpuinfo.
      
      if one read() cannot consume the whole /proc/cpuinfo,
      c_start() will be called again in the next read() calls.
      And *pos has been increased by 1 by the caller(seq_read()).
      if this time the cpu#*pos is offline, c_start() will return
      NULL, and the next cpus can not be shown.
      
      this fix use next_cpu_nr(*pos - 1, cpu_online_map) to
      search the next unshown cpu.
      
      the most easy way to reproduce this bug:
      1) offline cpu#1             (cpu#0 is online)
      2) dd ibs=2 if=/proc/cpuinfo
         the result is that only cpu#0 is shown.
         cpu#2 and cpu#3 .... cannot be shown in /proc/cpuinfo
         it's bug.
      Signed-off-by: NLai Jiangshan <laijs@cn.fujitsu.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      bc8bcc79
  21. 21 10月, 2008 2 次提交
  22. 16 10月, 2008 1 次提交
  23. 14 10月, 2008 1 次提交
    • I
      ftrace: mark lapic_wd_event() notrace · 8b1fa1d7
      Ingo Molnar 提交于
      it can be called in the NMI path:
      
      [    0.645999] calling  ftrace_dynamic_init+0x0/0xd6
      [    0.647521] ------------[ cut here ]------------
      [    0.647521] WARNING: at kernel/trace/ftrace.c:348 ftrace_record_ip+0x4e/0x252()
      [    0.647521] Modules linked in:
      [    0.647521] Pid: 15, comm: kstop1 Not tainted 2.6.27-rc1-tip #22686
      [    0.647521]
      [    0.647521] Call Trace:
      [    0.647521]  <NMI>  [<ffffffff8024593f>] warn_on_slowpath+0x5d/0x84
      [    0.647521]  [<ffffffff80220b99>] ? lapic_wd_event+0xb/0x5c
      [    0.647521]  [<ffffffff80287b3b>] ftrace_record_ip+0x4e/0x252
      [    0.647521]  [<ffffffff80211274>] mcount_call+0x5/0x31
      [    0.647521]  [<ffffffff80220b9e>] ? lapic_wd_event+0x10/0x5c
      [    0.647521]  [<ffffffff8083f3ec>] nmi_watchdog_tick+0x19d/0x1ad
      [    0.647521]  [<ffffffff8083e875>] default_do_nmi+0x75/0x1e3
      [    0.647521]  [<ffffffff8083f0b3>] do_nmi+0x5d/0x94
      [    0.647521]  [<ffffffff8083e2d2>] nmi+0xa2/0xc2
      [    0.647521]  [<ffffffff802b48c3>] ? check_bytes_and_report+0x11/0xcc
      [    0.647521]  <<EOE>>  [<ffffffff80211274>] ? mcount_call+0x5/0x31
      [    0.647521]  [<ffffffff802b49df>] check_object+0x61/0x1b0
      [    0.647521]  [<ffffffff802b502a>] __slab_free+0x169/0x2ae
      [    0.647521]  [<ffffffff80242dbf>] ? __cleanup_sighand+0x25/0x27
      [    0.647521]  [<ffffffff80242dbf>] ? __cleanup_sighand+0x25/0x27
      [    0.647521]  [<ffffffff802b60cd>] kmem_cache_free+0x85/0xb9
      [    0.647521]  [<ffffffff80242dbf>] __cleanup_sighand+0x25/0x27
      [    0.647521]  [<ffffffff80247b3d>] release_task+0x256/0x339
      [    0.647521]  [<ffffffff802490b4>] do_exit+0x764/0x7ef
      [    0.647521]  [<ffffffff8027624c>] __xchg+0x0/0x38
      [    0.647521]  [<ffffffff8027619a>] ? stop_cpu+0x0/0xb2
      [    0.647521]  [<ffffffff8027619a>] ? stop_cpu+0x0/0xb2
      [    0.647521]  [<ffffffff8025922f>] kthread+0x4e/0x7b
      [    0.647521]  [<ffffffff80212979>] child_rip+0xa/0x11
      [    0.647521]  [<ffffffff80211c17>] ? restore_args+0x0/0x30
      [    0.647521]  [<ffffffff802283a5>] ? native_load_tls+0x14/0x2e
      [    0.647521]  [<ffffffff802591e1>] ? kthread+0x0/0x7b
      [    0.647521]  [<ffffffff8021296f>] ? child_rip+0x0/0x11
      [    0.647521]
      [    0.647521] ---[ end trace 4eaa2a86a8e2da22 ]---
      [    0.672032] initcall ftrace_dynamic_init+0x0/0xd6 returned 0 after 19 msecs
      
      also mark it no-kprobes while at it.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      8b1fa1d7
  24. 13 10月, 2008 3 次提交
  25. 11 10月, 2008 1 次提交