1. 07 10月, 2008 4 次提交
  2. 05 10月, 2008 1 次提交
  3. 01 10月, 2008 2 次提交
    • Z
      x86, vmi: fix broken LDT access · dc63b526
      Zachary Amsden 提交于
      This one took a long time to rear up because LDT usage is not very
      common, but the bug is quite serious.  It got introduced along with
      another bug, already fixed, by 75b8bb3e
      
      After investigating a JRE failure, I found this bug was introduced a long time
      ago, and had already managed to survive another bugfix which occurred on the
      same line.  The result is a total failure of the JRE due to LDT selectors not
      working properly.
      Signed-off-by: NZachary Amsden <zach@vmware.com>
      Cc: Glauber de Oliveira Costa <gcosta@redhat.com>
      Cc: stable@kernel.org
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      dc63b526
    • Z
      x86: Fix broken LDT access in VMI · de59985e
      Zachary Amsden 提交于
      After investigating a JRE failure, I found this bug was introduced a
      long time ago, and had already managed to survive another bugfix which
      occurred on the same line.  The result is a total failure of the JRE due
      to LDT selectors not working properly.
      
      This one took a long time to rear up because LDT usage is not very
      common, but the bug is quite serious.  It got introduced along with
      another bug, already fixed, by 75b8bb3eSigned-off-by: NZachary Amsden <zach@vmware.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Glauber de Oliveira Costa <gcosta@redhat.com>
      Cc: <stable@kernel.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      de59985e
  4. 30 9月, 2008 1 次提交
  5. 26 9月, 2008 2 次提交
    • J
      kgdb, x86_64: fix PS CS SS registers in gdb serial · 703a1edc
      Jason Wessel 提交于
      On x86_64 the gdb serial register structure defines the PS (also known
      as eflags), CS and SS registers as 4 bytes entities.
      
      This patch splits the x86_64 regnames enum into a 32 and 64 version to
      account for the 32 bit entities in the gdb serial packets.
      
      Also the program counter is properly filled in for the sleeping
      threads.
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      703a1edc
    • J
      kgdb, x86, arm, mips, powerpc: ignore user space single stepping · d7161a65
      Jason Wessel 提交于
      On the x86 arch, user space single step exceptions should be ignored
      if they occur in the kernel space, such as ptrace stepping through a
      system call.
      
      First check if it is kgdb that is executing a single step, then ensure
      it is not an accidental traversal into the user space, while in kgdb,
      any other time the TIF_SINGLESTEP is set, kgdb should ignore the
      exception.
      
      On x86, arm, mips and powerpc, the kgdb_contthread usage was
      inconsistent with the way single stepping is implemented in the kgdb
      core.  The arch specific stub should always set the
      kgdb_cpu_doing_single_step correctly if it is single stepping.  This
      allows kgdb to correctly process an instruction steps if ptrace
      happens to be requesting an instruction step over a system call.
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      d7161a65
  6. 24 9月, 2008 2 次提交
  7. 23 9月, 2008 4 次提交
  8. 18 9月, 2008 2 次提交
  9. 17 9月, 2008 1 次提交
  10. 12 9月, 2008 1 次提交
    • J
      x86: fix possible x86_64 and EFI regression · 0ad5bce7
      Jeremy Fitzhardinge 提交于
      Russ Anderson reported a boot crash with EFI and latest mainline:
      
       BIOS-e820: 00000000fffa0000 - 00000000fffac000 (reserved)
      Pid: 0, comm: swapper Not tainted 2.6.27-rc5-00100-gec0c15af-dirty #5
      
      Call Trace:
       [<ffffffff80849195>] early_idt_handler+0x55/0x69
       [<ffffffff80313e52>] __memcpy+0x12/0xa4
       [<ffffffff80859015>] efi_init+0xce/0x932
       [<ffffffff80869c83>] setup_early_serial8250_console+0x2d/0x36a
       [<ffffffff80238688>] __insert_resource+0x18/0xc8
       [<ffffffff8084f6de>] setup_arch+0x3a7/0x632
       [<ffffffff808499ed>] start_kernel+0x91/0x367
       [<ffffffff80849393>] x86_64_start_kernel+0xe3/0xe7
       [<ffffffff808492b0>] x86_64_start_kernel+0x0/0xe7
      
       RIP 0x10
      
      Such a crash is possible if the CPU in this system is a 64-bit
      processor which doesn't support NX (ie, old Intel P4 -based64-bit
      processors).
      
      Certainly, if we support such processors, then we should start with
      _PAGE_NX initially clear in __supported_pte_flags, and then set it once
      we've established that the processor does indeed support NX.  That will
      prevent early_ioremap - or anything else - from trying to set it.
      
      The simple fix is to simply call check_efer() earlier.
      Reported-by: NRuss Anderson <rja@sgi.com>
      Signed-off-by: NJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      0ad5bce7
  11. 10 9月, 2008 2 次提交
    • J
      arch/x86/kernel/kdebugfs.c: introduce missing kfree · f461a1d8
      Julia Lawall 提交于
      Error handling code following a kmalloc should free the allocated data.
      Note that at the point of the change, node has not yet been stored in d, so
      it is not affected by the existing cleanup code.
      
      The semantic match that finds the problem is as follows:
      (http://www.emn.fr/x-info/coccinelle/)
      
      // <smpl>
      @r exists@
      local idexpression x;
      statement S;
      expression E;
      identifier f,l;
      position p1,p2;
      expression *ptr != NULL;
      @@
      
      (
      if ((x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...)) == NULL) S
      |
      x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...);
      ...
      if (x == NULL) S
      )
      <... when != x
           when != if (...) { <+...x...+> }
      x->f = E
      ...>
      (
       return \(0\|<+...x...+>\|ptr\);
      |
       return@p2 ...;
      )
      
      @script:python@
      p1 << r.p1;
      p2 << r.p2;
      @@
      
      print "* file: %s kmalloc %s return %s" % (p1[0].file,p1[0].line,p2[0].line)
      // </smpl>
      Signed-off-by: NJulia Lawall <julia@diku.dk>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      f461a1d8
    • P
      x86: fix memmap=exactmap boot argument · d6be118a
      Prarit Bhargava 提交于
      When using kdump modifying the e820 map is yielding strange results.
      
      For example starting with
      
       BIOS-provided physical RAM map:
       BIOS-e820: 0000000000000100 - 0000000000093400 (usable)
       BIOS-e820: 0000000000093400 - 00000000000a0000 (reserved)
       BIOS-e820: 0000000000100000 - 000000003fee0000 (usable)
       BIOS-e820: 000000003fee0000 - 000000003fef3000 (ACPI data)
       BIOS-e820: 000000003fef3000 - 000000003ff80000 (ACPI NVS)
       BIOS-e820: 000000003ff80000 - 0000000040000000 (reserved)
       BIOS-e820: 00000000e0000000 - 00000000f0000000 (reserved)
       BIOS-e820: 00000000fec00000 - 00000000fec10000 (reserved)
       BIOS-e820: 00000000fee00000 - 00000000fee01000 (reserved)
       BIOS-e820: 00000000ff000000 - 0000000100000000 (reserved)
      
      and booting with args
      
      memmap=exactmap memmap=640K@0K memmap=5228K@16384K memmap=125188K@22252K memmap=76K#1047424K memmap=564K#1047500K
      
      resulted in:
      
       user-defined physical RAM map:
       user: 0000000000000000 - 0000000000093400 (usable)
       user: 0000000000093400 - 00000000000a0000 (reserved)
       user: 0000000000100000 - 000000003fee0000 (usable)
       user: 000000003fee0000 - 000000003fef3000 (ACPI data)
       user: 000000003fef3000 - 000000003ff80000 (ACPI NVS)
       user: 000000003ff80000 - 0000000040000000 (reserved)
       user: 00000000e0000000 - 00000000f0000000 (reserved)
       user: 00000000fec00000 - 00000000fec10000 (reserved)
       user: 00000000fee00000 - 00000000fee01000 (reserved)
       user: 00000000ff000000 - 0000000100000000 (reserved)
      
      But should have resulted in:
      
       user-defined physical RAM map:
       user: 0000000000000000 - 00000000000a0000 (usable)
       user: 0000000001000000 - 000000000151b000 (usable)
       user: 00000000015bb000 - 0000000008ffc000 (usable)
       user: 000000003fee0000 - 000000003ff80000 (ACPI data)
      
      This is happening because of an improper usage of strcmp() in the
      e820 parsing code.  The strcmp() always returns !0 and never resets the
      value for e820.nr_map and returns an incorrect user-defined map.
      
      This patch fixes the problem.
      Signed-off-by: NPrarit Bhargava <prarit@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      d6be118a
  12. 07 9月, 2008 2 次提交
  13. 06 9月, 2008 6 次提交
  14. 05 9月, 2008 1 次提交
  15. 04 9月, 2008 2 次提交
  16. 03 9月, 2008 2 次提交
    • L
      Split up PIT part of TSC calibration from native_calibrate_tsc · ec0c15af
      Linus Torvalds 提交于
      The TSC calibration function is still very complicated, but this makes
      it at least a little bit less so by moving the PIT part out into a
      helper function of its own.
      Tested-by: NLarry Finger <Larry.Finger@lwfinger.net>
      Signed-of-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ec0c15af
    • T
      [x86] Fix TSC calibration issues · fbb16e24
      Thomas Gleixner 提交于
      Larry Finger reported at http://lkml.org/lkml/2008/9/1/90:
      An ancient laptop of mine started throwing errors from b43legacy when
      I started using 2.6.27 on it. This has been bisected to commit bfc0f594
      "x86: merge tsc calibration".
      
      The unification of the TSC code adopted mostly the 64bit code, which
      prefers PMTIMER/HPET over the PIT calibration.
      
      Larrys system has an AMD K6 CPU. Such systems are known to have
      PMTIMER incarnations which run at double speed. This results in a
      miscalibration of the TSC by factor 0.5. So the resulting calibrated
      CPU/TSC speed is half of the real CPU speed, which means that the TSC
      based delay loop will run half the time it should run. That might
      explain why the b43legacy driver went berserk.
      
      On the other hand we know about systems, where the PIT based
      calibration results in random crap due to heavy SMI/SMM
      disturbance. On those systems the PMTIMER/HPET based calibration logic
      with SMI detection shows better results.
      
      According to Alok also virtualized systems suffer from the PIT
      calibration method.
      
      The solution is to use a more wreckage aware aproach than the current
      either/or decision.
      
      1) reimplement the retry loop which was dropped from the 32bit code
      during the merge. It repeats the calibration and selects the lowest
      frequency value as this is probably the closest estimate to the real
      frequency
      
      2) Monitor the delta of the TSC values in the delay loop which waits
      for the PIT counter to reach zero. If the maximum value is
      significantly different from the minimum, then we have a pretty safe
      indicator that the loop was disturbed by an SMI.
      
      3) keep the pmtimer/hpet reference as a backup solution for systems
      where the SMI disturbance is a permanent point of failure for PIT
      based calibration
      
      4) do the loop iteration for both methods, record the lowest value and
      decide after all iterations finished.
      
      5) Set a clear preference to PIT based calibration when the result
      makes sense.
      
      The implementation does the reference calibration based on
      HPET/PMTIMER around the delay, which is necessary for the PIT anyway,
      but keeps separate TSC values to ensure the "independency" of the
      resulting calibration values.
      
      Tested on various 32bit/64bit machines including Geode 266Mhz, AMD K6
      (affected machine with a double speed pmtimer which I grabbed out of
      the dump), Pentium class machines and AMD/Intel 64 bit boxen.
      Bisected-by: NLarry Finger <Larry.Finger@lwfinger.net>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Tested-by: NLarry Finger <Larry.Finger@lwfinger.net>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      fbb16e24
  17. 26 8月, 2008 4 次提交
  18. 25 8月, 2008 1 次提交