]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/powerpc/kernel/vdso.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
[linux-2.6-omap-h63xx.git] / arch / powerpc / kernel / vdso.c
index 0d4d8bec0df4b4bc94419954fc2471216b710dbb..573afb68d69e7d1ba39d2e364fdf0c35c6db6196 100644 (file)
@@ -1,6 +1,4 @@
 /*
- *  linux/arch/ppc64/kernel/vdso.c
- *
  *    Copyright (C) 2004 Benjamin Herrenschmidt, IBM Corp.
  *                      <benh@kernel.crashing.org>
  *
@@ -35,6 +33,7 @@
 #include <asm/machdep.h>
 #include <asm/cputable.h>
 #include <asm/sections.h>
+#include <asm/firmware.h>
 #include <asm/vdso.h>
 #include <asm/vdso_datapage.h>
 
@@ -145,8 +144,7 @@ static void dump_vdso_pages(struct vm_area_struct * vma)
                        struct page *pg = virt_to_page(vdso32_kbase +
                                                       i*PAGE_SIZE);
                        struct page *upg = (vma && vma->vm_mm) ?
-                               follow_page(vma->vm_mm, vma->vm_start +
-                                           i*PAGE_SIZE, 0)
+                               follow_page(vma, vma->vm_start + i*PAGE_SIZE, 0)
                                : NULL;
                        dump_one_vdso_page(pg, upg);
                }
@@ -157,8 +155,7 @@ static void dump_vdso_pages(struct vm_area_struct * vma)
                        struct page *pg = virt_to_page(vdso64_kbase +
                                                       i*PAGE_SIZE);
                        struct page *upg = (vma && vma->vm_mm) ?
-                               follow_page(vma->vm_mm, vma->vm_start +
-                                           i*PAGE_SIZE, 0)
+                               follow_page(vma, vma->vm_start + i*PAGE_SIZE, 0)
                                : NULL;
                        dump_one_vdso_page(pg, upg);
                }
@@ -184,8 +181,8 @@ static struct page * vdso_vma_nopage(struct vm_area_struct * vma,
        unsigned long offset = address - vma->vm_start;
        struct page *pg;
 #ifdef CONFIG_PPC64
-       void *vbase = test_thread_flag(TIF_32BIT) ?
-               vdso32_kbase : vdso64_kbase;
+       void *vbase = (vma->vm_mm->task_size > TASK_SIZE_USER32) ?
+               vdso64_kbase : vdso32_kbase;
 #else
        void *vbase = vdso32_kbase;
 #endif
@@ -285,8 +282,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm,
         * It's fine to use that for setting breakpoints in the vDSO code
         * pages though
         */
-       vma->vm_flags = VM_READ | VM_EXEC | VM_MAYREAD | VM_MAYWRITE |
-               VM_MAYEXEC | VM_RESERVED;
+       vma->vm_flags = VM_READ | VM_EXEC | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC;
        vma->vm_flags |= mm->def_flags;
        vma->vm_page_prot = protection_map[vma->vm_flags & 0x7];
        vma->vm_ops = &vdso_vmops;
@@ -672,7 +668,13 @@ void __init vdso_init(void)
        vdso_data->version.major = SYSTEMCFG_MAJOR;
        vdso_data->version.minor = SYSTEMCFG_MINOR;
        vdso_data->processor = mfspr(SPRN_PVR);
-       vdso_data->platform = _machine;
+       /*
+        * Fake the old platform number for pSeries and iSeries and add
+        * in LPAR bit if necessary
+        */
+       vdso_data->platform = machine_is(iseries) ? 0x200 : 0x100;
+       if (firmware_has_feature(FW_FEATURE_LPAR))
+               vdso_data->platform |= 1;
        vdso_data->physicalMemorySize = lmb_phys_mem_size();
        vdso_data->dcache_size = ppc64_caches.dsize;
        vdso_data->dcache_line_size = ppc64_caches.dline_size;