1. 18 10月, 2007 1 次提交
  2. 15 10月, 2007 1 次提交
    • T
      x86: force timer broadcast on late AMD C1E detection · 89039b37
      Thomas Gleixner 提交于
      The 64bit SMP bootup is slightly different to the 32bit one. It enables
      the boot CPU local APIC timer before all CPUs are brought up. Some AMD C1E
      systems have the C1E feature flag only set in the secondary CPU. Due to
      the early enable of the boot CPU local APIC timer the APIC timer is
      registered as a fully functional device. When we detect the wreckage during
      the bringup of the secondary CPU, we need to force the boot CPU into
      broadcast mode. 
      
      Check the C1E caused APIC timer disable, when the secondary APIC timer is
      initialized. If the boot CPU APIC timer was registered as a functional
      clock event device, then fix this up and utilize the
      CLOCK_EVT_NOTIFY_BROADCAST_FORCE mechanism to force the already
      registered boot CPU APIC timer into broadcast mode.
      
      Tested by force injecting the failure mode.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      89039b37
  3. 13 10月, 2007 12 次提交
  4. 11 10月, 2007 2 次提交
  5. 12 8月, 2007 1 次提交
    • R
      x86_64: fix HPET init race · b291aa7a
      Robin Holt 提交于
      I have had four seperate system lockups attributable to this exact problem
      in two days of testing.  Instead of trying to handle all the weird end
      cases and wrap, how about changing it to look for exactly what we appear
      to want.
      
      The following patch removes a couple races in setup_APIC_timer.  One occurs
      when the HPET advances the COUNTER past the T0_CMP value between the time
      the T0_CMP was originally read and when COUNTER is read.  This results in
      a delay waiting for the counter to wrap.  The other results from the counter
      wrapping.
      
      This change takes a snapshot of T0_CMP at the beginning of the loop and
      simply loops until T0_CMP has changed (a tick has happened).
      
      <later>
      
      I have one small concern about the patch.  I am not sure it meets the intent
      as well as it should.  I think we are trying to match APIC timer interrupts up
      with the hpet counter increment.  The event which appears to be disturbing
      this loop in our test environment is the NMI watchdog.  What we believe has
      been happening with the existing code is the setup_APIC_timer loop has read
      the CMP value, and the NMI watchdog code fires for the first time.  This
      results in a series of icache miss slowdowns and by the time we get back to
      things it has wrapped.
      
      I think this code is trying to get the CMP as close to the counter value as
      possible.  If that is the intent, maybe we should really be testing against a
      "window" around the CMP.  Something like COUNTER = CMP+/2.  It appears COUNTER
      should get advanced every 89nSec (IIRC).  The above seems like an unreasonably
      small window, but may be necessary.  Without documentation, I am not sure of
      the original intent with this code.
      
      In summary, this code fixes my boot hangs, but since I am not certain of the
      intent of the existing code, I am not certain this has not introduced new bugs
      or unexpected behaviors.
      Signed-off-by: NRobin Holt <holt@sgi.com>
      Acked-by: NAndi Kleen <ak@suse.de>
      Cc: Vojtech Pavlik <vojtech@suse.cz>
      Cc: "Aaron Durbin" <adurbin@google.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b291aa7a
  6. 22 7月, 2007 2 次提交
  7. 09 5月, 2007 1 次提交
  8. 03 5月, 2007 3 次提交
    • D
      [PATCH] x86-64: Avoid overflows during apic timer calibration · 4637a74c
      David P. Reed 提交于
      - Use 64bit TSC calculations to avoid handling overflow
      - Use 32bit unsigned arithmetic for the APIC timer. This
      way overflows are handled correctly.
      - Fix exit check of loop to account for apic timer counting down
      
      Signed-off-by: dpreed@reed.com
      Signed-off-by: NAndi Kleen <ak@suse.de>
      4637a74c
    • F
      [PATCH] x86-64: safe_apic_wait_icr_idle - x86_64 · 8339e9fb
      Fernando Luis VazquezCao 提交于
      apic_wait_icr_idle looks like this:
      
      static __inline__ void apic_wait_icr_idle(void)
      {
        while (apic_read(APIC_ICR) & APIC_ICR_BUSY)
          cpu_relax();
      }
      
      The busy loop in this function would not be problematic if the
      corresponding status bit in the ICR were always updated, but that does
      not seem to be the case under certain crash scenarios. Kdump uses an IPI
      to stop the other CPUs in the event of a crash, but when any of the
      other CPUs are locked-up inside the NMI handler the CPU that sends the
      IPI will end up looping forever in the ICR check, effectively
      hard-locking the whole system.
      
      Quoting from Intel's "MultiProcessor Specification" (Version 1.4), B-3:
      
      "A local APIC unit indicates successful dispatch of an IPI by
      resetting the Delivery Status bit in the Interrupt Command
      Register (ICR). The operating system polls the delivery status
      bit after sending an INIT or STARTUP IPI until the command has
      been dispatched.
      
      A period of 20 microseconds should be sufficient for IPI dispatch
      to complete under normal operating conditions. If the IPI is not
      successfully dispatched, the operating system can abort the
      command. Alternatively, the operating system can retry the IPI by
      writing the lower 32-bit double word of the ICR. This “time-out”
      mechanism can be implemented through an external interrupt, if
      interrupts are enabled on the processor, or through execution of
      an instruction or time-stamp counter spin loop."
      
      Intel's documentation suggests the implementation of a time-out
      mechanism, which, by the way, is already being open-coded in some parts
      of the kernel that tinker with ICR.
      
      Create a apic_wait_icr_idle replacement that implements the time-out
      mechanism and that can be used to solve the aforementioned problem.
      
      AK: moved both functions out of line
      AK: Added improved loop from Keith Owens
      Signed-off-by: NFernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      8339e9fb
    • J
      [PATCH] x86-64: fix cpu MHz reporting on constant_tsc cpus · 6b37f5a2
      Joerg Roedel 提交于
      This patch fixes the reporting of cpu_mhz in /proc/cpuinfo on CPUs with
      a constant TSC rate and a kernel with disabled cpufreq.
      Signed-off-by: NMark Langsdorf <mark.langsdorf@amd.com>
      Signed-off-by: NJoerg Roedel <joerg.roedel@amd.com>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      
       arch/x86_64/kernel/apic.c     |    2 -
       arch/x86_64/kernel/time.c     |   58 +++++++++++++++++++++++++++++++++++++++---
       arch/x86_64/kernel/tsc.c      |   12 +++++---
       arch/x86_64/kernel/tsc_sync.c |    2 -
       include/asm-x86_64/proto.h    |    1
       5 files changed, 65 insertions(+), 10 deletions(-)
      6b37f5a2
  9. 24 3月, 2007 2 次提交
  10. 17 2月, 2007 2 次提交
  11. 07 12月, 2006 3 次提交
  12. 07 10月, 2006 1 次提交
  13. 05 10月, 2006 1 次提交
    • D
      IRQ: Maintain regs pointer globally rather than passing to IRQ handlers · 7d12e780
      David Howells 提交于
      Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
      of passing regs around manually through all ~1800 interrupt handlers in the
      Linux kernel.
      
      The regs pointer is used in few places, but it potentially costs both stack
      space and code to pass it around.  On the FRV arch, removing the regs parameter
      from all the genirq function results in a 20% speed up of the IRQ exit path
      (ie: from leaving timer_interrupt() to leaving do_IRQ()).
      
      Where appropriate, an arch may override the generic storage facility and do
      something different with the variable.  On FRV, for instance, the address is
      maintained in GR28 at all times inside the kernel as part of general exception
      handling.
      
      Having looked over the code, it appears that the parameter may be handed down
      through up to twenty or so layers of functions.  Consider a USB character
      device attached to a USB hub, attached to a USB controller that posts its
      interrupts through a cascaded auxiliary interrupt controller.  A character
      device driver may want to pass regs to the sysrq handler through the input
      layer which adds another few layers of parameter passing.
      
      I've build this code with allyesconfig for x86_64 and i386.  I've runtested the
      main part of the code on FRV and i386, though I can't test most of the drivers.
      I've also done partial conversion for powerpc and MIPS - these at least compile
      with minimal configurations.
      
      This will affect all archs.  Mostly the changes should be relatively easy.
      Take do_IRQ(), store the regs pointer at the beginning, saving the old one:
      
      	struct pt_regs *old_regs = set_irq_regs(regs);
      
      And put the old one back at the end:
      
      	set_irq_regs(old_regs);
      
      Don't pass regs through to generic_handle_irq() or __do_IRQ().
      
      In timer_interrupt(), this sort of change will be necessary:
      
      	-	update_process_times(user_mode(regs));
      	-	profile_tick(CPU_PROFILING, regs);
      	+	update_process_times(user_mode(get_irq_regs()));
      	+	profile_tick(CPU_PROFILING);
      
      I'd like to move update_process_times()'s use of get_irq_regs() into itself,
      except that i386, alone of the archs, uses something other than user_mode().
      
      Some notes on the interrupt handling in the drivers:
      
       (*) input_dev() is now gone entirely.  The regs pointer is no longer stored in
           the input_dev struct.
      
       (*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking.  It does
           something different depending on whether it's been supplied with a regs
           pointer or not.
      
       (*) Various IRQ handler function pointers have been moved to type
           irq_handler_t.
      Signed-Off-By: NDavid Howells <dhowells@redhat.com>
      (cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
      7d12e780
  14. 03 10月, 2006 1 次提交
  15. 26 9月, 2006 7 次提交