1. 13 8月, 2008 1 次提交
    • J
      x86: fix setup code crashes on my old 486 box · 7b27718b
      Joerg Roedel 提交于
      yesterday I tried to reactivate my old 486 box and wanted to install a
      current Linux with latest kernel on it. But it turned out that the
      latest kernel does not boot because the machine crashes early in the
      setup code.
      
      After some debugging it turned out that the problem is the query_ist()
      function. If this interrupt with that function is called the machine
      simply locks up. It looks like a BIOS bug. Looking for a workaround for
      this problem I wrote the attached patch. It checks for the CPUID
      instruction and if it is not implemented it does not call the speedstep
      BIOS function. As far as I know speedstep should be available since some
      Pentium earliest.
      
      Alan Cox observed that it's available since the Pentium II, so cpuid
      levels 4 and 5 can be excluded altogether.
      
      H. Peter Anvin cleaned up the code some more:
      
      > Right in concept, but I dislike the implementation (duplication of the
      > CPU detect code we already have).  Could you try this patch and see if
      > it works for you?
      
      which, with a small modification to fix a build error with it the
      resulting kernel boots on my machine.
      Signed-off-by: NJoerg Roedel <joro@8bytes.org>
      Signed-off-by: N"H. Peter Anvin" <hpa@zytor.com>
      Cc: <stable@kernel.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      7b27718b
  2. 26 7月, 2008 1 次提交
    • T
      inflate: refactor inflate malloc code · 2d6ffcca
      Thomas Petazzoni 提交于
      Inflate requires some dynamic memory allocation very early in the boot
      process and this is provided with a set of four functions:
      malloc/free/gzip_mark/gzip_release.
      
      The old inflate code used a mark/release strategy rather than implement
      free.  This new version instead keeps a count on the number of outstanding
      allocations and when it hits zero, it resets the malloc arena.
      
      This allows removing all the mark and release implementations and unifying
      all the malloc/free implementations.
      
      The architecture-dependent code must define two addresses:
       - free_mem_ptr, the address of the beginning of the area in which
         allocations should be made
       - free_mem_end_ptr, the address of the end of the area in which
         allocations should be made. If set to 0, then no check is made on
         the number of allocations, it just grows as much as needed
      
      The architecture-dependent code can also provide an arch_decomp_wdog()
      function call.  This function will be called several times during the
      decompression process, and allow to notify the watchdog that the system is
      still running.  If an architecture provides such a call, then it must
      define ARCH_HAS_DECOMP_WDOG so that the generic inflate code calls
      arch_decomp_wdog().
      
      Work initially done by Matt Mackall, updated to a recent version of the
      kernel and improved by me.
      
      [akpm@linux-foundation.org: coding-style fixes]
      Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Cc: Matt Mackall <mpm@selenic.com>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Mikael Starvik <mikael.starvik@axis.com>
      Cc: Jesper Nilsson <jesper.nilsson@axis.com>
      Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Acked-by: NPaul Mundt <lethal@linux-sh.org>
      Acked-by: NYoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2d6ffcca
  3. 19 7月, 2008 1 次提交
  4. 18 7月, 2008 2 次提交
    • H
      x86: unify and correct the GDT_ENTRY() macro · f910d134
      H. Peter Anvin 提交于
      Impact: None (cleanup only)
      
      Merge the GDT_ENTRY() macro between arch/x86/boot/pm.c and
      arch/x86/kernel/acpi/sleep.c and put the new one in
      <asm-x86/segment.h>.
      
      While we're at it, correct the bitmasks for the limit and flags.  The
      new version relies on using ULL constants in order to cause type
      promotion rather than explicit casts; this avoids having to include
      <linux/types.h> in <asm-x86/segments.h>.
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      f910d134
    • H
      x86: unify and correct the GDT_ENTRY() macro · 4fdf08b5
      H. Peter Anvin 提交于
      Merge the GDT_ENTRY() macro between arch/x86/boot/pm.c and
      arch/x86/kernel/acpi/sleep.c and put the new one in
      <asm-x86/segment.h>.
      
      While we're at it, correct the bitmasks for the limit and flags.  The
      new version relies on using ULL constants in order to cause type
      promotion rather than explicit casts; this avoids having to include
      <linux/types.h> in <asm-x86/segments.h>.
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      4fdf08b5
  5. 03 7月, 2008 1 次提交
  6. 01 7月, 2008 2 次提交
    • H
      x86: fix regression: boot failure on AMD Elan TS-5500 · 2ee2394b
      H. Peter Anvin 提交于
      Jeremy Fitzhardinge wrote:
      >
      > Maybe it really does require the far jump immediately after setting PE
      > in cr0...
      >
      > Hm, I don't remember this paragraph being in vol 3a, section 8.9.1
      > before.  Is it a recent addition?
      >
      >    Random failures can occur if other instructions exist between steps
      >    3 and 4 above.  Failures will be readily seen in some situations,
      >    such as when instructions that reference memory are inserted between
      >    steps 3 and 4 while in system management mode.
      >
      
      I don't remember that, either.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      2ee2394b
    • H
      x86: remove arbitrary ELF section limit in i386 relocatable kernel · 908ec7af
      H. Peter Anvin 提交于
      Impact: build failure in maximal configurations
      
      The 32-bit x86 relocatable kernel requires an auxilliary host program
      to process the relocations.  This program had a hard-coded arbitrary
      limit of a 100 ELF sections.  Instead of a hard-coded limit, allocate
      the structures dynamically.
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      Acked-by: NVivek Goyal <vgoyal@redhat.com>
      908ec7af
  7. 28 6月, 2008 1 次提交
    • H
      x86: setup: issue a null command after enabling A20 via KBC · aa60d13f
      H. Peter Anvin 提交于
      Apparently, DOS and possibly other legacy operating systems issued a
      null command to the keyboard controller after toggling A20,
      specifically "pulse output pins" with no output pins specified.  This
      was presumably done for synchronization reasons.  This has made it
      into at least the UHCI spec, and it has been found to cause
      compatibility problems when "legacy USB" is enabled (which it almost
      always is) to not have this byte sent.
      
      It is *NOT* clear if any of these compatibility problems has any
      effect on Linux.  However, for maximum compatibility, issue this null
      command after togging A20 through the KBC.
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      aa60d13f
  8. 13 6月, 2008 1 次提交
  9. 10 6月, 2008 1 次提交
  10. 31 5月, 2008 2 次提交
  11. 29 5月, 2008 1 次提交
  12. 25 5月, 2008 4 次提交
  13. 23 5月, 2008 1 次提交
  14. 05 5月, 2008 1 次提交
  15. 29 4月, 2008 1 次提交
  16. 27 4月, 2008 1 次提交
  17. 26 4月, 2008 1 次提交
  18. 20 4月, 2008 3 次提交
  19. 17 4月, 2008 10 次提交
  20. 07 3月, 2008 1 次提交
    • P
      x86-boot: don't request VBE2 information · 1722770f
      Peter Korsgaard 提交于
      The new x86 setup code (4fd06960) broke booting on an old P3/500MHz
      with an onboard Voodoo3 of mine. After debugging it, it turned out
      to be caused by the fact that the vesa probing now asks for VBE2 data.
      
      Disassembing the video BIOS shows that it overflows the vesa_general_info
      structure when VBE2 data is requested because the source addresses for the
      information strings which get strcpy'ed to the buffer lie outside the 32K
      BIOS code (and hence contain long sequences of 0xff's).
      
      E.G.:
      
      get_vbe_controller_info:
      00002A9C  60                pushaw
      00002A9D  1E                push ds
      00002A9E  0E                push cs
      00002A9F  1F                pop ds
      00002AA0  2BC9              sub cx,cx
      00002AA2  6626813D56424532  cmp dword [es:di],0x32454256 ; "VBE2"
      00002AAA  7501              jnz .1
      00002AAC  41                inc cx
      .1:
      00002AAD  51                push cx
      00002AAE  B91400            mov cx,0x14
      00002AB1  BED47F            mov si, controller_header
      00002AB4  57                push di
      00002AB5  F3A4              rep movsb ; copy vbe1.2 header
      
      00002AB7  B9EC00            mov cx,0xec
      00002ABA  2AC0              sub al,al
      00002ABC  F3AA              rep stosb ; zero pad remainder
      
      00002ABE  5F                pop di
      00002ABF  E8EB0D            call word get_memory
      00002AC2  C1E002            shl ax,0x2
      00002AC5  26894512          mov [es:di+0x12],ax ; total memory
      00002AC9  26C745040003      mov word [es:di+0x4],0x300 ; VBE version
      00002ACF  268C4D08          mov [es:di+0x8],cs
      00002AD3  268C4D10          mov [es:di+0x10],cs
      00002AD7  59                pop cx
      00002AD8  E361              jcxz .done ; VBE2 requested?
      00002ADA  8D9D0001          lea bx,[di+0x100]
      00002ADE  53                push bx
      00002ADF  87DF              xchg bx,di ; di now points to 2nd half
      00002AE1  26C747140001      mov word [es:bx+0x14],0x100 ; sw rev
      
      00002AE7  26897F06          mov [es:bx+0x6],di		; oem string
      00002AEB  268C4708          mov [es:bx+0x8],es
      00002AEF  BE5280            mov si,0x8052 ; oem string
      00002AF2  E87A1B            call word strcpy
      
      00002AF5  26897F0E          mov [es:bx+0xe],di ; video mode list
      00002AF9  268C4710          mov [es:bx+0x10],es
      00002AFD  B91E00            mov cx,0x1e
      00002B00  BEE87F            mov si,vidmodes
      00002B03  F3A5              rep movsw
      
      00002B05  26897F16          mov [es:bx+0x16],di ; oem vendor
      00002B09  268C4718          mov [es:bx+0x18],es
      00002B0D  BE2480            mov si,0x8024 ; oem vendor
      00002B10  E85C1B            call word strcpy
      
      00002B13  26897F1A          mov [es:bx+0x1a],di ; oem product
      00002B17  268C471C          mov [es:bx+0x1c],es
      00002B1B  BE3880            mov si,0x8038 ; oem product
      00002B1E  E84E1B            call word strcpy
      
      00002B21  26897F1E          mov [es:bx+0x1e],di ; oem product rev
      00002B25  268C4720          mov [es:bx+0x20],es
      00002B29  BE4580            mov si,0x8045 ; oem product rev
      00002B2C  E8401B            call word strcpy
      
      00002B2F  58                pop ax
      00002B30  B90001            mov cx,0x100
      00002B33  2BCF              sub cx,di
      00002B35  03C8              add cx,ax
      00002B37  2AC0              sub al,al
      00002B39  F3AA              rep stosb ; zero pad
      .done:
      00002B3B  1F                pop ds
      00002B3C  61                popaw
      00002B3D  B84F00            mov ax,0x4f
      00002B40  C3                ret
      
      (The full BIOS can be found at http://peter.korsgaard.com/vgabios.bin
      if interested).
      
      The old setup code didn't ask for VBE2 info, and the new code doesn't
      actually do anything with the extra information, so the fix is to simply
      not request it. Other BIOS'es might have the same problem.
      Signed-off-by: NPeter Korsgaard <jacmet@sunsite.dk>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      1722770f
  21. 26 2月, 2008 1 次提交
    • H
      x86: handle BIOSes which terminate e820 with CF=1 and no SMAP · 829157be
      H. Peter Anvin 提交于
      The proper way to terminate the e820 chain is with %ebx == 0 on the
      last legitimate memory block.  However, several BIOSes don't do that
      and instead return error (CF = 1) when trying to read off the end of
      the list.  For this error return, %eax doesn't necessarily return the
      SMAP signature -- correctly so, since %ah should contain an error code
      in this case.
      
      To deal with some particularly broken BIOSes, we clear the entire e820
      chain if the SMAP signature is missing in the middle, indicating a
      plain insane e820 implementation.  However, we need to make the test
      for CF = 1 before the SMAP check.
      
      This fixes at least one HP laptop (nc6400) for which none of the
      memory-probing methods (e820, e801, 88) functioned fully according to
      spec.
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      829157be
  22. 10 2月, 2008 2 次提交