1. 25 5月, 2008 7 次提交
    • P
      x86 boot: change sanitize_e820_map parameter from byte to int to allow bigger memory maps · 6e9bcc79
      Paul Jackson 提交于
      The map size counter passed into, and back out of, sanitize_e820_map(),
      was an eight bit type (char or u8), as derived from its origins in
      legacy BIOS E820 structures.  This patch changes that type to an 'int',
      to allow this sanitize routine to also be used on larger maps (larger
      than the 256 count that fits in a char).  The legacy BIOS E820 interface
      of course does not change; that remains at 8 bits for this count, holding
      up to E820MAX == 128 entries.  But the kernel internals can handle more
      when those additional memory map entries are passed from the BIOS via
      EFI interfaces.
      Signed-off-by: NPaul Jackson <pj@sgi.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      6e9bcc79
    • P
      x86 boot: extend some internal memory map arrays to handle larger EFI input · 028b7858
      Paul Jackson 提交于
      Extend internal boot time memory tables to allow for up to
      three entries per node, which may be larger than the 128 E820MAX
      entries handled by the legacy BIOS E820 interface.  The EFI
      interface, if present, is capable of passing memory map
      entries for these larger node counts.
      
      This patch requires an earlier patch that rewrote code depending
      on these array sizes from using E820MAX explicitly to size loops,
      to instead using ARRAY_SIZE() of the applicable array.
      
      Another patch following this one will provide the code to pick
      up additional memory entries passed via the EFI interface from
      the BIOS and insert them in the following, now enlarged, arrays.
      Signed-off-by: NPaul Jackson <pj@sgi.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      028b7858
    • 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
    • P
      x86 boot: include missing smp.h header · e3f8ba81
      Paul Jackson 提交于
      The patch:
          x86: convert cpu_to_apicid to be a per cpu variable
      introduced a dependency of ipi.h on smp.h in x86
      builds with an allnoconfig.  Including smp.h in ipi.h
      fixes the build error:
          In file included from arch/x86/kernel/traps_64.c:48:
          include/asm/ipi.h: In function 'send_IPI_mask_sequence':
          include/asm/ipi.h:114: error: 'per_cpu__x86_cpu_to_apicid' undeclared (first use in this function)
      Signed-off-by: NPaul Jackson <pj@sgi.com>
      Cc: Mike Travis <travis@sgi.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      e3f8ba81
    • Y
      x86: make e820.c to have common functions · b79cd8f1
      Yinghai Lu 提交于
      remove the duplicated copy of these functions.
      Signed-off-by: NYinghai Lu <yhlu.kernel@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      b79cd8f1
    • Y
      x86: fix trimming e820 with MTRR holes. · 42651f15
      Yinghai Lu 提交于
      converting MTRR layout from continous to discrete, some time could run out of
      MTRRs. So add gran_sizek to prevent that by dumpping small RAM piece less than
      gran_sizek.
      
      previous trimming only can handle highest_pfn from mtrr to end_pfn from e820.
      when have more than 4g RAM installed, there will be holes below 4g. so need to
      check ram below 4g is coverred well.
      
      need to be applied after
      	[PATCH] x86: mtrr cleanup for converting continuous to discrete layout v7
      Signed-off-by: NYinghai Lu <yinghai.lu@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      42651f15
    • A
      x86: move i386 memory setup code to e820_32.c · 0dbfafa5
      Alexander van Heukelum 提交于
      The x86_64 code has centralized the memory setup code in
      e820_64.c. This patch copies that approach to i386:
      
      - early_param("mem", ...) parsing is moved from
      setup_32.c to e820_32.c.
      
      - setup_memory_map() and finish_e820_parsing() are
      factored out from setup_arch(), and declarations
      are added to e820_32.h.
      
      - print_memory_map() is made static and removed from
      e820_32.h.
      
      - user_defined_memmap is marked as __initdata.
      Signed-off-by: NAlexander van Heukelum <heukelum@fastmail.fm>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      0dbfafa5
  2. 20 5月, 2008 9 次提交
  3. 18 5月, 2008 1 次提交
  4. 15 5月, 2008 1 次提交
  5. 11 5月, 2008 4 次提交
  6. 08 5月, 2008 3 次提交
  7. 07 5月, 2008 1 次提交
    • H
      x86: fix PAE pmd_bad bootup warning · aeed5fce
      Hugh Dickins 提交于
      Fix warning from pmd_bad() at bootup on a HIGHMEM64G HIGHPTE x86_32.
      
      That came from 9fc34113 x86: debug pmd_bad();
      but we understand now that the typecasting was wrong for PAE in the previous
      version: pagetable pages above 4GB looked bad and stopped Arjan from booting.
      
      And revert that cded932b x86: fix pmd_bad
      and pud_bad to support huge pages.  It was the wrong way round: we shouldn't
      weaken every pmd_bad and pud_bad check to let huge pages slip through - in
      part they check that we _don't_ have a huge page where it's not expected.
      
      Put the x86 pmd_bad() and pud_bad() definitions back to what they have long
      been: they can be improved (x86_32 should use PTE_MASK, to stop PAE thinking
      junk in the upper word is good; and x86_64 should follow x86_32's stricter
      comparison, to stop thinking any subset of required bits is good); but that
      should be a later patch.
      
      Fix Hans' good observation that follow_page() will never find pmd_huge()
      because that would have already failed the pmd_bad test: test pmd_huge in
      between the pmd_none and pmd_bad tests.  Tighten x86's pmd_huge() check?
      No, once it's a hugepage entry, it can get quite far from a good pmd: for
      example, PROT_NONE leaves it with only ACCESSED of the KERN_PGTABLE bits.
      
      However... though follow_page() contains this and another test for huge
      pages, so it's nice to keep it working on them, where does it actually get
      called on a huge page?  get_user_pages() checks is_vm_hugetlb_page(vma) to
      to call alternative hugetlb processing, as does unmap_vmas() and others.
      Signed-off-by: NHugh Dickins <hugh@veritas.com>
      Earlier-version-tested-by: NIngo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Jeff Chua <jeff.chua.linux@gmail.com>
      Cc: Hans Rosenfeld <hans.rosenfeld@amd.com>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      aeed5fce
  8. 05 5月, 2008 1 次提交
  9. 04 5月, 2008 5 次提交
  10. 03 5月, 2008 1 次提交
  11. 01 5月, 2008 7 次提交
    • J
      dmi: clean-up dmi helper declarations · ef3fb66c
      Jean Delvare 提交于
      The declaration of dmi helper functions is a bit messy and inconsistent at the
      moment:
      
      * On ia64 they are declared in <asm/io.h>.
      * On x86-64 they are declared in <asm/dmi.h>.
      * On i386 they are declared both in <asm/io.h> and <asm/dmi.h>.
      
      Fix the header files so that the dmi helper functions are consistently
      defined in <asm/dmi.h>.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Cc: Matt Domsch <Matt_Domsch@dell.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ef3fb66c
    • R
      remove div_long_long_rem · f8bd2258
      Roman Zippel 提交于
      x86 is the only arch right now, which provides an optimized for
      div_long_long_rem and it has the downside that one has to be very careful that
      the divide doesn't overflow.
      
      The API is a little akward, as the arguments for the unsigned divide are
      signed.  The signed version also doesn't handle a negative divisor and
      produces worse code on 64bit archs.
      
      There is little incentive to keep this API alive, so this converts the few
      users to the new API.
      Signed-off-by: NRoman Zippel <zippel@linux-m68k.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: john stultz <johnstul@us.ibm.com>
      Cc: Christoph Lameter <clameter@sgi.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f8bd2258
    • R
      rename div64_64 to div64_u64 · 6f6d6a1a
      Roman Zippel 提交于
      Rename div64_64 to div64_u64 to make it consistent with the other divide
      functions, so it clearly includes the type of the divide.  Move its definition
      to math64.h as currently no architecture overrides the generic implementation.
       They can still override it of course, but the duplicated declarations are
      avoided.
      Signed-off-by: NRoman Zippel <zippel@linux-m68k.org>
      Cc: Avi Kivity <avi@qumranet.com>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Patrick McHardy <kaber@trash.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      6f6d6a1a
    • R
      introduce explicit signed/unsigned 64bit divide · 2418f4f2
      Roman Zippel 提交于
      The current do_div doesn't explicitly say that it's unsigned and the signed
      counterpart is missing, which is e.g.  needed when dealing with time values.
      
      This introduces 64bit signed/unsigned divide functions which also attempts to
      cleanup the somewhat awkward calling API, which often requires the use of
      temporary variables for the dividend.  To avoid the need for temporary
      variables everywhere for the remainder, each divide variant also provides a
      version which doesn't return the remainder.
      
      Each architecture can now provide optimized versions of these function,
      otherwise generic fallback implementations will be used.
      
      As an example I provided an alternative for the current x86 divide, which
      avoids the asm casts and using an union allows gcc to generate better code.
      It also avoids the upper divde in a few more cases, where the result is known
      (i.e.  upper quotient is zero).
      Signed-off-by: NRoman Zippel <zippel@linux-m68k.org>
      Cc: john stultz <johnstul@us.ibm.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2418f4f2
    • H
      x86: fix HT cpu booting on 32-bit · 5f464707
      Hugh Dickins 提交于
      Since recent smpboot 32/64-bit merge, my dual Xeon with HT has been
      booting only 2 of its 4 cpus (when running an i386 kernel; but x86_64
      is okay).  J.A. Magallón reports the same.
      
       native_cpu_up: bad cpu 2
       native_cpu_up: bad cpu 3
      
      The mach-default cpu_present_to_apicid() was just returning cpu number
      (2, 3) instead of apicid (6, 7): looks like we now need the x86_64 code
      even for the i386 case.
      
      Comparing with other versions of cpu_present_to_apicid(), it seems a
      good idea to include an NR_CPUS test too, since cpu_present() doesn't
      include that; but that wasn't a problem here, and may no problem at all.
      
      Prior to that smpboot merge, my Xeon booted the two HT siblings on one
      physical first, then the two siblings on the other physical after - when
      i386, but alternated them when x86_64.  Since the merge, the x86_64
      sequence is unchanged, but the i386 sequence is now like x86_64.
      
      I prefer this consistency, and I prefer the new sequence: booting with
      maxcpus=2 then uses the independent physicals without HT sharing.
      Signed-off-by: NHugh Dickins <hugh@veritas.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      5f464707
    • I
      x86 VISWS: build fix · 3e8f7e35
      Ingo Molnar 提交于
      the 'reboot_force' flag is a notion that non-PC subarchitectures do
      not have.
      
      also, unify the X86_BIOS_REBOOT option between 32-bit and 64-bit
      and get rid of a few unnecessary Kconfig and Makefile complications
      that way.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      3e8f7e35
    • A
      x86: remove Xgt_desc_struct · 9cbfe200
      Adrian Bunk 提交于
      The comment says it should have been removed in 2.6.25.
      Signed-off-by: NAdrian Bunk <bunk@kernel.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      9cbfe200