]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86
authorLinus Torvalds <torvalds@woody.linux-foundation.org>
Fri, 15 Feb 2008 05:23:19 +0000 (21:23 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Fri, 15 Feb 2008 05:23:19 +0000 (21:23 -0800)
* git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86:
  x86: cpa, fix out of date comment
  KVM is not seen under X86 config with latest git (32 bit compile)
  x86: cpa: ensure page alignment
  x86: include proper prototypes for rodata_test
  x86: fix gart_iommu_init()
  x86: EFI set_memory_x()/set_memory_uc() fixes
  x86: make dump_pagetable() static
  x86: fix "BUG: sleeping function called from invalid context" in print_vma_addr()

12 files changed:
arch/x86/Kconfig
arch/x86/kernel/efi.c
arch/x86/kernel/pci-gart_64.c
arch/x86/kernel/test_rodata.c
arch/x86/kernel/traps_64.c
arch/x86/mm/fault.c
arch/x86/mm/init_32.c
arch/x86/mm/init_64.c
arch/x86/mm/pageattr.c
include/asm-x86/cacheflush.h
include/asm-x86/kdebug.h
mm/memory.c

index aaed1a3b92d65bfab4804aec952256c9dc25ef72..3be2305709b7e4a6f99ef6a5d95aace793c73952 100644 (file)
@@ -21,6 +21,8 @@ config X86
        select HAVE_IDE
        select HAVE_OPROFILE
        select HAVE_KPROBES
+       select HAVE_KVM
+
 
 config GENERIC_LOCKBREAK
        def_bool n
@@ -119,8 +121,6 @@ config ARCH_HAS_CPU_RELAX
 config HAVE_SETUP_PER_CPU_AREA
        def_bool X86_64
 
-select HAVE_KVM
-
 config ARCH_HIBERNATION_POSSIBLE
        def_bool y
        depends on !SMP || !X86_VOYAGER
index cbdf9bacc5758e76132ca77dcc5a36d27ccf01fb..0c0eeb163d9035aa6e143ba7a74b79aa84659cf6 100644 (file)
@@ -391,7 +391,7 @@ static void __init runtime_code_page_mkexec(void)
                if (md->type != EFI_RUNTIME_SERVICES_CODE)
                        continue;
 
-               set_memory_x(md->virt_addr, md->num_pages << EFI_PAGE_SHIFT);
+               set_memory_x(md->virt_addr, md->num_pages);
        }
 }
 
@@ -434,7 +434,7 @@ void __init efi_enter_virtual_mode(void)
                }
 
                if (!(md->attribute & EFI_MEMORY_WB))
-                       set_memory_uc(md->virt_addr, size);
+                       set_memory_uc(md->virt_addr, md->num_pages);
 
                systab = (u64) (unsigned long) efi_phys.systab;
                if (md->phys_addr <= systab && systab < end) {
index 65f6acb025c8833dc8183991bb313e52e3cff9ec..faf3229f8fb35feed3dd8ee31d521c33086dc621 100644 (file)
@@ -749,6 +749,15 @@ void __init gart_iommu_init(void)
         */
        set_memory_np((unsigned long)__va(iommu_bus_base),
                                iommu_size >> PAGE_SHIFT);
+       /*
+        * Tricky. The GART table remaps the physical memory range,
+        * so the CPU wont notice potential aliases and if the memory
+        * is remapped to UC later on, we might surprise the PCI devices
+        * with a stray writeout of a cacheline. So play it sure and
+        * do an explicit, full-scale wbinvd() _after_ having marked all
+        * the pages as Not-Present:
+        */
+       wbinvd();
 
        /*
         * Try to workaround a bug (thanks to BenH)
index 4c163772000ee754a0fe17c4f9e6586d150c4867..c29e235792afee3d5b0cbc59a54528f3959f111c 100644 (file)
@@ -10,8 +10,8 @@
  * of the License.
  */
 #include <linux/module.h>
+#include <asm/cacheflush.h>
 #include <asm/sections.h>
-extern int rodata_test_data;
 
 int rodata_test(void)
 {
index efc66df728b61cfd3a0641345836a0d2e3deef9b..0454666819117b93d768de5f7f39304130143b0e 100644 (file)
@@ -84,7 +84,7 @@ static inline void conditional_sti(struct pt_regs *regs)
 
 static inline void preempt_conditional_sti(struct pt_regs *regs)
 {
-       preempt_disable();
+       inc_preempt_count();
        if (regs->flags & X86_EFLAGS_IF)
                local_irq_enable();
 }
@@ -95,7 +95,7 @@ static inline void preempt_conditional_cli(struct pt_regs *regs)
                local_irq_disable();
        /* Make sure to not schedule here because we could be running
           on an exception stack. */
-       preempt_enable_no_resched();
+       dec_preempt_count();
 }
 
 int kstack_depth_to_print = 12;
index 621afb6343dc359d4205a56021658380b1dda427..fdc667422df9913f2f5d861a3e80fad14eab7f4d 100644 (file)
@@ -186,7 +186,7 @@ static int bad_address(void *p)
 }
 #endif
 
