1. 26 2月, 2008 2 次提交
  2. 07 2月, 2008 1 次提交
    • Y
      x86: fix mttr trimming · 20651af9
      Yinghai Lu 提交于
      Pavel Emelyanov reported that his networking card did not work
      and bisected it down to:
      
      "
      The commit
      
        093af8d7
        x86_32: trim memory by updating e820
      
      broke my e1000 card: on loading driver says that
      
        e1000: probe of 0000:04:03.0 failed with error -5
      
      and the interface doesn't appear.
      "
      
      on a 32-bit kernel, base will overflow when try to do PAGE_SHIFT,
      and highest_addr will always less 4G.
      
      So use pfn instead of address to avoid the overflow when more than
      4g RAM is installed on a 32-bit kernel.
      
      Many thanks to Pavel Emelyanov for reporting and testing it.
      Bisected-by: NPavel Emelyanov <xemul@openvz.org>
      Signed-off-by: NYinghai Lu <yinghai.lu@sun.com>
      Tested-by: NPavel Emelyanov <xemul@openvz.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      20651af9
  3. 04 2月, 2008 2 次提交
  4. 30 1月, 2008 4 次提交
    • I
      x86: improve MTRR trimming messages · cd7d72bb
      Ingo Molnar 提交于
      improve the MTTR trimming messages and also trigger a WARN_ON()
      so that kerneloops.org can pick it up and categorize it.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      cd7d72bb
    • Y
      x86_32: trim memory by updating e820 · 093af8d7
      Yinghai Lu 提交于
      when MTRRs are not covering the whole e820 table, we need to trim the
      RAM and need to update e820.
      
      reuse some code on 64-bit as well.
      
      here need to add early_get_cap and use it in early_cpu_detect, and move
      mtrr_bp_init early.
      
      The code successfully trimmed the memory map on Justin's system:
      
      from:
      
       [    0.000000]  BIOS-e820: 0000000100000000 - 000000022c000000 (usable)
      
      to:
      
       [    0.000000]   modified: 0000000100000000 - 0000000228000000 (usable)
       [    0.000000]   modified: 0000000228000000 - 000000022c000000 (reserved)
      
      According to Justin it makes quite a difference:
      
      |  When I boot the box without any trimming it acts like a 286 or 386,
      |  takes about 10 minutes to boot (using raptor disks).
      Signed-off-by: NYinghai Lu <yinghai.lu@sun.com>
      Tested-by: NJustin Piszcz <jpiszcz@lucidpixels.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      093af8d7
    • J
      x86, 32-bit: trim memory not covered by wb mtrrs · 99fc8d42
      Jesse Barnes 提交于
      On some machines, buggy BIOSes don't properly setup WB MTRRs to cover all
      available RAM, meaning the last few megs (or even gigs) of memory will be
      marked uncached.  Since Linux tends to allocate from high memory addresses
      first, this causes the machine to be unusably slow as soon as the kernel
      starts really using memory (i.e.  right around init time).
      
      This patch works around the problem by scanning the MTRRs at boot and
      figuring out whether the current end_pfn value (setup by early e820 code)
      goes beyond the highest WB MTRR range, and if so, trimming it to match.  A
      fairly obnoxious KERN_WARNING is printed too, letting the user know that
      not all of their memory is available due to a likely BIOS bug.
      
      Something similar could be done on i386 if needed, but the boot ordering
      would be slightly different, since the MTRR code on i386 depends on the
      boot_cpu_data structure being setup.
      
      This patch fixes a bug in the last patch that caused the code to run on
      non-Intel machines (AMD machines apparently don't need it and it's untested
      on other non-Intel machines, so best keep it off).
      
      Further enhancements and fixes from:
      
        Yinghai Lu <Yinghai.Lu@Sun.COM>
        Andi Kleen <ak@suse.de>
      Signed-off-by: NJesse Barnes <jesse.barnes@intel.com>
      Tested-by: NJustin Piszcz <jpiszcz@lucidpixels.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: Yinghai Lu <yhlu.kernel@gmail.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>
      99fc8d42
    • P
      x86: mtrr use type bool [RESEND AGAIN] · 2d2ee8de
      Paul Jimenez 提交于
      This is a janitorish patch to 1) remove private TRUE/FALSE #def's in
      favor of using the standard enum from linux/stddef.h and 2) switch the
      variables holding those values to type 'bool' (from linux/types.h)
      since it both seems more appropriate and allows for potentially better
      optimization.
      
      As a truly minor aside, I removed a couple of comments documenting
      a 'do_safe' parameter that seems to no longer exist.
      Signed-off-by: NPaul Jimenez <pj@place.org>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      2d2ee8de
  5. 26 1月, 2008 1 次提交
    • G
      cpu-hotplug: replace lock_cpu_hotplug() with get_online_cpus() · 86ef5c9a
      Gautham R Shenoy 提交于
      Replace all lock_cpu_hotplug/unlock_cpu_hotplug from the kernel and use
      get_online_cpus and put_online_cpus instead as it highlights the
      refcount semantics in these operations.
      
      The new API guarantees protection against the cpu-hotplug operation, but
      it doesn't guarantee serialized access to any of the local data
      structures. Hence the changes needs to be reviewed.
      
      In case of pseries_add_processor/pseries_remove_processor, use
      cpu_maps_update_begin()/cpu_maps_update_done() as we're modifying the
      cpu_present_map there.
      Signed-off-by: NGautham R Shenoy <ego@in.ibm.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      86ef5c9a
  6. 10 11月, 2007 1 次提交
  7. 20 10月, 2007 1 次提交
  8. 18 10月, 2007 1 次提交
  9. 11 10月, 2007 1 次提交
  10. 22 7月, 2007 1 次提交
    • S
      i386: fix section mismatch warnings in mtrr · 9ef231a4
      Sam Ravnborg 提交于
      Following section mismatch warnings were reported by Andrey Borzenkov:
      
      WARNING: arch/i386/kernel/built-in.o - Section mismatch: reference to .init.text:amd_init_mtrr from .text between 'mtrr_bp_init' (at offset 0x967a) and 'mtrr_attrib_to_str'
      WARNING: arch/i386/kernel/built-in.o - Section mismatch: reference to .init.text:cyrix_init_mtrr from .text between 'mtrr_bp_init' (at offset 0x967f) and 'mtrr_attrib_to_str'
      WARNING: arch/i386/kernel/built-in.o - Section mismatch: reference to .init.text:centaur_init_mtrr from .text between 'mtrr_bp_init' (at offset 0x9684) and 'mtrr_attrib_to_str'
      WARNING: arch/i386/kernel/built-in.o - Section mismatch: reference to .init.text: from .text between 'get_mtrr_state' (at offset 0xa735) and 'generic_get_mtrr'
      WARNING: arch/i386/kernel/built-in.o - Section mismatch: reference to .init.text: from .text between 'get_mtrr_state' (at offset 0xa749) and 'generic_get_mtrr'
      WARNING: arch/i386/kernel/built-in.o - Section mismatch: reference to .init.text: from .text between 'get_mtrr_state' (at offset 0xa770) and 'generic_get_mtrr'
      
      It was tracked down to a few functions missing __init tag.
      Compile tested only.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9ef231a4
  11. 07 7月, 2007 1 次提交
  12. 21 6月, 2007 1 次提交
  13. 05 6月, 2007 1 次提交
  14. 17 5月, 2007 1 次提交
  15. 03 5月, 2007 1 次提交
    • B
      [PATCH] x86: Save the MTRRs of the BSP before booting an AP · 2b1f6278
      Bernhard Kaindl 提交于
      Applied fix by Andew Morton:
      http://lkml.org/lkml/2007/4/8/88 - Fix `make headers_check'.
      
      AMD and Intel x86 CPU manuals state that it is the responsibility of
      system software to initialize and maintain MTRR consistency across
      all processors in Multi-Processing Environments.
      
      Quote from page 188 of the AMD64 System Programming manual (Volume 2):
      
      7.6.5 MTRRs in Multi-Processing Environments
      
      "In multi-processing environments, the MTRRs located in all processors must
      characterize memory in the same way. Generally, this means that identical
      values are written to the MTRRs used by the processors." (short omission here)
      "Failure to do so may result in coherency violations or loss of atomicity.
      Processor implementations do not check the MTRR settings in other processors
      to ensure consistency. It is the responsibility of system software to
      initialize and maintain MTRR consistency across all processors."
      
      Current Linux MTRR code already implements the above in the case that the
      BIOS does not properly initialize MTRRs on the secondary processors,
      but the case where the fixed-range MTRRs of the boot processor are changed
      after Linux started to boot, before the initialsation of a secondary
      processor, is not handled yet.
      
      In this case, secondary processors are currently initialized by Linux
      with MTRRs which the boot processor had very early, when mtrr_bp_init()
      did run, but not with the MTRRs which the boot processor uses at the
      time when that secondary processors is actually booted,
      causing differing MTRR contents on the secondary processors.
      
      Such situation happens on Acer Ferrari 1000 and 5000 notebooks where the
      BIOS enables and sets AMD-specific IORR bits in the fixed-range MTRRs
      of the boot processor when it transitions the system into ACPI mode.
      The SMI handler of the BIOS does this in SMM, entered while Linux ACPI
      code runs acpi_enable().
      
      Other occasions where the SMI handler of the BIOS may change bits in
      the MTRRs could occur as well. To initialize newly booted secodary
      processors with the fixed-range MTRRs which the boot processor uses
      at that time, this patch saves the fixed-range MTRRs of the boot
      processor before new secondary processors are started. When the
      secondary processors run their Linux initialisation code, their
      fixed-range MTRRs will be updated with the saved fixed-range MTRRs.
      
      If CONFIG_MTRR is not set, we define mtrr_save_state
      as an empty statement because there is nothing to do.
      
      Possible TODOs:
      
      *) CPU-hotplugging outside of SMP suspend/resume is not yet tested
         with this patch.
      
      *) If, even in this case, an AP never runs i386/do_boot_cpu or x86_64/cpu_up,
         then the calls to mtrr_save_state() could be replaced by calls to
         mtrr_save_fixed_ranges(NULL) and  mtrr_save_state() would not be
         needed.
      
         That would need either verification of the CPU-hotplug code or
         at least a test on a >2 CPU machine.
      
      *) The MTRRs of other running processors are not yet checked at this
         time but it might be interesting to syncronize the MTTRs of all
         processors before booting. That would be an incremental patch,
         but of rather low priority since there is no machine known so
         far which would require this.
      
      AK: moved prototypes on x86-64 around to fix warnings
      Signed-off-by: NBernhard Kaindl <bk@suse.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      Cc: Andi Kleen <ak@suse.de>
      Cc: Dave Jones <davej@codemonkey.org.uk>
      2b1f6278
  16. 13 2月, 2007 1 次提交
  17. 07 12月, 2006 4 次提交
    • B
      [PATCH] x86-64: replace kmalloc+memset with kzalloc in MTRR code · 9cfa5b5d
      Burman Yan 提交于
      Cc: Andi Kleen <ak@suse.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      9cfa5b5d
    • J
      [PATCH] i386: fix MTRR code · 365bff80
      Jan Beulich 提交于
      Until not so long ago, there were system log messages pointing to
      inconsistent MTRR setup of the video frame buffer caused by the way vesafb
      and X worked. While vesafb was fixed meanwhile, I believe fixing it there
      only hides a shortcoming in the MTRR code itself, in that that code is not
      symmetric with respect to the ordering of attempts to set up two (or more)
      regions where one contains the other. In the current shape, it permits
      only setting up sub-regions of pre-exisiting ones. The patch below makes
      this symmetric.
      
      While working on that I noticed a few more inconsistencies in that code,
      namely
      - use of 'unsigned int' for sizes in many, but not all places (the patch
        is converting this to use 'unsigned long' everywhere, which specifically
        might be necessary for x86-64 once a processor supporting more than 44
        physical address bits would become available)
      - the code to correct inconsistent settings during secondary processor
        startup tried (if necessary) to correct, among other things, the value
        in IA32_MTRR_DEF_TYPE, however the newly computed value would never get
        used (i.e. stored in the respective MSR)
      - the generic range validation code checked that the end of the
        to-be-added range would be above 1MB; the value checked should have been
        the start of the range
      - when contained regions are detected, previously this was allowed only
        when the old region was uncacheable; this can be symmetric (i.e. the new
        region can also be uncacheable) and even further as per Intel's
        documentation write-trough and write-back for either region is also
        compatible with the respective opposite in the other
      Signed-off-by: NJan Beulich <jbeulich@novell.com>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      365bff80
    • J
      [PATCH] i386: conditionalize inclusion of some MTRR flavors · 475850c8
      Jan Beulich 提交于
      Avoid inclusion of code that's dead for x86-64.
      Signed-off-by: NJan Beulich <jbeulich@novell.com>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      475850c8
    • A
      [PATCH] i386: fix buggy MTRR address checks · 9b483417
      Andreas Mohr 提交于
      Fix checks that failed to realize that values are 4-kB-unit-sized (note the
      format strings in this same diff context which *do* realize the unit size,
      via appended "000"!).  Also fix an incorrect below-1MB area check (as
      gathered from Jan Beulich's unapplied patch at
      http://www.ussg.iu.edu/hypermail/linux/kernel/0411.1/1378.html ) Update
      mtrr_add_page() docu to make 4-kB-sized calculation more obvious.
      
      Given several further items mentioned in Jan's patch mail, all in all MTRR
      code seems surprisingly buggy, for a surprisingly long period of time (many
      years).  Further work/investigation would be useful.
      
      TBD Note that my patch is pretty much UNTESTED, since I can only verify that it
      TBD successfully boots my machine, but I cannot test against actual buggy
      TBD hardware which would require these (formerly broken) checks.  Long -mm
      TBD simmering would make sense, especially since these now-working checks might
      TBD turn out to have adverse effects on unaffected hardware.
      Signed-off-by: NAndreas Mohr <andi@lisas.de>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      Acked-by: NJan Beulich <jbeulich@novell.com>
      Cc: Andi Kleen <ak@muc.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      9b483417
  18. 27 3月, 2006 1 次提交
  19. 06 1月, 2006 1 次提交
  20. 21 12月, 2005 1 次提交
  21. 15 11月, 2005 1 次提交
  22. 05 9月, 2005 1 次提交
  23. 08 7月, 2005 1 次提交
  24. 24 6月, 2005 1 次提交
  25. 01 5月, 2005 1 次提交
  26. 17 4月, 2005 2 次提交