1. 25 5月, 2008 1 次提交
    • P
      x86 boot: proper use of ARRAY_SIZE instead of repeated E820MAX constant · c3965bd1
      Paul Jackson 提交于
      This patch is motivated by a subsequent patch which will allow for more
      memory map entries on EFI supported systems than can be passed via the x86
      legacy BIOS E820 interface.  The legacy interface is limited to E820MAX ==
      128 memory entries, and that "E820MAX" manifest constant was used as the
      size for several arrays and loops over those arrays.
      
      The primary change in this patch is to change code loop sizes over those
      arrays from using the constant E820MAX, to using the ARRAY_SIZE() macro
      evaluated for the array being looped.  That way, a subsequent patch can
      change the size of some of these arrays, without breaking this code.
      
      This patch also adds a parameter to the sanitize_e820_map() routine,
      which had an implicit size for the array passed it of E820MAX entries.
      This new parameter explicitly passes the size of said array.  Once again,
      this will allow a subsequent patch to change that array size for some
      calls to sanitize_e820_map() without breaking the code.
      
      As part of enhancing the sanitize_e820_map() interface this way, I further
      combined the unnecessarily distinct x86_32 and x86_64 declarations for
      this routine into a single, commonly used, declaration.
      
      This patch in itself should make no difference to the resulting kernel
      binary.
      
      [ mingo@elte.hu: merged to -tip ]
      Signed-off-by: NPaul Jackson <pj@sgi.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      c3965bd1
  2. 20 4月, 2008 1 次提交
  3. 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
  4. 11 10月, 2007 1 次提交
  5. 29 9月, 2007 1 次提交
    • H
      [x86 setup] Correct the SMAP check for INT 0x15, AX=0xe820 · 4ee5b10a
      H. Peter Anvin 提交于
      The e820 probe code was checking %edx, not %eax, for the SMAP
      signature on return.  This worked on *almost* all systems, since %edx
      still contained SMAP from the call on entry, but on a handful of
      systems it failed -- plus, we would have missed real mismatches.
      
      The error output is "=d" to make sure gcc knows %edx is clobbered
      here.
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      4ee5b10a
  6. 27 9月, 2007 1 次提交
    • H
      [x86 setup] Handle case of improperly terminated E820 chain · 2efa33f8
      H. Peter Anvin 提交于
      At least one system (a Geode system with a Digital Logic BIOS) has
      been found which suddenly stops reporting the SMAP signature when
      reading the E820 memory chain.  We can't know what, exactly, broke in
      the BIOS, so if we detect this situation, declare the E820 data
      unusable and fall back to E801.
      
      Also, revert to original behavior of always probing all memory
      methods; that way all the memory information is available to the
      kernel.
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      Cc: Jordan Crouse <jordan.crouse@amd.com>
      Cc: Joerg Pommnitz <pommnitz@yahoo.com>
      2efa33f8
  7. 13 7月, 2007 1 次提交