1. 26 9月, 2006 40 次提交
    • E
      [PATCH] Auto size the per cpu area. · ba4d40bb
      Eric W. Biederman 提交于
      Now for a completely different but trivial approach.
      I just boot tested it with 255 CPUS and everything worked.
      
      Currently everything (except module data) we place in
      the per cpu area we know about at compile time.  So
      instead of allocating a fixed size for the per_cpu area
      allocate the number of bytes we need plus a fixed constant
      for to be used for modules.
      
      It isn't perfect but it is much less of a pain to
      work with than what we are doing now.
      
      AK: fixed warning
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      ba4d40bb
    • R
      [PATCH] i386: Descriptor and trap table cleanups. · 522e93e3
      Rusty Russell 提交于
      The implementation comes from Zach's [RFC, PATCH 10/24] i386 Vmi
      descriptor changes:
      
      Descriptor and trap table cleanups.  Add cleanly written accessors for
      IDT and GDT gates so the subarch may override them.  Note that this
      allows the hypervisor to transparently tweak the DPL of the descriptors
      as well as the RPL of segments in those descriptors, with no unnecessary
      kernel code modification.  It also allows the hypervisor implementation
      of the VMI to tweak the gates, allowing for custom exception frames or
      extra layers of indirection above the guest fault / IRQ handlers.
      Signed-off-by: NZachary Amsden <zach@vmware.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      522e93e3
    • A
      [PATCH] i386: Make enable_local_apic static · 3d08a256
      Adrian Bunk 提交于
      enable_local_apic can now become static.
      
      Cc: len.brown@intel.com
      Signed-off-by: NAdrian Bunk <bunk@stusta.de>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      3d08a256
    • P
      [PATCH] x86: error_code is not safe for kprobes · d28c4393
      Prasanna S.P 提交于
      This patch moves the entry.S:error_entry to .kprobes.text section,
      since code marked unsafe for kprobes jumps directly to entry.S::error_entry,
      that must be marked unsafe as well.
      This patch also moves all the ".previous.text" asm directives to ".previous"
      for kprobes section.
      
      AK: Following a similar i386 patch from Chuck Ebbert
      AK: Also merged Jeremy's fix in.
      
      +From: Jeremy Fitzhardinge <jeremy@goop.org>
      
      KPROBE_ENTRY does a .section .kprobes.text, and expects its users to
      do a .previous at the end of the function.
      
      Unfortunately, if any code within the function switches sections, for
      example .fixup, then the .previous ends up putting all subsequent code
      into .fixup.  Worse, any subsequent .fixup code gets intermingled with
      the code its supposed to be fixing (which is also in .fixup).  It's
      surprising this didn't cause more havok.
      
      The fix is to use .pushsection/.popsection, so this stuff nests
      properly.  A further cleanup would be to get rid of all
      .section/.previous pairs, since they're inherently fragile.
      
      +From: Chuck Ebbert <76306.1226@compuserve.com>
      
      Because code marked unsafe for kprobes jumps directly to
      entry.S::error_code, that must be marked unsafe as well.
      The easiest way to do that is to move the page fault entry
      point to just before error_code and let it inherit the same
      section.
      
      Also moved all the ".previous" asm directives for kprobes
      sections to column 1 and removed ".text" from them.
      Signed-off-by: NChuck Ebbert <76306.1226@compuserve.com>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      d28c4393
    • A
      [PATCH] i386: Get ebp from unwinder state when continuing fallback backtrace · a32cf397
      Andi Kleen 提交于
      Cc: jbeulich@novell.com
      Signed-off-by: NAndi Kleen <ak@suse.de>
      a32cf397
    • A
      [PATCH] i386: Do stacktracer conversion too · 2b14a78c
      Andi Kleen 提交于
      Following x86-64 patches. Reuses code from them in fact.
      
      Convert the standard backtracer to do all output using
      callbacks.   Use the x86-64 stack tracer implementation
      that uses these callbacks to implement the stacktrace interface.
      
      This allows to use the new dwarf2 unwinder for stacktrace
      and get better backtraces.
      
      Cc: mingo@elte.hu
      Signed-off-by: NAndi Kleen <ak@suse.de>
      2b14a78c
    • A
      [PATCH] Merge stacktrace and show_trace · c0b766f1
      Andi Kleen 提交于
      This unifies the standard backtracer and the new stacktrace
      in memory backtracer. The standard one is converted to use callbacks
      and then reimplement stacktrace using new callbacks.
      
      The main advantage is that stacktrace can now use the new dwarf2 unwinder
      and avoid false positives in many cases.
      
      I kept it simple to make sure the standard backtracer stays reliable.
      
      Cc: mingo@elte.hu
      Signed-off-by: NAndi Kleen <ak@suse.de>
      c0b766f1
    • A
      [PATCH] Don't access the APIC in safe_smp_processor_id when it is not mapped yet · b7f5e3c7
      Andi Kleen 提交于
      Lockdep can call the dwarf2 unwinder early, and the dwarf2 code
      uses safe_smp_processor_id which tries to access the local APIC page.
      But that doesn't work before the APIC code has set up its fixmap.
      
      Check for this case and always return boot cpu then.
      
      Cc: jbeulich@novell.com
      Cc: mingo@elte.hu
      Signed-off-by: NAndi Kleen <ak@suse.de>
      b7f5e3c7
    • A
      [PATCH] x86: Some preparationary cleanup for stack trace · 5a1b3999
      Andi Kleen 提交于
      - Remove unused all_contexts parameter
      No caller used it
      - Move skip argument into the structure (needed for
      followon patches)
      
      Cc: mingo@elte.hu
      Signed-off-by: NAndi Kleen <ak@suse.de>
      5a1b3999
    • A
      [PATCH] x86: Remove unneeded externs in acpi/boot.c · 91cd444e
      Andi Kleen 提交于
      And move one into proto.h
      
      Cc: len.brown@intel.com
      Signed-off-by: NAndi Kleen <ak@suse.de>
      91cd444e
    • A
      [PATCH] Convert x86-64 to early param · 2c8c0e6b
      Andi Kleen 提交于
      Instead of hackish manual parsing
      
      Requires earlier i386 patchkit, but also fixes i386 early_printk again.
      
      I removed some obsolete really early parameters which didn't do anything useful.
      Also made a few parameters that needed it early (mostly oops printing setup)
      
      Also removed one panic check that wasn't visible without
      early console anyways (the early console is now initialized after that
      panic)
      
      This cleans up a lot of code.
      Signed-off-by: NAndi Kleen <ak@suse.de>
      2c8c0e6b
    • R
      [PATCH] i386: Replace i386 open-coded cmdline parsing with · 1a3f239d
      Rusty Russell 提交于
      This patch replaces the open-coded early commandline parsing
      throughout the i386 boot code with the generic mechanism (already used
      by ppc, powerpc, ia64 and s390).  The code was inconsistent with
      whether it deletes the option from the cmdline or not, meaning some of
      these will get passed through the environment into init.
      
      This transformation is mainly mechanical, but there are some notable
      parts:
      
      1) Grammar: s/linux never set's it up/linux never sets it up/
      
      2) Remove hacked-in earlyprintk= option scanning.  When someone
         actually implements CONFIG_EARLY_PRINTK, then they can use
         early_param().
      [AK: actually it is implemented, but I'm adding the early_param it in the next
      x86-64 patch]
      
      3) Move declaration of generic_apic_probe() from setup.c into asm/apic.h
      
      4) Various parameters now moved into their appropriate files (thanks Andi).
      
      5) All parse functions which examine arg need to check for NULL,
         except one where it has subtle humor value.
      
      AK: readded acpi_sci handling which was completely dropped
      AK: moved some more variables into acpi/boot.c
      
      Cc: len.brown@intel.com
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      1a3f239d
    • A
      [PATCH] i386: Clean up spin/rwlocks · fb2e2848
      Andi Kleen 提交于
      - Inline spinlock strings into their inline functions
      - Convert macros to typesafe inlines
      - Replace some leftover __asm__ __volatile__s with asm volatile
      Signed-off-by: NAndi Kleen <ak@suse.de>
      fb2e2848
    • A
      [PATCH] Clean up spin/rwlocks · 8b059d23
      Andi Kleen 提交于
      - Inline spinlock strings into their inline functions
      - Convert macros to typesafe inlines
      - Replace some leftover __asm__ __volatile__s with asm volatile
      Signed-off-by: NAndi Kleen <ak@suse.de>
      8b059d23
    • A
      [PATCH] Don't use lock section for mutexes and semaphores · 8578bdf8
      Andi Kleen 提交于
      Lock sections cannot be handled by the dwarf2 unwinder.
      
      Disadvantage is a taken branch in the hot path.
      Signed-off-by: NAndi Kleen <ak@suse.de>
      8578bdf8
    • A
      [PATCH] i386: Remove lock section support in semaphore.h · 7ca2b49b
      Andi Kleen 提交于
      Lock sections don't work the new dwarf2 unwinder
      This generates slightly smaller code. It adds one more taken
      jump to the fast path.
      
      Cc: jbeulich@novell.com
      Signed-off-by: NAndi Kleen <ak@suse.de>
      7ca2b49b
    • A
      [PATCH] i386: Remove lock section support in rwsem.h · add659bf
      Andi Kleen 提交于
      Lock sections don't work the new dwarf2 unwinder
      This generates slightly smaller code. It adds one more taken
      jump to the fast path.
      
      Also move the trampolines into semaphore.S and add proper CFI
      annotations.
      
      Cc: jbeulich@novell.com
      Signed-off-by: NAndi Kleen <ak@suse.de>
      add659bf
    • A
      [PATCH] i386: Remove lock section support in mutex.h · 01215ad8
      Andi Kleen 提交于
      Lock sections don't work the new dwarf2 unwinder
      This generates slightly smaller code. It adds one more taken
      jump to the fast path.
      
      Cc: jbeulich@novell.com
      Signed-off-by: NAndi Kleen <ak@suse.de>
      01215ad8
    • M
      [PATCH] Calgary IOMMU: consolidate per bus data structures · f38db651
      Muli Ben-Yehuda 提交于
      Move the tce_table_kva array, disabled bitmap and bus_to_phb array
      into a new per bus 'struct calgary_bus_info'. Also slightly reorganize
      build_tce_table and tce_table_setparms to avoid exporting bus_info to
      tce.c.
      Signed-off-by: NMuli Ben-Yehuda <muli@il.ibm.com>
      Signed-off-by: NJon Mason <jdmason@us.ibm.com>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      f38db651
    • M
      [PATCH] Calgary IOMMU: rearrange 'struct iommu_table' members · 5f4a7a93
      Muli Ben-Yehuda 提交于
      Rearrange struct members loosely based on size for improved alignment
      and to save a few bytes.
      Signed-off-by: NMuli Ben-Yehuda <muli@il.ibm.com>
      Signed-off-by: NJon Mason <jdmason@us.ibm.com>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      5f4a7a93
    • J
      [PATCH] remove int_delivery_dest · 3b94355c
      Jan Beulich 提交于
      The genapic field and the accessor macro weren't used anywhere.
      Signed-off-by: NJan Beulich <jbeulich@novell.com>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      3b94355c
    • A
      [PATCH] x86: Detect CFI support in the assembler at runtime · e2414910
      Andi Kleen 提交于
      ... instead of using a CONFIG option. The config option still controls
      if the resulting executable actually has unwind information.
      
      This is useful to prevent compilation errors when users select
      CONFIG_STACK_UNWIND on old binutils and also allows to use
      CFI in the future for non kernel debugging applications.
      
      Cc: jbeulich@novell.com
      Cc: sam@ravnborg.org
      Signed-off-by: NAndi Kleen <ak@suse.de>
      e2414910
    • A
      [PATCH] Replace mp bus array with bitmap for bus not pci · 55f05ffa
      Andi Kleen 提交于
      Since we only support PCI and ISA legacy busses now there is no need to
      have an full array with checking.
      Signed-off-by: NAndi Kleen <ak@suse.de>
      55f05ffa
    • A
      [PATCH] Move early chipset quirks out to new file · dfa4698c
      Andi Kleen 提交于
      They did not really belong into io_apic.c. Move them into a new file
      and clean it up a bit.
      
      Also remove outdated ATI quirk that was obsolete,
      Signed-off-by: NAndi Kleen <ak@suse.de>
      dfa4698c
    • A
      [PATCH] Remove obsolete PIC mode · a8fcf1a2
      Andi Kleen 提交于
      PIC mode is an outdated way to drive the APICs that was used on
      some early MP boards. It is not supported in the ACPI model.
      
      It is unlikely to be ever configured by any x86-64 system
      
      Remove it thus.
      Signed-off-by: NAndi Kleen <ak@suse.de>
      a8fcf1a2
    • A
      [PATCH] i386: Minor fixes & cleanup to tlb flush · 107878bb
      Andi Kleen 提交于
      (based on x86-64 changes)
      - Add a proper memory clobber to invlpg
      - Remove an unused extern
      Signed-off-by: NAndi Kleen <ak@suse.de>
      107878bb
    • A
      [PATCH] Clean up and minor fixes to TLB flush · b1c78c0f
      Andi Kleen 提交于
      - Convert CR* accesses to dedicated inline functions and rewrite
      the rest as C inlines
      - Don't do a double flush for global flushes (pointed out by Zach Amsden)
      This was a bug workaround for old CPUs that don't do 64bit and is obsolete.
      - Add a proper memory clobber to invlpg
      - Remove an unused extern
      Signed-off-by: NAndi Kleen <ak@suse.de>
      b1c78c0f
    • A
      [PATCH] Remove all ifdefs for local/io apic · 7f11d8a5
      Andi Kleen 提交于
      IO-APIC or local APIC can only be disabled at runtime anyways and
      Kconfig has forced these options on for a long time now.
      
      The Kconfigs are kept only now for the benefit of the shared acpi
      boot.c code.
      Signed-off-by: NAndi Kleen <ak@suse.de>
      7f11d8a5
    • A
      [PATCH] i386: Redo semaphore and rwlock assembly helpers · ecaf45ee
      Andi Kleen 提交于
      - Move them to a pure assembly file. Previously they were in
      a C file that only consisted of inline assembly. Doing it in pure
      assembler is much nicer.
      - Add a frame.i include with FRAME/ENDFRAME macros to easily
      add frame pointers to assembly functions
      - Add dwarf2 annotation to them so that the new dwarf2 unwinder
      doesn't get stuck on them
      - Random cleanups
      
      Includes feedback from Jan Beulich and a UML build fix from Andrew
      Morton.
      
      Cc: jbeulich@novell.com
      Cc: jdike@addtoit.com
      Signed-off-by: NAndi Kleen <ak@suse.de>
      ecaf45ee
    • A
      [PATCH] i386: add alternative-asm.h to allow LOCK_PREFIX replacement in .S files · 07c9819b
      Andi Kleen 提交于
      LOCK_PREFIX is replaced by nops on UP systems, so it has to be a special
      macro.  Previously this was only possible from C. Allow it for pure
      assembly files too. Similar to earlier x86-64 patch.
      Signed-off-by: NAndi Kleen <ak@suse.de>
      07c9819b
    • A
      [PATCH] Add proper alignment to ENTRY · b06babac
      Andi Kleen 提交于
      Previously it didn't align. Use the same one as the C compiler
      in blended mode, which is good for K8 and Core2 and doesn't hurt
      on P4.
      Signed-off-by: NAndi Kleen <ak@suse.de>
      b06babac
    • A
      [PATCH] i386: Remove const case for rwlocks · 1a015b56
      Andi Kleen 提交于
      rwlocks are now out of line, so it near never triggers.  Also it was
      incompatible with the new dwarf2 unwinder because it had unannotiatable
      push/pops.
      Signed-off-by: NAndi Kleen <ak@suse.de>
      1a015b56
    • A
      [PATCH] Clean up read write lock assembly · 9a0b26e6
      Andi Kleen 提交于
      - Move the slow path fallbacks to their own assembly files
      This makes them much easier to read and is needed for the next change.
      - Add CFI annotations for unwinding (XXX need review)
      - Remove constant case which can never happen with out of line spinlocks
      - Use patchable LOCK prefixes
      - Don't use lock sections anymore for inline code because they can't
      be expressed by the unwinder (this adds one taken jump to the lock
      fast path)
      
      Cc: jbeulich@novell.com
      Signed-off-by: NAndi Kleen <ak@suse.de>
      9a0b26e6
    • A
      [PATCH] Support patchable lock prefix for pure assembly files · b4062b16
      Andi Kleen 提交于
      Signed-off-by: NAndi Kleen <ak@suse.de>
      b4062b16
    • A
      [PATCH] i386: Account spinlocks to the caller during profiling for !FP kernels · 0cb91a22
      Andi Kleen 提交于
      This ports the algorithm from x86-64 (with improvements) to i386.
      Previously this only worked for frame pointer enabled kernels.
      But spinlocks have a very simple stack frame that can be manually
      analyzed. Do this.
      Signed-off-by: NAndi Kleen <ak@suse.de>
      0cb91a22
    • S
      [PATCH] x86-64 TIF flags for debug regs and io bitmap in ctxsw · d3a4f48d
      Stephane Eranian 提交于
      Hello,
      
      Following my discussion with Andi. Here is a patch that introduces
      two new TIF flags to simplify the context switch code in __switch_to().
      The idea is to minimize the number of cache lines accessed in the common
      case, i.e., when neither the debug registers nor the I/O bitmap are used.
      
      This patch covers the x86-64 modifications. A patch for i386 follows.
      
      Changelog:
      	- add TIF_DEBUG to track when debug registers are active
      	- add TIF_IO_BITMAP to track when I/O bitmap is used
      	- modify __switch_to() to use the new TIF flags
      
      <signed-off-by>: eranian@hpl.hp.com
      Signed-off-by: NAndi Kleen <ak@suse.de>
      d3a4f48d
    • A
      [PATCH] Clean up asm/smp.h includes · 2f766d16
      Andi Kleen 提交于
      No need to include it from entry.S
      Drop all the #ifdef __ASSEMBLY__
      Signed-off-by: NAndi Kleen <ak@suse.de>
      2f766d16
    • A
      [PATCH] x86: Add portable getcpu call · 3cfc348b
      Andi Kleen 提交于
      For NUMA optimization and some other algorithms it is useful to have a fast
      to get the current CPU and node numbers in user space.
      
      x86-64 added a fast way to do this in a vsyscall. This adds a generic
      syscall for other architectures to make it a generic portable facility.
      
      I expect some of them will also implement it as a faster vsyscall.
      
      The cache is an optimization for the x86-64 vsyscall optimization. Since
      what the syscall returns is an approximation anyways and user space
      often wants very fast results it can be cached for some time.  The norma
      methods to get this information in user space are relatively slow
      
      The vsyscall is in a better position to manage the cache because it has direct
      access to a fast time stamp (jiffies). For the generic syscall optimization
      it doesn't help much, but enforce a valid argument to keep programs
      portable
      
      I only added an i386 syscall entry for now. Other architectures can follow
      as needed.
      
      AK: Also added some cleanups from Andrew Morton
      Signed-off-by: NAndi Kleen <ak@suse.de>
      3cfc348b
    • V
      [PATCH] Add the vgetcpu vsyscall · c08c8205
      Vojtech Pavlik 提交于
      This patch adds a vgetcpu vsyscall, which depending on the CPU RDTSCP
      capability uses either the RDTSCP or CPUID to obtain a CPU and node
      numbers and pass them to the program.
      
      AK: Lots of changes over Vojtech's original code:
      Better prototype for vgetcpu()
      It's better to pass the cpu / node numbers as separate arguments
      to avoid mistakes when going from SMP to NUMA.
      Also add a fast time stamp based cache using a user supplied
      argument to speed things more up.
      Use fast method from Chuck Ebbert to retrieve node/cpu from
      GDT limit instead of CPUID
      Made sure RDTSCP init is always executed after node is known.
      Drop printk
      Signed-off-by: NVojtech Pavlik <vojtech@suse.cz>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      c08c8205
    • V
      [PATCH] Add initalization of the RDTSCP auxilliary values · a670fad0
      Vojtech Pavlik 提交于
      This patch adds initalization of the RDTSCP auxilliary values to CPU numbers
      to time.c. If RDTSCP is available, the MSRs are written with the respective
      values. It can be later used to initalize per-cpu timekeeping variables.
      
      AK: Some cleanups. Move externs into headers and fix CPU hotplug.
      Signed-off-by: NVojtech Pavlik <vojtech@suse.cz>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      a670fad0