summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* x86: change size of node ids from u8 to s16travis@sgi.com2008-01-305-15/+16
| | | | | | | | | | | | | | Change the size of node ids for X86_64 from u8 to s16 to accomodate more than 32k nodes and allow for NUMA_NO_NODE (-1) to be sign extended to int. Cc: David Rientjes <rientjes@google.com> Cc: Yinghai Lu <yhlu.kernel@gmail.com> Cc: Eric Dumazet <dada1@cosmosbay.com> Signed-off-by: Mike Travis <travis@sgi.com> Reviewed-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: relax restrictions on setting CONFIG_NUMA on x86, #2Mel Gorman2008-01-301-1/+1
| | | | | | | | | | | | The FLATMEM memory model references a global mem_map and max_mapnr. This is incompatible with how memory models used for NUMA view the world. Builds fail if FLATMEM && NUMA are set on x86. This patch forbids that combination of config items. This is consistent with x86_64 enforcements. Signed-off-by: Mel Gorman <mel@csn.ul.ie> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: make NUMA work on 32-bitMel Gorman2008-01-301-15/+78
| | | | | | | | | | | | | | | | | | | | | | | | | The DISCONTIG memory model on x86 32 bit uses a remap allocator early in boot. The objective is that portions of every node are mapped in to the kernel virtual area (KVA) in place of ZONE_NORMAL so that node-local allocations can be made for pgdat and mem_map structures. With SPARSEMEM, the amount that is set aside is insufficient for all the mem_maps to be allocated. During the boot process, it falls back to using the bootmem allocator. This breaks assumptions that SPARSEMEM makes about the layout of the mem_map in memory and results in a VM_BUG_ON triggering due to pfn_to_page() returning garbage values. This patch only enables the remap allocator for use with DISCONTIG. Without SRAT support, a compile-error occurs because ACPI table parsing functions are only available in x86-64. This patch also adds no-op stubs and prints a warning message. What likely needs to be done is sharing the table parsing functions between 32 and 64 bit if they are compatible. Signed-off-by: Mel Gorman <mel@csn.ul.ie> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: make printk_address available on X86_32Harvey Harrison2008-01-302-7/+32
| | | | | | | | | | Small fomatting fixes to 64-bit as well, trailing whitespace and extra semicolon, also move the ifdefs for CONFIG_KALLSYMS into the function itself. Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: fix early cpu_to_node panic from nr_free_zone_pagesMike Travis2008-01-302-2/+2
| | | | | | | | | | | | | | | | | | call early_cpu_to_node() since per_cpu(cpu_to_node_map) might not be setup yet. I also had to export x86_cpu_to_node_map_early_ptr because of some calls from the network code to numa_node_id(): net/ipv4/netfilter/arp_tables.c: net/ipv4/netfilter/ip_tables.c: net/ipv4/netfilter/ip_tables.c: Signed-off-by: Mike Travis <travis@sgi.com> Cc: Andi Kleen <ak@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: reboot: remove inb_p usageAlan Cox2008-01-301-2/+4
| | | | | | | | | We are driving a motherboard port so use a 2uS explicit delay at this point. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* xen: fix section usage in xen-head.S and setup.cSam Ravnborg2008-01-302-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | additional section for .init.text appending a number. A side effect of this was a section mismatch warning because modpost did not recognize a .init.text section named .init.text.1: WARNING: vmlinux.o(.text.head+0x247): Section mismatch: reference to .init.text.1:start_kernel (between 'is386' and 'check_x87') Fix this by hardcoding the "ax" in the pushsection. Thanks to Torlaf for reporting this. Alan Modra provided the hint that made me able to locate the root cause of this warning. And Mike Frysinger told me how to properly fix it using __INIT/__FINIT. Fix following Section mismatch warning in addition: WARNING: vmlinux.o(.text+0x14c8): Section mismatch: reference to .init.data:vsyscall_int80_start (between 'fiddle_vdso' and 'xen_setup_features') fiddle_vdso was only used from a __init function - so declare it __init. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Cc: Jeremy Fitzhardinge <jeremy@xensource.com> Cc: Chris Wright <chrisw@sous-sol.org> Cc: WANG Cong <xiyou.wangcong@gmail.com> Cc: Toralf Förster <toralf.foerster@gmx.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: export __supported_pte_maskGlauber de Oliveira Costa2008-01-301-0/+2
| | | | | | | | | export __supported_pte_mask variable as GPL symbol. lguest is a user of it. Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: export check_tsc_unstableGlauber de Oliveira Costa2008-01-301-1/+3
| | | | | | | | | Exporrt check_tsc_unstable function as GPL symbol. lguest is a user of it. Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: update reliability argument to printk_addressHarvey Harrison2008-01-301-1/+1
| | | | | | Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: add vdso32-int80-syms.lds to .gitignoreHarvey Harrison2008-01-301-0/+1
| | | | | | | | One of the generated files was missed in gitignore. Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: clean up paging_init()Ingo Molnar2008-01-301-1/+0Star
| | | | | Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: get_cycles() fixIngo Molnar2008-01-301-3/+1Star
| | | | | Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: only support sparsememYinghai Lu2008-01-301-32/+0Star
| | | | | | | | | | sparsemem is only one supported, so could remove FLAT_NODE_MEM related, that is only needed !SPARSEMEM Signed-off-by: Yinghai Lu <yinghai.lu@sun.com> Reviewed-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: stackdump after the "Trying to free already-free IRQ" messageIngo Molnar2008-01-301-0/+3
| | | | | | | | | | these bugs are harder to find than they seem, a stackdump helps. make it dependent on CONFIG_DEBUG_SHIRQ so that people can turn it off if it annoys them. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: fix up alternatives with lockdep enabledIngo Molnar2008-01-301-5/+6
| | | | | | | | | | An older binutils bug caused us to not fix up alternatives. This problem involved mutex.c but we dont do lockdep section tricks there anymore, so this workaround is moot. Keep the printk nevertheless, just in case ... We can remove that later on. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: add warning to check_tsc_warp()Ingo Molnar2008-01-301-1/+5
| | | | | | | add warning to check_tsc_warp() - if get_cycles() does not progress. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: check_tsc_warp() slowness fixIngo Molnar2008-01-301-2/+2
| | | | | | | 100 million max # of loops is a bit too much - reduce it to 10 million. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: remove unneded castsJan Engelhardt2008-01-3014-24/+24
| | | | | | | | x86: remove unneeded casts Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: use v8086_mode helper, trivial unificationHarvey Harrison2008-01-302-1/+14
| | | | | | | | | Use v8086_mode inline in fault_32.c, no functional change also ifdef the section for 32-bit only and add to fault_64.c Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: add debug of invalid per_cpu map accessesIngo Molnar2008-01-301-4/+5
| | | | | | | dont crash survivable situations. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: add debug of invalid per_cpu map accessestravis@sgi.com2008-01-303-0/+22
| | | | | | | | | Provide a means to trap usages of per_cpu map variables before they are setup. Define CONFIG_DEBUG_PER_CPU_MAPS to activate. Signed-off-by: Mike Travis <travis@sgi.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: change bios_cpu_apicid to percpu data variable fixuptravis@sgi.com2008-01-305-10/+14
| | | | | | | | | | | | | | | Change static bios_cpu_apicid array to a per_cpu data variable. This includes using a static array used during initialization similar to the way x86_cpu_to_apicid[] is handled. There is one early use of bios_cpu_apicid in apic_is_clustered_box(). The other reference in cpu_present_to_apicid() is called after smp_set_apicids() has setup the percpu version of bios_cpu_apicid. Signed-off-by: Mike Travis <travis@sgi.com> Reviewed-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: fix early NUMA-id accessMike Travis2008-01-301-1/+2
| | | | | Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: change NR_CPUS arrays in numa_64 fixuptravis@sgi.com2008-01-305-39/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change the following static arrays sized by NR_CPUS to per_cpu data variables: char cpu_to_node_map[NR_CPUS]; fixup: - Split cpu_to_node function into "early" and "late" versions so that x86_cpu_to_node_map_early_ptr is not EXPORT'ed and the cpu_to_node inline function is more streamlined. - This also involves setting up the percpu maps as early as possible. - Fix X86_32 NUMA build errors that previous version of this patch caused. V2->V3: - add early_cpu_to_node function to keep cpu_to_node efficient - move and rename smp_set_apicids() to setup_percpu_maps() - call setup_percpu_maps() as early as possible V1->V2: - Removed extraneous casts - Fix !NUMA builds with '#ifdef CONFIG_NUMA" Signed-off-by: Mike Travis <travis@sgi.com> Reviewed-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: add generic clearcpuid=... optionAndi Kleen2008-01-303-0/+35
| | | | | | | | | | Add a generic option to clear any cpuid bit. I added it because it was very easy to add with the new generic cpuid disable bitmap and perhaps it will be useful in the future. Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: add noclflush optionAndi Kleen2008-01-303-0/+16
| | | | | | | | To disable CLFLUSH usage, especially in change_page_attr(). Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: convert TSC disabling to generic cpuid disable bitmapAndi Kleen2008-01-308-26/+11Star
| | | | | | | | Fix from: Ian Campbell <ijc@hellion.org.uk> Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: don't disable RDTSC in userland for 32bit notscAndi Kleen2008-01-301-1/+0Star
| | | | | | | | | | Modern 32bit userland doesn't even boot when the TSC is disabled because ld.so tends to contain RDTSCs. So make notsc only effective for the kernel, similar to 64bit. Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: convert some existing cpuid disable options to new generic bitmapAndi Kleen2008-01-302-34/+5Star
| | | | | | | | | This convers nofxsr, mem=nopentium and nosep to use the new generic cpuid disable bitmap instead of using own variables. Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: add framework to disable CPUID bits on the command lineAndi Kleen2008-01-304-0/+17
| | | | | | | | | | There are already various options to disable specific cpuid bits on the command line. They all use their own variable. Add a generic mask to make this easier in the future. Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: fill in missing pv_mmu_ops entries for PAGETABLE_LEVELS >= 3Eduardo Habkost2008-01-301-2/+9
| | | | | | | | This finally makes paravirt-ops able to compile and boot under x86_64. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: don't set pagetable_setup_{start,done} hooks on 64-bitEduardo Habkost2008-01-301-0/+2
| | | | | | | | | | paravirt_pagetable_setup_{start,done}() are not used (yet) under x86_64, and native_pagetable_setup_{start,done}() don't exist on x86_64. So they don't need to be set. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: include/asm-x86/paravirt.h: x86_64 mmu operationsEduardo Habkost2008-01-301-0/+55
| | | | | | | | | | | | | Add .set_pgd field to pv_mmu_ops. Implement pud_val(), __pud(), set_pgd(), pud_clear(), pgd_clear(). pud_clear() and pgd_clear() are implemented simply using set_pud() and set_pmd(). They don't have a field at pv_mmu_ops. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: change function orders in paravirt.hGlauber de Oliveira Costa2008-01-301-42/+42
| | | | | | | | | __pmd, pmd_val and set_pud are used before they are defined (as static) We move them a little up in the file, so it doesn't happen. Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: provide __parainstructions sectionGlauber de Oliveira Costa2008-01-301-0/+8
| | | | | | | | | This patch adds the __parainstructions section to vmlinux.lds.S. It's needed for the patching system. Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: add asm_offset PARAVIRT constantsGlauber de Oliveira Costa2008-01-301-0/+14
| | | | | | | | This patch adds the constant PARAVIRT needs in asm_offsets_64.c Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: fill pv_cpu_ops structure with cr8 fieldsGlauber de Oliveira Costa2008-01-301-0/+4
| | | | | | | | | This patch fills in the read and write cr8 fields with their native version. Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: provide read and write cr8 paravirt hooksGlauber de Oliveira Costa2008-01-302-14/+18
| | | | | | | | | | | | Since the cr8 manipulation functions ended up staying in the tree, they can't be defined just when PARAVIRT is off: In this patch, those functions are defined for the PARAVIRT case too. [ mingo@elte.hu: fixes ] Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: puts read and write cr8 into pv_cpu_opsGlauber de Oliveira Costa2008-01-301-0/+15
| | | | | | | | | This patch adds room for read and write_cr8 functions back in pv_cpu_ops struct Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: put generic mm_hooks include into PARAVIRTGlauber de Oliveira Costa2008-01-301-0/+2
| | | | | | | | | With PARAVIRT, we actually have arch_{dup,exit}_mmap functions, so we can't include the generic header Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: provide a native_init_IRQ function on 64-bitGlauber de Oliveira Costa2008-01-302-1/+4
| | | | | | | | | x86_64 lacks a native_init_IRQ() function, so we turn the arch's init_IRQ() function into a native construct Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: add stringify headerGlauber de Oliveira Costa2008-01-301-0/+1
| | | | | | | | | We use a __stringify construction at paravirt_patch_64.c. It's better practice to include the stringify header directly Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: checking aperture report for node insteadYinghai Lu2008-01-301-2/+5
| | | | | | | | | | | | | | | | | | | | | | currently when gart iommu is enabled by BIOS or previous we got " Checking aperture... CPU 0: aperture @4000000 size 64MB CPU 1: aperture @4000000 size 64MB " we should use use Node instead. we will get " Checking aperture... Node 0: aperture @4000000 size 64MB Node 1: aperture @4000000 size 64MB " Signed-off-by: Yinghai Lu <yinghai.lu@sun.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: move select_idle_routine() call after detect_ht()Hiroshi Shimamoto2008-01-301-1/+2
| | | | | | | | | | | | Move the select_idle_routine() call to after the detect_ht() call at identify_cpu() on 64-bit. This change is for printing the polling idle and HT enabled warning message properly. Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: move warning message of polling idle and HT enabledHiroshi Shimamoto2008-01-302-11/+24
| | | | | | | | | | | | The warning message at idle_setup() is never shown because smp_num_sibling hasn't been updated at this point yet. Move this polling idle and HT enabled warning to select_idle_routine(). I also implement this warning on 64-bit kernel. Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: msr for AMD Fam 10h mmioYinghai Lu2008-01-301-0/+8
| | | | | | Signed-off-by: Yinghai Lu <yinghai.lu@sun.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: fix unconditional arch/x86/kernel/pcspeaker.o compilingMichael Opdenacker2008-01-301-0/+3
| | | | | | | | do not add the pcspkr platform device if pcspkr support is disabled. Signed-off-by: Michael Opdenacker <michael@free-electrons.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: only call early_init_amd one timeYinghai Lu2008-01-301-8/+3Star
| | | | | | | | | | | | | | | | | | | | Andi's patch " x86: move X86_FEATURE_CONSTANT_TSC into early cpu feature detection Need this in the next patch in time_init and that happens early. This includes a minor fix on i386 where early_intel_workarounds() [which is now called early_init_intel] really executes early as the comments say. " calling early_init_amd in early_identify_cpu and identify_cpu two times. this patch remove the one in identify_cpu Signed-off-by: Yinghai Lu <yinghai.lu@sun.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86, 32-bit: trim memory not covered by wb mtrrsJesse Barnes2008-01-308-39/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Jesse Barnes <jesse.barnes@intel.com> Tested-by: Justin 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: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>