1. 22 8月, 2009 1 次提交
  2. 10 3月, 2009 1 次提交
  3. 06 3月, 2009 2 次提交
  4. 25 2月, 2009 1 次提交
  5. 18 2月, 2009 1 次提交
    • A
      x86, mce: don't disable machine checks during code patching · 123aa76e
      Andi Kleen 提交于
      Impact: low priority bug fix
      
      This removes part of a a patch I added myself some time ago. After some
      consideration the patch was a bad idea. In particular it stopped machine check
      exceptions during code patching.
      
      To quote the comment:
      
              * MCEs only happen when something got corrupted and in this
              * case we must do something about the corruption.
              * Ignoring it is worse than a unlikely patching race.
              * Also machine checks tend to be broadcast and if one CPU
              * goes into machine check the others follow quickly, so we don't
              * expect a machine check to cause undue problems during to code
              * patching.
      
      So undo the machine check related parts of
      8f4e956b NMIs are still disabled.
      
      This only removes code, the only additions are a new comment.
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      123aa76e
  6. 13 10月, 2008 1 次提交
  7. 06 9月, 2008 1 次提交
  8. 19 8月, 2008 1 次提交
  9. 16 8月, 2008 1 次提交
    • M
      x86: alternatives : fix LOCK_PREFIX race with preemptible kernel and CPU hotplug · f88f07e0
      Mathieu Desnoyers 提交于
      If a kernel thread is preempted in single-cpu mode right after the NOP (nop
      about to be turned into a lock prefix), then we CPU hotplug a CPU, and then the
      thread is scheduled back again, a SMP-unsafe atomic operation will be used on
      shared SMP variables, leading to corruption. No corruption would happen in the
      reverse case : going from SMP to UP is ok because we split a bit instruction
      into tiny pieces, which does not present this condition.
      
      Changing the 0x90 (single-byte nop) currently used into a 0x3E DS segment
      override prefix should fix this issue. Since the default of the atomic
      instructions is to use the DS segment anyway, it should not affect the
      behavior.
      
      The exception to this are references that use ESP/RSP and EBP/RBP as
      the base register (they will use the SS segment), however, in Linux
      (a) DS == SS at all times, and (b) we do not distinguish between
      segment violations reported as #SS as opposed to #GP, so there is no
      need to disassemble the instruction to figure out the suitable segment.
      
      This patch assumes that the 0x3E prefix will leave atomic operations as-is (thus
      assuming they normally touch data in the DS segment). Since there seem to be no
      obvious ill-use of other segment override prefixes for atomic operations, it
      should be safe. It can be verified with a quick
      
      grep -r LOCK_PREFIX include/asm-x86/
      grep -A 1 -r LOCK_PREFIX arch/x86/
      
      Taken from
      
      This source :
      AMD64 Architecture Programmer's Manual Volume 3: General-Purpose and System
      Instructions
      States
      "Instructions that Reference a Non-Stack Segment—If an instruction encoding
      references any base register other than rBP or rSP, or if an instruction
      contains an immediate offset, the default segment is the data segment (DS).
      These instructions can use the segment-override prefix to select one of the
      non-default segments, as shown in Table 1-5."
      
      Therefore, forcing the DS segment on the atomic operations, which already use
      the DS segment, should not change.
      
      This source :
      http://wiki.osdev.org/X86_Instruction_Encoding
      States
      "In 64-bit the CS, SS, DS and ES segment overrides are ignored."
      
      Confirmed by "AMD 64-Bit Technology" A.7
      http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/x86-64_overview.pdf
      
      "In 64-bit mode, the DS, ES, SS and CS segment-override prefixes have no effect.
      These four prefixes are no longer treated as segment-override prefixes in the
      context of multipleprefix rules. Instead, they are treated as null prefixes."
      
      This patch applies to 2.6.27-rc2, but would also have to be applied to earlier
      kernels (2.6.26, 2.6.25, ...).
      
      Performance impact of the fix : tests done on "xaddq" and "xaddl" shows it
      actually improves performances on Intel Xeon, AMD64, Pentium M. It does not
      change the performance on Pentium II, Pentium 3 and Pentium 4.
      
      Xeon E5405 2.0GHz :
      NR_TESTS                                    10000000
      test empty cycles :                        162207948
      test test 1-byte nop xadd cycles :         170755422
      test test DS override prefix xadd cycles : 170000118 *
      test test LOCK xadd cycles :               472012134
      
      AMD64 2.0GHz :
      NR_TESTS                                    10000000
      test empty cycles :                        146674549
      test test 1-byte nop xadd cycles :         150273860
      test test DS override prefix xadd cycles : 149982382 *
      test test LOCK xadd cycles :               270000690
      
      Pentium 4 3.0GHz
      NR_TESTS                                    10000000
      test empty cycles :                        290001195
      test test 1-byte nop xadd cycles :         310000560
      test test DS override prefix xadd cycles : 310000575 *
      test test LOCK xadd cycles :              1050103740
      
      Pentium M 2.0GHz
      NR_TESTS 10000000
      test empty cycles :                        180000523
      test test 1-byte nop xadd cycles :         320000345
      test test DS override prefix xadd cycles : 310000374 *
      test test LOCK xadd cycles :               480000357
      
      Pentium 3 550MHz
      NR_TESTS                                    10000000
      test empty cycles :                        510000231
      test test 1-byte nop xadd cycles :         620000128
      test test DS override prefix xadd cycles : 620000110 *
      test test LOCK xadd cycles :               800000088
      
      Pentium II 350MHz
      NR_TESTS                                    10000000
      test empty cycles :                        200833494
      test test 1-byte nop xadd cycles :         340000130
      test test DS override prefix xadd cycles : 340000126 *
      test test LOCK xadd cycles :               530000078
      
      Speed test modules can be found at
      http://ltt.polymtl.ca/svn/trunk/tests/kernel/test-prefix-speed-32.c
      http://ltt.polymtl.ca/svn/trunk/tests/kernel/test-prefix-speed.c
      
      Macro-benchmarks
      
      2.0GHz E5405 Core 2 dual Quad-Core Xeon
      
      Summary
      
      * replace smp lock prefixes with DS segment selector prefixes
                        no lock prefix (s)   with lock prefix (s)    Speedup
      make -j1 kernel/      33.94 +/- 0.07         34.91 +/- 0.27      2.8 %
      hackbench 50           2.99 +/- 0.01          3.74 +/- 0.01     25.1 %
      
      * replace smp lock prefixes with 0x90 nops
                        no lock prefix (s)   with lock prefix (s)    Speedup
      make -j1 kernel/      34.16 +/- 0.32         34.91 +/- 0.27      2.2 %
      hackbench 50           3.00 +/- 0.01          3.74 +/- 0.01     24.7 %
      
      Detail :
      
      1 CPU, replace smp lock prefixes with DS segment selector prefixes
      
      make -j1 kernel/
      
      real	0m34.067s
      user	0m30.630s
      sys	0m2.980s
      
      real	0m33.867s
      user	0m30.582s
      sys	0m3.024s
      
      real	0m33.939s
      user	0m30.738s
      sys	0m2.876s
      
      real	0m33.913s
      user	0m30.806s
      sys	0m2.808s
      
      avg : 33.94s
      std. dev. : 0.07s
      
      hackbench 50
      
      Time: 2.978
      Time: 2.982
      Time: 3.010
      Time: 2.984
      Time: 2.982
      
      avg : 2.99
      std. dev. : 0.01
      
      1 CPU, noreplace-smp
      
      make -j1 kernel/
      
      real	0m35.326s
      user	0m30.630s
      sys	0m3.260s
      
      real	0m34.325s
      user	0m30.802s
      sys	0m3.084s
      
      real	0m35.568s
      user	0m30.722s
      sys	0m3.168s
      
      real	0m34.435s
      user	0m30.886s
      sys	0m2.996s
      
      avg.: 34.91s
      std. dev. : 0.27s
      
      hackbench 50
      
      Time: 3.733
      Time: 3.750
      Time: 3.761
      Time: 3.737
      Time: 3.741
      
      avg : 3.74
      std. dev. : 0.01
      
      1 CPU, replace smp lock prefixes with 0x90 nops
      
      make -j1 kernel/
      
      real	0m34.139s
      user	0m30.782s
      sys	0m2.820s
      
      real	0m34.010s
      user	0m30.630s
      sys	0m2.976s
      
      real	0m34.777s
      user	0m30.658s
      sys	0m2.916s
      
      real	0m33.924s
      user	0m30.634s
      sys	0m2.924s
      
      real	0m33.962s
      user	0m30.774s
      sys	0m2.800s
      
      real	0m34.141s
      user	0m30.770s
      sys	0m2.828s
      
      avg : 34.16
      std. dev. : 0.32
      
      hackbench 50
      
      Time: 2.999
      Time: 2.994
      Time: 3.004
      Time: 2.991
      Time: 2.988
      
      avg : 3.00
      std. dev. : 0.01
      
      I did more runs (20 runs of each) to compare the nop case to the DS
      prefix case. Results in seconds. They actually does not seems to show a
      significant difference.
      
      NOP
      
      34.155
      33.955
      34.012
      35.299
      35.679
      34.141
      33.995
      35.016
      34.254
      33.957
      33.957
      34.008
      35.013
      34.494
      33.893
      34.295
      34.314
      34.854
      33.991
      34.132
      
      DS
      
      34.080
      34.304
      34.374
      35.095
      34.291
      34.135
      33.940
      34.208
      35.276
      34.288
      33.861
      33.898
      34.610
      34.709
      33.851
      34.256
      35.161
      34.283
      33.865
      35.078
      
      Used http://www.graphpad.com/quickcalcs/ttest1.cfm?Format=C to do the
      T-test (yeah, I'm lazy) :
      
       Group      Group One (DS prefix)       Group Two (nops)
       Mean                    34.37815               34.37070
       SD                       0.46108                0.51905
       SEM                      0.10310                0.11606
       N                             20                     20
      
      P value and statistical significance:
        The two-tailed P value equals 0.9620
        By conventional criteria, this difference is considered to be not statistically significant.
      
      Confidence interval:
        The mean of Group One minus Group Two equals 0.00745
        95% confidence interval of this difference: From -0.30682 to 0.32172
      
      Intermediate values used in calculations:
        t = 0.0480
        df = 38
        standard error of difference = 0.155
      
      So, unless these calculus are completely bogus, the difference between the nop
      and the DS case seems not to be statistically significant.
      Signed-off-by: NMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Acked-by: NH. Peter Anvin <hpa@zytor.com>
      CC: Linus Torvalds <torvalds@linux-foundation.org>
      CC: Jeremy Fitzhardinge <jeremy@goop.org>
      CC: Roland McGrath <roland@redhat.com>
      CC: Ingo Molnar <mingo@elte.hu>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      CC: Steven Rostedt <srostedt@redhat.com>
      CC: Thomas Gleixner <tglx@linutronix.de>
      CC: Peter Zijlstra <peterz@infradead.org>
      CC: Andrew Morton <akpm@linux-foundation.org>
      CC: David Miller <davem@davemloft.net>
      CC: Ulrich Drepper <drepper@redhat.com>
      CC: Rusty Russell <rusty@rustcorp.com.au>
      CC: Gregory Haskins <ghaskins@novell.com>
      CC: Arnaldo Carvalho de Melo <acme@redhat.com>
      CC: "Luis Claudio R. Goncalves" <lclaudio@uudg.org>
      CC: Clark Williams <williams@redhat.com>
      CC: Christoph Lameter <cl@linux-foundation.org>
      CC: Andi Kleen <andi@firstfloor.org>
      CC: Harvey Harrison <harvey.harrison@gmail.com>
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      f88f07e0
  10. 24 5月, 2008 2 次提交
  11. 26 4月, 2008 3 次提交
  12. 17 4月, 2008 3 次提交
    • M
      x86: fix test_poke for vmalloced pages · 15a601eb
      Mathieu Desnoyers 提交于
      * Ingo Molnar (mingo@elte.hu) wrote:
      >
      > * Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> wrote:
      >
      > > The shadow vmap for DEBUG_RODATA kernel text modification uses
      > > virt_to_page to get the pages from the pointer address.
      > >
      > > However, I think vmalloc_to_page would be required in case the page is
      > > used for modules.
      > >
      > > Since only the core kernel text is marked read-only, use
      > > kernel_text_address() to make sure we only shadow map the core kernel
      > > text, not modules.
      >
      > actually, i think we should mark module text readonly too.
      >
      
      Yes, but in the meantime, the x86 tree would need this patch to make
      kprobes work correctly on modules.
      
      I suspect that without this fix, with the enhanced hotplug and kprobes
      patch, kprobes will use text_poke to insert breakpoints in modules
      (vmalloced pages used), which will map the wrong pages and corrupt
      random kernel locations instead of updating the correct page.
      
      Work that would write protect the module pages should clearly be done,
      but it can come in a later time. We have to make sure we interact
      correctly with the page allocation debugging, as an example.
      
      Here is the patch against x86.git 2.6.25-rc5 :
      
      The shadow vmap for DEBUG_RODATA kernel text modification uses virt_to_page to
      get the pages from the pointer address.
      
      However, I think vmalloc_to_page would be required in case the page is used for
      modules.
      
      Since only the core kernel text is marked read-only, use kernel_text_address()
      to make sure we only shadow map the core kernel text, not modules.
      Signed-off-by: NMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      CC: akpm@linux-foundation.org
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      15a601eb
    • M
      x86: enhance DEBUG_RODATA support - alternatives · e587cadd
      Mathieu Desnoyers 提交于
      Fix a memcpy that should be a text_poke (in apply_alternatives).
      
      Use kernel_wp_save/kernel_wp_restore in text_poke to support DEBUG_RODATA
      correctly and so the CPU HOTPLUG special case can be removed.
      
      Add text_poke_early, for alternatives and paravirt boot-time and module load
      time patching.
      
      Changelog:
      
      - Fix text_set and text_poke alignment check (mixed up bitwise and and or)
      - Remove text_set
      - Export add_nops, so it can be used by others.
      - Document text_poke_early.
      - Remove clflush, since it breaks some VIA architectures and is not strictly
        necessary.
      - Add kerneldoc to text_poke and text_poke_early.
      - Create a second vmap instead of using the WP bit to support Xen and VMI.
      - Move local_irq disable within text_poke and text_poke_early to be able to
        be sleepable in these functions.
      Signed-off-by: NMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      CC: Andi Kleen <andi@firstfloor.org>
      CC: pageexec@freemail.hu
      CC: H. Peter Anvin <hpa@zytor.com>
      CC: Jeremy Fitzhardinge <jeremy@goop.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      e587cadd
    • H
      x86: replace remaining __FUNCTION__ occurances · 77bf90ed
      Harvey Harrison 提交于
      __FUNCTION__ is gcc-specific, use __func__
      Signed-off-by: NHarvey Harrison <harvey.harrison@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      77bf90ed
  13. 10 4月, 2008 1 次提交
    • S
      pop previous section in alternative.c · f4be31ec
      Steven Rostedt 提交于
      gcc expects all toplevel assembly to return to the original section type.
      The code in alteranative.c does not do this. This caused some strange bugs
      in sched-devel where code would end up in the .rodata section and when
      the kernel sets the NX bit on all .rodata, the kernel would crash when
      executing this code.
      
      This patch adds a .previous marker to return the code back to the
      original section.
      
      Credit goes to Andrew Pinski for telling me it wasn't a gcc bug but a
      bug in the toplevel asm code in the kernel.  ;-)
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f4be31ec
  14. 30 1月, 2008 3 次提交
  15. 20 10月, 2007 1 次提交
    • M
      x86: convert cpuinfo_x86 array to a per_cpu array · 92cb7612
      Mike Travis 提交于
      cpu_data is currently an array defined using NR_CPUS.  This means that
      we overallocate since we will rarely really use maximum configured cpus.
      When NR_CPU count is raised to 4096 the size of cpu_data becomes
      3,145,728 bytes.
      
      These changes were adopted from the sparc64 (and ia64) code.  An
      additional field was added to cpuinfo_x86 to be a non-ambiguous cpu
      index.  This corresponds to the index into a cpumask_t as well as the
      per_cpu index.  It's used in various places like show_cpuinfo().
      
      cpu_data is defined to be the boot_cpu_data structure for the NON-SMP
      case.
      Signed-off-by: NMike Travis <travis@sgi.com>
      Acked-by: NChristoph Lameter <clameter@sgi.com>
      Cc: Andi Kleen <ak@suse.de>
      Cc: James Bottomley <James.Bottomley@steeleye.com>
      Cc: Dmitry Torokhov <dtor@mail.ru>
      Cc: "Antonino A. Daplas" <adaplas@pol.net>
      Cc: Mark M. Hoffman <mhoffman@lightlink.com>
      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>
      92cb7612
  16. 18 10月, 2007 3 次提交
    • J
      x86: multi-byte single instruction NOPs · 32c464f5
      Jan Beulich 提交于
      Add support for and use the multi-byte NOPs recently documented to be
      available on all PentiumPro and later processors.
      
      This patch only applies cleanly on top of the "x86: misc.
      constifications" patch sent earlier.
      
      [ tglx: arch/x86 adaptation ]
      Signed-off-by: NJan Beulich <jbeulich@novell.com>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      
       arch/x86/kernel/alternative.c  |   23 ++++++++++++++++++++++-
       include/asm-x86/processor_32.h |   22 ++++++++++++++++++++++
       include/asm-x86/processor_64.h |   22 ++++++++++++++++++++++
       3 files changed, 66 insertions(+), 1 deletion(-)
      32c464f5
    • J
      x86: misc. constifications · 121d7bf5
      Jan Beulich 提交于
      Miscellaneous x86 stuff that can live in .rodata.
      
      [ tglx: arch/x86 adaptation ]
      Signed-off-by: NJan Beulich <jbeulich@novell.com>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      121d7bf5
    • F
      x86: call free_init_pages() with irqs enabled in alternative_instructions() · f68fd5f4
      Fengguang Wu 提交于
      In alternative_instructions(), call free_init_pages() with irqs enabled.
      
      It fixes the warning message in smp_call_function*(), which should not be
      called with irqs disabled.
      
      [    0.310000] CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
      [    0.310000] CPU: L2 Cache: 512K (64 bytes/line)
      [    0.310000] CPU 0/0 -> Node 0
      [    0.310000] SMP alternatives: switching to UP code
      [    0.310000] Freeing SMP alternatives: 25k freed
      [    0.310000] WARNING: at arch/x86_64/kernel/smp.c:397 smp_call_function_mask()
      [    0.310000]
      [    0.310000] Call Trace:
      [    0.310000]  [<ffffffff8100dbde>] dump_trace+0x3ee/0x4a0
      [    0.310000]  [<ffffffff8100dcd3>] show_trace+0x43/0x70
      [    0.310000]  [<ffffffff8100dd15>] dump_stack+0x15/0x20
      [    0.310000]  [<ffffffff8101cd44>] smp_call_function_mask+0x94/0xa0
      [    0.310000]  [<ffffffff8101d0b2>] smp_call_function+0x32/0x40
      [    0.310000]  [<ffffffff8104277f>] on_each_cpu+0x1f/0x50
      [    0.310000]  [<ffffffff81026eac>] global_flush_tlb+0x8c/0x110
      [    0.310000]  [<ffffffff81025c85>] free_init_pages+0xe5/0xf0
      [    0.310000]  [<ffffffff81549b5e>] alternative_instructions+0x7e/0x150
      [    0.310000]  [<ffffffff8154a2ea>] check_bugs+0x1a/0x20
      [    0.310000]  [<ffffffff81540c4a>] start_kernel+0x2da/0x380
      [    0.310000]  [<ffffffff81540132>] _sinittext+0x132/0x140
      [    0.310000]
      [    0.320000] ACPI: Core revision 20070126
      [    0.560000] Using local APIC timer interrupts.
      [    0.590000] Detected 62.496 MHz APIC timer.
      [    0.590000] Brought up 1 CPUs
      
      [ tglx: arch/x86 adaptation ]
      
      Cc: Laurent Vivier <Laurent.Vivier@bull.net>
      Cc: Andi Kleen <ak@suse.de>
      Signed-off-by: NFengguang Wu <wfg@mail.ustc.edu.cn>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      f68fd5f4
  17. 17 10月, 2007 1 次提交
    • J
      paravirt: refactor struct paravirt_ops into smaller pv_*_ops · 93b1eab3
      Jeremy Fitzhardinge 提交于
      This patch refactors the paravirt_ops structure into groups of
      functionally related ops:
      
      pv_info - random info, rather than function entrypoints
      pv_init_ops - functions used at boot time (some for module_init too)
      pv_misc_ops - lazy mode, which didn't fit well anywhere else
      pv_time_ops - time-related functions
      pv_cpu_ops - various privileged instruction ops
      pv_irq_ops - operations for managing interrupt state
      pv_apic_ops - APIC operations
      pv_mmu_ops - operations for managing pagetables
      
      There are several motivations for this:
      
      1. Some of these ops will be general to all x86, and some will be
         i386/x86-64 specific.  This makes it easier to share common stuff
         while allowing separate implementations where needed.
      
      2. At the moment we must export all of paravirt_ops, but modules only
         need selected parts of it.  This allows us to export on a case by case
         basis (and also choose which export license we want to apply).
      
      3. Functional groupings make things a bit more readable.
      
      Struct paravirt_ops is now only used as a template to generate
      patch-site identifiers, and to extract function pointers for inserting
      into jmp/calls when patching.  It is only instantiated when needed.
      Signed-off-by: NJeremy Fitzhardinge <jeremy@xensource.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Cc: Andi Kleen <ak@suse.de>
      Cc: Zach Amsden <zach@vmware.com>
      Cc: Avi Kivity <avi@qumranet.com>
      Cc: Anthony Liguory <aliguori@us.ibm.com>
      Cc: "Glauber de Oliveira Costa" <glommer@gmail.com>
      Cc: Jun Nakajima <jun.nakajima@intel.com>
      93b1eab3
  18. 15 10月, 2007 1 次提交
    • D
      x86: fix missing include for vsyscall · b097976e
      Dave Jones 提交于
       > Maybe I just picked a bad time to try, but...
       > 
       > arch/x86/kernel/alternative.c: In function 'apply_alternatives':
       > arch/x86/kernel/alternative.c:191: error: 'VSYSCALL_START' undeclared (first use in this function)
       > arch/x86/kernel/alternative.c:191: error: (Each undeclared identifier is reported only once
       > arch/x86/kernel/alternative.c:191: error: for each function it appears in.)
       > arch/x86/kernel/alternative.c:191: error: 'VSYSCALL_END' undeclared (first use in this function)
       > make[1]: *** [arch/x86/kernel/alternative.o] Error 1
       > make: *** [arch/x86/kernel] Error 2
      
      Try this.
      
      Include missing header for vsyscall.
      Signed-off-by: NDave Jones <davej@redhat.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      b097976e
  19. 11 10月, 2007 1 次提交
  20. 11 9月, 2007 1 次提交
  21. 19 8月, 2007 1 次提交
    • C
      x86: properly initialize temp insn buffer for paravirt patching · d34fda4a
      Chris Wright 提交于
      With commit ab144f5e the patching code
      now collects the complete new instruction stream into a temp buffer
      before finally patching in the new insns.  In some cases the paravirt
      patchers will choose to leave the patch site unpatched (length mismatch,
      clobbers mismatch, etc).
      
      This causes the new patching code to copy an uninitialized temp buffer,
      i.e.  garbage, to the callsite.  Simply make sure to always initialize
      the buffer with the original instruction stream.  A better fix is to
      audit all the patchers and return proper length so that apply_paravirt()
      can skip copies when we leave the patch site untouched.
      Signed-off-by: NChris Wright <chrisw@sous-sol.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d34fda4a
  22. 12 8月, 2007 2 次提交
  23. 27 7月, 2007 1 次提交
  24. 23 7月, 2007 2 次提交
    • A
      x86: Stop MCEs and NMIs during code patching · 8f4e956b
      Andi Kleen 提交于
      When a machine check or NMI occurs while multiple byte code is patched
      the CPU could theoretically see an inconsistent instruction and crash.
      Prevent this by temporarily disabling MCEs and returning early in the
      NMI handler.
      
      Based on discussion with Mathieu Desnoyers.
      
      Cc: Mathieu Desnoyers <compudj@krystal.dyndns.org>
      Cc: Jeremy Fitzhardinge <jeremy@goop.org>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8f4e956b
    • A
      x86: Fix alternatives and kprobes to remap write-protected kernel text · 19d36ccd
      Andi Kleen 提交于
      Reenable kprobes and alternative patching when the kernel text is write
      protected by DEBUG_RODATA
      
      Add a general utility function to change write protected text.  The new
      function remaps the code using vmap to write it and takes care of CPU
      synchronization.  It also does CLFLUSH to make icache recovery faster.
      
      There are some limitations on when the function can be used, see the
      comment.
      
      This is a newer version that also changes the paravirt_ops code.
      text_poke also supports multi byte patching now.
      
      Contains bug fixes from Zach Amsden and suggestions from Mathieu
      Desnoyers.
      
      Cc: Jan Beulich <jbeulich@novell.com>
      Cc: Jeremy Fitzhardinge <jeremy@goop.org>
      Cc: Mathieu Desnoyers <compudj@krystal.dyndns.org>
      Cc: Zach Amsden <zach@vmware.com>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      19d36ccd
  25. 22 7月, 2007 1 次提交
  26. 07 5月, 2007 1 次提交
    • L
      Revert "[PATCH] x86: __pa and __pa_symbol address space separation" · e3ebadd9
      Linus Torvalds 提交于
      This was broken.  It adds complexity, for no good reason.  Rather than
      separate __pa() and __pa_symbol(), we should deprecate __pa_symbol(),
      and preferably __pa() too - and just use "virt_to_phys()" instead, which
      is more readable and has nicer semantics.
      
      However, right now, just undo the separation, and make __pa_symbol() be
      the exact same as __pa().  That fixes the bugs this patch introduced,
      and we can do the fairly obvious cleanups later.
      
      Do the new __phys_addr() function (which is now the actual workhorse for
      the unified __pa()/__pa_symbol()) as a real external function, that way
      all the potential issues with compile/link-time optimizations of
      constant symbol addresses go away, and we can also, if we choose to, add
      more sanity-checking of the argument.
      
      Cc: Eric W. Biederman <ebiederm@xmission.com>
      Cc: Vivek Goyal <vgoyal@in.ibm.com>
      Cc: Andi Kleen <ak@suse.de>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e3ebadd9
  27. 03 5月, 2007 2 次提交