]> Git Repo - linux.git/commitdiff
Merge branch 'parisc-4.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller...
authorLinus Torvalds <[email protected]>
Sun, 22 Nov 2015 20:50:58 +0000 (12:50 -0800)
committerLinus Torvalds <[email protected]>
Sun, 22 Nov 2015 20:50:58 +0000 (12:50 -0800)
Pull parisc update from Helge Deller:
 "This patchset adds Huge Page and HUGETLBFS support for parisc"

Honestly, the hugepage support should have gone through in the merge
window, and is not really an rc-time fix.  But it only touches
arch/parisc, and I cannot find it in myself to care.  If one of the
three parisc users notices a breakage, I will point at Helge and make
rude farting noises.

* 'parisc-4.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
  parisc: Map kernel text and data on huge pages
  parisc: Add Huge Page and HUGETLBFS support
  parisc: Use long branch to do_syscall_trace_exit
  parisc: Increase initial kernel mapping to 32MB on 64bit kernel
  parisc: Initialize the fault vector earlier in the boot process.
  parisc: Add defines for Huge page support
  parisc: Drop unused MADV_xxxK_PAGES flags from asm/mman.h
  parisc: Drop definition of start_thread_som for HP-UX SOM binaries
  parisc: Fix wrong comment regarding first pmd entry flags

1  2 
arch/parisc/include/uapi/asm/mman.h
arch/parisc/mm/init.c

index ecc3ae1ca28e2d573f578709fa6c2c023159fa72,2ae13ce592e8f635509d9df656e586763fdaa301..dd4d1876a020c1e0150cc87547e3f75f9940f16b
@@@ -31,9 -31,6 +31,9 @@@
  
  #define MCL_CURRENT   1               /* lock all current mappings */
  #define MCL_FUTURE    2               /* lock all future mappings */
 +#define MCL_ONFAULT   4               /* lock all pages that are faulted in */
 +
 +#define MLOCK_ONFAULT 0x01            /* Lock pages in range after they are faulted in, do not prefault */
  
  #define MADV_NORMAL     0               /* no further special treatment */
  #define MADV_RANDOM     1               /* expect random page references */
  #define MADV_DONTFORK 10              /* don't inherit across fork */
  #define MADV_DOFORK   11              /* do inherit across fork */
  
- /* The range 12-64 is reserved for page size specification. */
- #define MADV_4K_PAGES   12              /* Use 4K pages  */
- #define MADV_16K_PAGES  14              /* Use 16K pages */
- #define MADV_64K_PAGES  16              /* Use 64K pages */
- #define MADV_256K_PAGES 18              /* Use 256K pages */
- #define MADV_1M_PAGES   20              /* Use 1 Megabyte pages */
- #define MADV_4M_PAGES   22              /* Use 4 Megabyte pages */
- #define MADV_16M_PAGES  24              /* Use 16 Megabyte pages */
- #define MADV_64M_PAGES  26              /* Use 64 Megabyte pages */
  #define MADV_MERGEABLE   65           /* KSM may merge identical pages */
  #define MADV_UNMERGEABLE 66           /* KSM may not merge identical pages */
  
diff --combined arch/parisc/mm/init.c
index c5fec4890fdf52fe459198ff7780f9e59af6d294,ac90df1119bdd5c35ef6c244dd02d1c058f54140..1b366c47768722081efe57a9db39eaba2a7dcde9
@@@ -23,7 -23,6 +23,7 @@@
  #include <linux/unistd.h>
  #include <linux/nodemask.h>   /* for node_online_map */
  #include <linux/pagemap.h>    /* for release_pages and page_cache_release */
 +#include <linux/compat.h>
  
  #include <asm/pgalloc.h>
  #include <asm/pgtable.h>
@@@ -31,7 -30,6 +31,7 @@@
  #include <asm/pdc_chassis.h>
  #include <asm/mmzone.h>
  #include <asm/sections.h>
 +#include <asm/msgbuf.h>
  
  extern int  data_start;
  extern void parisc_kernel_start(void);        /* Kernel entry point in head.S */
