1. 28 1月, 2011 1 次提交
    • T
      x86: Replace cpu_2_logical_apicid[] with early percpu variable · 4c321ff8
      Tejun Heo 提交于
      Unlike x86_64, on x86_32, the mapping from cpu to logical apicid
      may vary depending on apic in use.  cpu_2_logical_apicid[] array
      is used for this mapping.  Replace it with early percpu variable
      x86_cpu_to_logical_apicid to make it better aligned with other
      mappings.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: eric.dumazet@gmail.com
      Cc: yinghai@kernel.org
      Cc: brgerst@gmail.com
      Cc: gorcunov@gmail.com
      Cc: penberg@kernel.org
      Cc: shaohui.zheng@intel.com
      Cc: rientjes@google.com
      LKML-Reference: <1295789862-25482-5-git-send-email-tj@kernel.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      4c321ff8
  2. 10 1月, 2011 1 次提交
    • P
      x86, lapic-timer: Increase the max_delta to 31 bits · 4aed89d6
      Pierre Tardy 提交于
      Latest atom socs(penwell) does not have hpet timer.
      
      As their local APIC timer is clocked at 400KHZ, and the current
      code limit their Initial Counter register to 23 bits, they
      cannot sleep more than 1.34 seconds which leads to ~2 spurious
      wakeup per second (1 per thread)
      
      These SOCs support 32bit timer so we change the max_delta to at
      least 31bits. So we can at least sleep for 300 seconds.
      
      We could not find any previous chip errata where lapic would
      only have 23 bit precision As powertop is suggesting to activate
      HPET to "sleep longer", this could mean this problem is already
      known.
      
      Problem is here since very first implementation of lapic timer
      as a clock event e9e2cdb4 [PATCH] clockevents: i386 drivers.
      Signed-off-by: NSuresh Siddha <suresh.b.siddha@intel.com>
      Signed-off-by: NPierre Tardy <pierre.tardy@intel.com>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Arjan van de Ven <arjan@infradead.org>
      Cc: Adrian Bunk <bunk@stusta.de>
      Cc: H. Peter Anvin <hpa@linux.intel.com>
      Cc: john stultz <johnstul@us.ibm.com>
      Cc: Roman Zippel <zippel@linux-m68k.org>
      Cc: Andi Kleen <ak@suse.de>
      LKML-Reference: <1294327409-19426-1-git-send-email-pierre.tardy@intel.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      4aed89d6
  3. 07 1月, 2011 1 次提交
  4. 30 12月, 2010 1 次提交
  5. 24 12月, 2010 1 次提交
  6. 14 12月, 2010 1 次提交
  7. 10 12月, 2010 5 次提交
  8. 18 11月, 2010 1 次提交
    • D
      x86, nmi_watchdog: Remove all stub function calls from old nmi_watchdog · 072b198a
      Don Zickus 提交于
      Now that the bulk of the old nmi_watchdog is gone, remove all
      the stub variables and hooks associated with it.
      
      This touches lots of files mainly because of how the io_apic
      nmi_watchdog was implemented.  Now that the io_apic nmi_watchdog
      is forever gone, remove all its fingers.
      
      Most of this code was not being exercised by virtue of
      nmi_watchdog != NMI_IO_APIC, so there shouldn't be anything to
      risky here.
      Signed-off-by: NDon Zickus <dzickus@redhat.com>
      Cc: fweisbec@gmail.com
      Cc: gorcunov@openvz.org
      LKML-Reference: <1289578944-28564-3-git-send-email-dzickus@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      072b198a
  9. 10 11月, 2010 1 次提交
  10. 26 10月, 2010 1 次提交
  11. 23 10月, 2010 1 次提交
    • T
      x86: Allow platforms to force enable apic · 5a7ae78f
      Thomas Gleixner 提交于
      Some embedded x86 platforms don't setup the APIC in the
      BIOS/bootloader and would be forced to add "lapic" on the kernel
      command line. That's a bit akward.
      
      Split out the force enable code from detect_init_APIC() and allow
      platform code to call it from the platform setup. That avoids the
      command line parameter and possible replication of the MSR dance in
      the force enable code.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      LKML-Reference: <1287510389-8388-1-git-send-email-dirk.brandewie@gmail.com>
      Signed-off-by: NDirk Brandewie <dirk.j.brandewie@intel.com>
      5a7ae78f
  12. 20 10月, 2010 2 次提交
    • R
      apic, x86: Use BIOS settings for IBS and MCE threshold interrupt LVT offsets · 27afdf20
      Robert Richter 提交于
      We want the BIOS to setup the EILVT APIC registers. The offsets
      were hardcoded and BIOS settings were overwritten by the OS.
      Now, the subsystems for MCE threshold and IBS determine the LVT
      offset from the registers the BIOS has setup. If the BIOS setup
      is buggy on a family 10h system, a workaround enables IBS. If
      the OS determines an invalid register setup, a "[Firmware Bug]:
      " error message is reported.
      
      We need this change also for upcomming cpu families.
      Signed-off-by: NRobert Richter <robert.richter@amd.com>
      LKML-Reference: <1286360874-1471-3-git-send-email-robert.richter@amd.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      27afdf20
    • R
      apic, x86: Check if EILVT APIC registers are available (AMD only) · a68c439b
      Robert Richter 提交于
      This patch implements checks for the availability of LVT entries
      (APIC500-530) and reserves it if used. The check becomes
      necessary since we want to let the BIOS provide the LVT offsets.
       The offsets should be determined by the subsystems using it
      like those for MCE threshold or IBS.  On K8 only offset 0
      (APIC500) and MCE interrupts are supported. Beginning with
      family 10h at least 4 offsets are available.
      
      Since offsets must be consistent for all cores, we keep track of
      the LVT offsets in software and reserve the offset for the same
      vector also to be used on other cores. An offset is freed by
      setting the entry to APIC_EILVT_MASKED.
      
      If the BIOS is right, there should be no conflicts. Otherwise a
      "[Firmware Bug]: ..." error message is generated. However, if
      software does not properly determines the offsets, it is not
      necessarily a BIOS bug.
      Signed-off-by: NRobert Richter <robert.richter@amd.com>
      LKML-Reference: <1286360874-1471-2-git-send-email-robert.richter@amd.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      a68c439b
  13. 16 9月, 2010 1 次提交
  14. 06 8月, 2010 1 次提交
    • E
      x86, apic: Map the local apic when parsing the MP table. · 5989cd6a
      Eric W. Biederman 提交于
      This fixes a regression in 2.6.35 from 2.6.34, that is
      present for select models of Intel cpus when people are
      using an MP table.
      
      The commit cf7500c0
      "x86, ioapic: In mpparse use mp_register_ioapic" started
      calling mp_register_ioapic from MP_ioapic_info.  An extremely
      simple change that was obviously correct.  Unfortunately
      mp_register_ioapic did just a little more than the previous
      hand crafted code and so we gained this call path.
      
      The problem call path is:
      MP_ioapic_info()
        mp_register_ioapic()
         io_apic_unique_id()
           io_apic_get_unique_id()
             get_physical_broadcast()
               modern_apic()
                 lapic_get_version()
                   apic_read(APIC_LVR)
      
      Which turned out to be a problem because the local apic
      was not mapped, at that point, unlike the similar point
      in the ACPI parsing code.
      
      This problem is fixed by mapping the local apic when
      parsing the mptable as soon as we reasonably can.
      
      Looking at the number of places we setup the fixmap for
      the local apic, I see some serious simplification opportunities.
      For the moment except for not duplicating the setting up of the
      fixmap in init_apic_mappings, I have not acted on them.
      
      The regression from 2.6.34 is tracked in bug
      https://bugzilla.kernel.org/show_bug.cgi?id=16173
      
      Cc: <stable@kernel.org> 2.6.35
      Reported-by: NDavid Hill <hilld@binarystorm.net>
      Reported-by: NTvrtko Ursulin <tvrtko.ursulin@sophos.com>
      Tested-by: NTvrtko Ursulin <tvrtko.ursulin@sophos.com>
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      LKML-Reference: <m1eiee86jg.fsf_-_@fess.ebiederm.org>
      Signed-off-by: NH. Peter Anvin <hpa@linux.intel.com>
      5989cd6a
  15. 17 7月, 2010 1 次提交
    • Y
      x86: Fix x2apic preenabled system with kexec · fd19dce7
      Yinghai Lu 提交于
      Found one x2apic system kexec loop test failed
      when CONFIG_NMI_WATCHDOG=y (old) or CONFIG_LOCKUP_DETECTOR=y (current tip)
      
      first kernel can kexec second kernel, but second kernel can not kexec third one.
      
      it can be duplicated on another system with BIOS preenabled x2apic.
      First kernel can not kexec second kernel.
      
      It turns out, when kernel boot with pre-enabled x2apic, it will not execute
      disable_local_APIC on shutdown path.
      
      when init_apic_mappings() is called in setup_arch, it will skip setting of
      apic_phys when x2apic_mode is set. ( x2apic_mode is much early check_x2apic())
      Then later, disable_local_APIC() will bail out early because !apic_phys.
      
      So check !x2apic_mode in x2apic_mode in disable_local_APIC with !apic_phys.
      
      another solution could be updating init_apic_mappings() to set apic_phys even
      for preenabled x2apic system. Actually even for x2apic system, that lapic
      address is mapped already in early stage.
      
      BTW: is there any x2apic preenabled system with apicid of boot cpu > 255?
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      LKML-Reference: <4C3EB22B.3000701@kernel.org>
      Acked-by: NSuresh Siddha <suresh.b.siddha@intel.com>
      Cc: stable@kernel.org
      Signed-off-by: NH. Peter Anvin <hpa@linux.intel.com>
      fd19dce7
  16. 17 6月, 2010 1 次提交
  17. 25 5月, 2010 1 次提交
    • K
      x86, apic: ack all pending irqs when crashed/on kexec · 8c3ba8d0
      Kerstin Jonsson 提交于
      When the SMP kernel decides to crash_kexec() the local APICs may have
      pending interrupts in their vector tables.
      
      The setup routine for the local APIC has a deficient mechanism for
      clearing these interrupts, it only handles interrupts that has already
      been dispatched to the local core for servicing (the ISR register) safely,
      it doesn't consider lower prioritized queued interrupts stored in the IRR
      register.
      
      If you have more than one pending interrupt within the same 32 bit word in
      the LAPIC vector table registers you may find yourself entering the IO
      APIC setup with pending interrupts left in the LAPIC.  This is a situation
      for wich the IO APIC setup is not prepared.  Depending of what/which
      interrupt vector/vectors are stuck in the APIC tables your system may show
      various degrees of malfunctioning.  That was the reason why the
      check_timer() failed in our system, the timer interrupts was blocked by
      pending interrupts from the old kernel when routed trough the IO APIC.
      
      Additional comment from Jiri Bohac:
      ==============
      If this should go into stable release,
      I'd add some kind of limit on the number of iterations, just to be safe from
      hard to debug lock-ups:
      
      +if (loops++  > MAX_LOOPS) {
      +        printk("LAPIC pending clean-up")
      +        break;
      +}
       while (queued);
      
      with MAX_LOOPS something like 1E9 this would leave plenty of time for the
      pending IRQs to be cleared and would and still cause at most a second of delay
      if the loop were to lock-up for whatever reason.
      
      [trenn@suse.de:
      
      V2: Use tsc if avail to bail out after 1 sec due to possible virtual
          apic_read calls which may take rather long (suggested by: Avi Kivity
          <avi@redhat.com>) If no tsc is available bail out quickly after
          cpu_khz, if we broke out too early and still have irqs pending (which
          should never happen?) we still get a WARN_ON...
      
      V3: - Fixed indentation -> checkpatch clean
          - max_loops must be signed
      
      V4: - Fix typo, mixed up tsc and ntsc in first rdtscll() call
      
      V5: Adjust WARN_ON() condition to also catch error in cpu_has_tsc case]
      
      Cc: <jbohac@novell.com>
      Cc: Yinghai Lu <yinghai@kernel.org>
      Cc: Kerstin Jonsson <kerstin.jonsson@ericsson.com>
      Cc: Avi Kivity <avi@redhat.com>
      Cc: Suresh Siddha <suresh.b.siddha@intel.com>
      Tested-by: NEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: NThomas Renninger <trenn@suse.de>
      LKML-Reference: <201005241913.o4OJDGWM010865@imap1.linux-foundation.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NH. Peter Anvin <hpa@linux.intel.com>
      8c3ba8d0
  18. 03 4月, 2010 1 次提交
    • S
      x86: Fix double enable_IR_x2apic() call on SMP kernel on !SMP boards · 472a474c
      Suresh Siddha 提交于
      Jan Grossmann reported kernel boot panic while booting SMP
      kernel on his system with a single core cpu. SMP kernels call
      enable_IR_x2apic() from native_smp_prepare_cpus() and on
      platforms where the kernel doesn't find SMP configuration we
      ended up again calling enable_IR_x2apic() from the
      APIC_init_uniprocessor() call in the smp_sanity_check(). Thus
      leading to kernel panic.
      
      Don't call enable_IR_x2apic() and default_setup_apic_routing()
      from APIC_init_uniprocessor() in CONFIG_SMP case.
      
      NOTE: this kind of non-idempotent and assymetric initialization
      sequence is rather fragile and unclean, we'll clean that up
      in v2.6.35. This is the minimal fix for v2.6.34.
      
      Reported-by: Jan.Grossmann@kielnet.net
      Signed-off-by: NSuresh Siddha <suresh.b.siddha@intel.com>
      Cc: <jbarnes@virtuousgeek.org>
      Cc: <david.woodhouse@intel.com>
      Cc: <weidong.han@intel.com>
      Cc: <youquan.song@intel.com>
      Cc: <Jan.Grossmann@kielnet.net>
      Cc: <stable@kernel.org> # [v2.6.32.x, v2.6.33.x]
      LKML-Reference: <1270083887.7835.78.camel@sbs-t61.sc.intel.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      472a474c
  19. 20 2月, 2010 1 次提交
  20. 10 2月, 2010 1 次提交
    • S
      x86, apic: Don't use logical-flat mode when CPU hotplug may exceed 8 CPUs · 681ee44d
      Suresh Siddha 提交于
      We need to fall back from logical-flat APIC mode to physical-flat mode
      when we have more than 8 CPUs.  However, in the presence of CPU
      hotplug(with bios listing not enabled but possible cpus as disabled cpus in
      MADT), we have to consider the number of possible CPUs rather than
      the number of current CPUs; otherwise we may cross the 8-CPU boundary
      when CPUs are added later.
      
      32bit apic code can use more cleanups (like the removal of vendor checks in
      32bit default_setup_apic_routing()) and more unifications with 64bit code.
      Yinghai has some patches in works already. This patch addresses the boot issue
      that is reported in the virtualization guest context.
      
      [ hpa: incorporated function annotation feedback from Yinghai Lu ]
      Signed-off-by: NSuresh Siddha <suresh.b.siddha@intel.com>
      LKML-Reference: <1265767304.2833.19.camel@sbs-t61.sc.intel.com>
      Acked-by: NShaohui Zheng <shaohui.zheng@intel.com>
      Reviewed-by: NYinghai Lu <yinghai@kernel.org>
      Cc: <stable@kernel.org>
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      681ee44d
  21. 08 2月, 2010 1 次提交
  22. 19 1月, 2010 1 次提交
  23. 12 1月, 2010 1 次提交
  24. 12 12月, 2009 1 次提交
  25. 23 11月, 2009 1 次提交
  26. 16 11月, 2009 1 次提交
  27. 27 10月, 2009 1 次提交
  28. 15 10月, 2009 1 次提交
    • C
      x86: apic: Allow noop operations to be called almost at any time · f88f2b4f
      Cyrill Gorcunov 提交于
      As only apic noop is used we allow to use almost any operation
      caller wants (and which of them noop driver supports of
      course).
      
      Initially it was reported by Ingo Molnar that apic noop
      issue a warning for pkg id (which is actually false positive
      and should be eliminated).
      
      So we save checking (and warning issue) for read/write
      operations while allow any other ops to be freely used.
      
      Also:
       - fix noop_cpu_to_logical_apicid, it should be 0.
       - rename noop_default_phys_pkg_id to noop_phys_pkg_id
         (we use default_ prefix for more general routines
          in apic subsystem).
      Reported-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NCyrill Gorcunov <gorcunov@openvz.org>
      Cc: Yinghai Lu <yinghai@kernel.org>
      Cc: Maciej W. Rozycki <macro@linux-mips.org>
      LKML-Reference: <20091015150416.GC5331@lenovo>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      f88f2b4f
  29. 14 10月, 2009 1 次提交
  30. 21 9月, 2009 2 次提交
    • I
      perf: Do the big rename: Performance Counters -> Performance Events · cdd6c482
      Ingo Molnar 提交于
      Bye-bye Performance Counters, welcome Performance Events!
      
      In the past few months the perfcounters subsystem has grown out its
      initial role of counting hardware events, and has become (and is
      becoming) a much broader generic event enumeration, reporting, logging,
      monitoring, analysis facility.
      
      Naming its core object 'perf_counter' and naming the subsystem
      'perfcounters' has become more and more of a misnomer. With pending
      code like hw-breakpoints support the 'counter' name is less and
      less appropriate.
      
      All in one, we've decided to rename the subsystem to 'performance
      events' and to propagate this rename through all fields, variables
      and API names. (in an ABI compatible fashion)
      
      The word 'event' is also a bit shorter than 'counter' - which makes
      it slightly more convenient to write/handle as well.
      
      Thanks goes to Stephane Eranian who first observed this misnomer and
      suggested a rename.
      
      User-space tooling and ABI compatibility is not affected - this patch
      should be function-invariant. (Also, defconfigs were not touched to
      keep the size down.)
      
      This patch has been generated via the following script:
      
        FILES=$(find * -type f | grep -vE 'oprofile|[^K]config')
      
        sed -i \
          -e 's/PERF_EVENT_/PERF_RECORD_/g' \
          -e 's/PERF_COUNTER/PERF_EVENT/g' \
          -e 's/perf_counter/perf_event/g' \
          -e 's/nb_counters/nb_events/g' \
          -e 's/swcounter/swevent/g' \
          -e 's/tpcounter_event/tp_event/g' \
          $FILES
      
        for N in $(find . -name perf_counter.[ch]); do
          M=$(echo $N | sed 's/perf_counter/perf_event/g')
          mv $N $M
        done
      
        FILES=$(find . -name perf_event.*)
      
        sed -i \
          -e 's/COUNTER_MASK/REG_MASK/g' \
          -e 's/COUNTER/EVENT/g' \
          -e 's/\<event\>/event_id/g' \
          -e 's/counter/event/g' \
          -e 's/Counter/Event/g' \
          $FILES
      
      ... to keep it as correct as possible. This script can also be
      used by anyone who has pending perfcounters patches - it converts
      a Linux kernel tree over to the new naming. We tried to time this
      change to the point in time where the amount of pending patches
      is the smallest: the end of the merge window.
      
      Namespace clashes were fixed up in a preparatory patch - and some
      stylistic fallout will be fixed up in a subsequent patch.
      
      ( NOTE: 'counters' are still the proper terminology when we deal
        with hardware registers - and these sed scripts are a bit
        over-eager in renaming them. I've undone some of that, but
        in case there's something left where 'counter' would be
        better than 'event' we can undo that on an individual basis
        instead of touching an otherwise nicely automated patch. )
      Suggested-by: NStephane Eranian <eranian@google.com>
      Acked-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Acked-by: NPaul Mackerras <paulus@samba.org>
      Reviewed-by: NArjan van de Ven <arjan@linux.intel.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Kyle McMartin <kyle@mcmartin.ca>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: <linux-arch@vger.kernel.org>
      LKML-Reference: <new-submission>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      cdd6c482
    • C
      x86, apic: Fix missed handling of discrete apics · 8312136f
      Cyrill Gorcunov 提交于
      In case of discrete (pretty old) apics we may have cpu_has_apic bit
      not set but have to check if smp_found_config (MP spec) is there
      and apic was not disabled.
      
      Also don't forget to print apic/io-apic for such case as well.
      Signed-off-by: NCyrill Gorcunov <gorcunov@openvz.org>
      Cc: "Maciej W. Rozycki" <macro@linux-mips.org>
      Cc: Yinghai Lu <yinghai@kernel.org>
      LKML-Reference: <20090915071230.GA10604@lenovo>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      8312136f
  31. 19 9月, 2009 1 次提交
    • S
      x86, apic: Use logical flat on intel with <= 8 logical cpus · 2fbd07a5
      Suresh Siddha 提交于
      On Intel platforms, we can use logical flat mode if there are <= 8
      logical cpu's (irrespective of physical apic id values). This will
      enable simplified and efficient IPI and device interrupt routing on
      such platforms.
      
      Fix the relevant comments while we are at it.
      
      We can clean up default_setup_apic_routing() by using apic->probe()
      but that is a different item.
      Signed-off-by: NSuresh Siddha <suresh.b.siddha@intel.com>
      Cc: "yinghai@kernel.org" <yinghai@kernel.org>
      LKML-Reference: <1253327399.3948.747.camel@sbs-t61.sc.intel.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      2fbd07a5
  32. 18 9月, 2009 1 次提交
  33. 31 8月, 2009 1 次提交
  34. 27 8月, 2009 1 次提交