-void dump_pagetable(unsigned long address)
+static void dump_pagetable(unsigned long address)
 {
 #ifdef CONFIG_X86_32
        __typeof__(pte_val(__pte(0))) page;
index 8106bba41ecb4b7ce5b87a58545c50102cc562b7..ee1091a469641f95db2564c558827e972728ee37 100644 (file)
@@ -47,6 +47,7 @@
 #include <asm/sections.h>
 #include <asm/paravirt.h>
 #include <asm/setup.h>
+#include <asm/cacheflush.h>
 
 unsigned int __VMALLOC_RESERVE = 128 << 20;
 
index b59fc238151fb58650f64c411c961511e725ee81..a4a9cccdd4f2d5c012119e60489eedbb05c0af39 100644 (file)
@@ -45,6 +45,7 @@
 #include <asm/sections.h>
 #include <asm/kdebug.h>
 #include <asm/numa.h>
+#include <asm/cacheflush.h>
 
 const struct dma_mapping_ops *dma_ops;
 EXPORT_SYMBOL(dma_ops);
index bd61ed13f9cf5a1c13b2e7a052e5bc009001866d..4119379f80fff553de99fd30facb39485659f250 100644 (file)
@@ -688,6 +688,15 @@ static int change_page_attr_set_clr(unsigned long addr, int numpages,
        if (!pgprot_val(mask_set) && !pgprot_val(mask_clr))
                return 0;
 
+       /* Ensure we are PAGE_SIZE aligned */
+       if (addr & ~PAGE_MASK) {
+               addr &= PAGE_MASK;
+               /*
+                * People should not be passing in unaligned addresses:
+                */
+               WARN_ON_ONCE(1);
+       }
+
        cpa.vaddr = addr;
        cpa.numpages = numpages;
        cpa.mask_set = mask_set;
@@ -861,8 +870,12 @@ void kernel_map_pages(struct page *page, int numpages, int enable)
                return;
 
        /*
-        * The return value is ignored - the calls cannot fail,
-        * large pages are disabled at boot time:
+        * The return value is ignored as the calls cannot fail.
+        * Large pages are kept enabled at boot time, and are
+        * split up quickly with DEBUG_PAGEALLOC. If a splitup
+        * fails here (due to temporary memory shortage) no damage
+        * is done because we just keep the largepage intact up
+        * to the next attempt when it will likely be split up:
         */
        if (enable)
                __set_pages_p(page, numpages);
index 6a22212b4b204b93570b84a600ec1e800e821aee..5396c212d8c09d8af1d8d5d82e9996ba50c2dfb6 100644 (file)
@@ -48,12 +48,15 @@ void cpa_init(void);
 
 #ifdef CONFIG_DEBUG_RODATA
 void mark_rodata_ro(void);
+extern const int rodata_test_data;
 #endif
+
 #ifdef CONFIG_DEBUG_RODATA_TEST
-void rodata_test(void);
+int rodata_test(void);
 #else
-static inline void rodata_test(void)
+static inline int rodata_test(void)
 {
+       return 0;
 }
 #endif
 
index dd442a1632c00897800700bc6d01bc68c1f71c71..99dcbafa15119927a5ed1283a4e2342d3558509c 100644 (file)
@@ -31,7 +31,6 @@ extern void show_trace(struct task_struct *t, struct pt_regs *regs,
                        unsigned long *sp, unsigned long bp);
 extern void __show_regs(struct pt_regs *regs);
 extern void show_regs(struct pt_regs *regs);
-extern void dump_pagetable(unsigned long);
 extern unsigned long oops_begin(void);
 extern void oops_end(unsigned long, struct pt_regs *, int signr);
 
index e7a6dcacefc1d86f24bee62dfdf6ca134b2a25a4..ce3c9e4492d803b011f50ea8641e477056116ddd 100644 (file)
@@ -2711,6 +2711,13 @@ void print_vma_addr(char *prefix, unsigned long ip)
        struct mm_struct *mm = current->mm;
        struct vm_area_struct *vma;
 
+       /*
+        * Do not print if we are in atomic
+        * contexts (in exception stacks, etc.):
+        */
+       if (preempt_count())
+               return;
+
        down_read(&mm->mmap_sem);
        vma = find_vma(mm, ip);
        if (vma && vma->vm_file) {