@@@ -409,15 -407,11 +409,11 @@@ static void __init map_pages(unsigned l
        unsigned long vaddr;
        unsigned long ro_start;
        unsigned long ro_end;
-       unsigned long fv_addr;
-       unsigned long gw_addr;
-       extern const unsigned long fault_vector_20;
-       extern void * const linux_gateway_page;
+       unsigned long kernel_end;
  
        ro_start = __pa((unsigned long)_text);
        ro_end   = __pa((unsigned long)&data_start);
-       fv_addr  = __pa((unsigned long)&fault_vector_20) & PAGE_MASK;
-       gw_addr  = __pa((unsigned long)&linux_gateway_page) & PAGE_MASK;
+       kernel_end  = __pa((unsigned long)&_end);
  
        end_paddr = start_paddr + size;
  
                        for (tmp2 = start_pte; tmp2 < PTRS_PER_PTE; tmp2++, pg_table++) {
                                pte_t pte;
  
-                               /*
-                                * Map the fault vector writable so we can
-                                * write the HPMC checksum.
-                                */
                                if (force)
                                        pte =  __mk_pte(address, pgprot);
-                               else if (parisc_text_address(vaddr) &&
-                                        address != fv_addr)
+                               else if (parisc_text_address(vaddr)) {
                                        pte = __mk_pte(address, PAGE_KERNEL_EXEC);
+                                       if (address >= ro_start && address < kernel_end)
+                                               pte = pte_mkhuge(pte);
+                               }
                                else
  #if defined(CONFIG_PARISC_PAGE_SIZE_4KB)
-                               if (address >= ro_start && address < ro_end
-                                                       && address != fv_addr
-                                                       && address != gw_addr)
-                                       pte = __mk_pte(address, PAGE_KERNEL_RO);
-                               else
+                               if (address >= ro_start && address < ro_end) {
+                                       pte = __mk_pte(address, PAGE_KERNEL_EXEC);
+                                       pte = pte_mkhuge(pte);
+                               } else
  #endif
+                               {
                                        pte = __mk_pte(address, pgprot);
+                                       if (address >= ro_start && address < kernel_end)
+                                               pte = pte_mkhuge(pte);
+                               }
  
                                if (address >= end_paddr) {
                                        if (force)
@@@ -536,15 -531,12 +533,12 @@@ void free_initmem(void
  
        /* force the kernel to see the new TLB entries */
        __flush_tlb_range(0, init_begin, init_end);
-       /* Attempt to catch anyone trying to execute code here
-        * by filling the page with BRK insns.
-        */
-       memset((void *)init_begin, 0x00, init_end - init_begin);
        /* finally dump all the instructions which were cached, since the
         * pages are no-longer executable */
        flush_icache_range(init_begin, init_end);
        
-       free_initmem_default(-1);
+       free_initmem_default(POISON_FREE_INITMEM);
  
        /* set up a new led state on systems shipped LED State panel */
        pdc_chassis_send_status(PDC_CHASSIS_DIRECT_BCOMPLETE);
@@@ -592,20 -584,6 +586,20 @@@ unsigned long pcxl_dma_start __read_mos
  
  void __init mem_init(void)
  {
 +      /* Do sanity checks on IPC (compat) structures */
 +      BUILD_BUG_ON(sizeof(struct ipc64_perm) != 48);
 +#ifndef CONFIG_64BIT
 +      BUILD_BUG_ON(sizeof(struct semid64_ds) != 80);
 +      BUILD_BUG_ON(sizeof(struct msqid64_ds) != 104);
 +      BUILD_BUG_ON(sizeof(struct shmid64_ds) != 104);
 +#endif
 +#ifdef CONFIG_COMPAT
 +      BUILD_BUG_ON(sizeof(struct compat_ipc64_perm) != sizeof(struct ipc64_perm));
 +      BUILD_BUG_ON(sizeof(struct compat_semid64_ds) != 80);
 +      BUILD_BUG_ON(sizeof(struct compat_msqid64_ds) != 104);
 +      BUILD_BUG_ON(sizeof(struct compat_shmid64_ds) != 104);
 +#endif
 +
        /* Do sanity checks on page table constants */
        BUILD_BUG_ON(PTE_ENTRY_SIZE != sizeof(pte_t));
        BUILD_BUG_ON(PMD_ENTRY_SIZE != sizeof(pmd_t));
@@@ -728,8 -706,8 +722,8 @@@ static void __init pagetable_init(void
                unsigned long size;
  
                start_paddr = pmem_ranges[range].start_pfn << PAGE_SHIFT;
-               end_paddr = start_paddr + (pmem_ranges[range].pages << PAGE_SHIFT);
                size = pmem_ranges[range].pages << PAGE_SHIFT;
+               end_paddr = start_paddr + size;
  
                map_pages((unsigned long)__va(start_paddr), start_paddr,
                          size, PAGE_KERNEL, 0);
This page took 0.07173 seconds and 4 git commands to generate.