1. 30 1月, 2008 7 次提交
    • M
      x86: fall back on interrupt disable in cmpxchg8b on 80386 and 80486 · 2c0b8a75
      Mathieu Desnoyers 提交于
      Actually, on 386, cmpxchg and cmpxchg_local fall back on
      cmpxchg_386_u8/16/32: it disables interruptions around non atomic
      updates to mimic the cmpxchg behavior.
      
      The comment:
      /* Poor man's cmpxchg for 386. Unsuitable for SMP */
      
      already present in cmpxchg_386_u32 tells much about how this cmpxchg
      implementation should not be used in a SMP context. However, the cmpxchg_local
      can perfectly use this fallback, since it only needs to be atomic wrt the local
      cpu.
      
      This patch adds a cmpxchg_486_u64 and uses it as a fallback for cmpxchg64
      and cmpxchg64_local on 80386 and 80486.
      
      Q:
      but why is it called cmpxchg_486 when the other functions are called
      
      A:
      Because the standard cmpxchg is missing only on 386, but cmpxchg8b is
      missing both on 386 and 486.
      
      Citing Intel's Instruction set reference:
      
      cmpxchg:
      This instruction is not supported on Intel processors earlier than the
      Intel486 processors.
      
      cmpxchg8b:
      This instruction encoding is not supported on Intel processors earlier
      than the Pentium processors.
      
      Q:
      What's the reason to have cmpxchg64_local on 32 bit architectures?
      Without that need all this would just be a few simple defines.
      
      A:
      cmpxchg64_local on 32 bits architectures takes unsigned long long
      parameters, but cmpxchg_local only takes longs. Since we have cmpxchg8b
      to execute a 8 byte cmpxchg atomically on pentium and +, it makes sense
      to provide a flavor of cmpxchg and cmpxchg_local using this instruction.
      
      Also, for 32 bits architectures lacking the 64 bits atomic cmpxchg, it
      makes sense _not_ to define cmpxchg64 while cmpxchg could still be
      available.
      
      Moreover, the fallback for cmpxchg8b on i386 for 386 and 486 is a
      
      However, cmpxchg64_local will be emulated by disabling interrupts on all
      architectures where it is not supported atomically.
      
      Therefore, we *could* turn cmpxchg64_local into a cmpxchg_local, but it
      would make the 386/486 fallbacks ugly, make its design different from
      cmpxchg/cmpxchg64 (which really depends on atomic operations and cannot
      be emulated) and require the __cmpxchg_local to be expressed as a macro
      rather than an inline function so the parameters would not be fixed to
      unsigned long long in every case.
      
      So I think cmpxchg64_local makes sense there, but I am open to
      suggestions.
      
      Q:
      Are there any callers?
      
      A:
      I am actually using it in LTTng in my timestamping code. I use it to
      work around CPUs with asynchronous TSCs. I need to update 64 bits
      values atomically on this 32 bits architecture.
      
      Changelog:
      - Ran though checkpatch.
      Signed-off-by: NMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Cc: Andi Kleen <ak@suse.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      2c0b8a75
    • R
      x86: extended interrupt LVT support for AMD Barcelona · 7b83dae7
      Robert Richter 提交于
      Also macro definitions in apicdef.h has been updated.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      7b83dae7
    • D
      x86: use CR0 defines. · 7ebad705
      Dave Jones 提交于
      Signed-off-by: NDave Jones <davej@redhat.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      7ebad705
    • P
      x86: mtrr use type bool [RESEND AGAIN] · 2d2ee8de
      Paul Jimenez 提交于
      This is a janitorish patch to 1) remove private TRUE/FALSE #def's in
      favor of using the standard enum from linux/stddef.h and 2) switch the
      variables holding those values to type 'bool' (from linux/types.h)
      since it both seems more appropriate and allows for potentially better
      optimization.
      
      As a truly minor aside, I removed a couple of comments documenting
      a 'do_safe' parameter that seems to no longer exist.
      Signed-off-by: NPaul Jimenez <pj@place.org>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      2d2ee8de
    • A
      x86 mce_64.c: make struct mcelog static · 231fd906
      Adrian Bunk 提交于
      This patch makes the needlessly global struct mcelog static.
      Signed-off-by: NAdrian Bunk <bunk@kernel.org>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      231fd906
    • T
      x86: nuke a ton of unused exports · 3abf024d
      Thomas Gleixner 提交于
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      3abf024d
    • G
      kobj: fix threshold_init_device/kobject_uevent_env oops · 213eca7f
      Greg KH 提交于
      the logic in this function is just crazy.  It's recursive, but we
      can circumvent the creation for the kobject and whole creation of the
      threshold_block if some conditions are met.  That's why we see the
      allocate_threshold_blocks so many times in the callstack, yet only a few
      kobjects created.
      
      Then we blow up in kobject_uevent_env() on the first debug printk.
      Which means that we are just passing in garbage.
      
      Man, this is one time that comments in code would have been very nice to
      have, and why forward goto's into major code blocks are just evil...
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      213eca7f
  2. 26 1月, 2008 1 次提交
    • G
      cpu-hotplug: replace lock_cpu_hotplug() with get_online_cpus() · 86ef5c9a
      Gautham R Shenoy 提交于
      Replace all lock_cpu_hotplug/unlock_cpu_hotplug from the kernel and use
      get_online_cpus and put_online_cpus instead as it highlights the
      refcount semantics in these operations.
      
      The new API guarantees protection against the cpu-hotplug operation, but
      it doesn't guarantee serialized access to any of the local data
      structures. Hence the changes needs to be reviewed.
      
      In case of pseries_add_processor/pseries_remove_processor, use
      cpu_maps_update_begin()/cpu_maps_update_done() as we're modifying the
      cpu_present_map there.
      Signed-off-by: NGautham R Shenoy <ego@in.ibm.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      86ef5c9a
  3. 25 1月, 2008 5 次提交
  4. 21 12月, 2007 1 次提交
  5. 05 12月, 2007 1 次提交
  6. 17 11月, 2007 2 次提交
    • A
      x86: show cpuinfo only for online CPUs · c0c52d28
      Andreas Herrmann 提交于
      Fix regressions introduced with 92cb7612.
      
      It can happen that cpuinfo is displayed for CPUs that are not online or
      even worse for CPUs not present at all. As an example, following was
      shown for a "second" CPU of a single core K8 variant:
      
          processor       : 0
          vendor_id       : unknown
          cpu family      : 0
          model           : 0
          model name      : unknown
          stepping        : 0
          cache size      : 0 KB
          fpu             : yes
          fpu_exception   : yes
          cpuid level     : 0
          wp              : yes
          flags           :
          bogomips        : 0.00
          clflush size    : 0
          cache_alignment : 0
          address sizes   : 0 bits physical, 0 bits virtual
          power management:
      Signed-off-by: NAndreas Herrmann <andreas.herrmann3@amd.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      c0c52d28
    • A
      x86: fix cpu-hotplug regression · 90367556
      Andreas Herrmann 提交于
      Commit d435d862
      ("cpu hotplug: mce: fix cpu hotplug error handling")
      changed the error handling in mce_cpu_callback.
      
      In cases where not all CPUs are brought up during
      boot (e.g. using maxcpus and additional_cpus parameters)
      mce_cpu_callback now returns NOTFIY_BAD because
      for such CPUs cpu_data is not completely filled when
      the notifier is called. Thus mce_create_device fails right
      at its beginning:
      
              if (!mce_available(&cpu_data[cpu]))
                      return -EIO;
      
      As a quick fix I suggest to check boot_cpu_data for MCE.
      
      To reproduce this regression:
      
      (1) boot with maxcpus=2 addtional_cpus=2 on a 4 CPU x86-64 system
      (2) # echo 1 >/sys/devices/system/cpu/cpu2/online
        -bash: echo: write error: Invalid argument
      
      dmesg shows:
      
      _cpu_up: attempt to bring up CPU 2 failed
      Signed-off-by: NAndreas Herrmann <andreas.herrmann3@amd.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      90367556
  7. 15 11月, 2007 1 次提交
    • A
      x86: don't call mce_create_device on CPU_UP_PREPARE · bae19fe0
      Andreas Herrmann 提交于
      Fix regression introduced with d435d862
      ("cpu hotplug: mce: fix cpu hotplug error handling").
      
      A CPU which was not brought up during boot (using maxcpus and
      additional_cpus parameters) couldn't be onlined anymore.  For such a CPU it
      seemed that MCE was not supported during CPU_UP_PREPARE-time which caused
      mce_cpu_callback to return NOTIFY_BAD to notifier_call_chain.  To fix this
      we:
      
       - call mce_create_device for CPU_ONLINE event (instead of CPU_UP_PREPARE),
       - avoid mce_remove_device() for the CPU that is not correctly initialized
         by mce_create_device() failure,
       - make mce_cpu_callback always return NOTIFY_OK for CPU_ONLINE event.
         Because CPU_ONLINE callback return value is always ignored.
      
      [akinobu.mita@gmail.com: avoid mce_remove_device() for not initialized device]
      [akinobu.mita@gmail.com: make mce_cpu_callback always return NOTIFY_OK]
      Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
      Signed-off-by: NAndreas Herrmann <andreas.herrmann3@amd.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@elte.hu>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      bae19fe0
  8. 13 11月, 2007 1 次提交
  9. 10 11月, 2007 1 次提交
  10. 30 10月, 2007 1 次提交
  11. 24 10月, 2007 4 次提交
  12. 23 10月, 2007 1 次提交
  13. 20 10月, 2007 7 次提交
  14. 19 10月, 2007 2 次提交
  15. 18 10月, 2007 5 次提交