1. 13 5月, 2016 1 次提交
  2. 05 5月, 2016 2 次提交
    • V
      ARC: support HIGHMEM even without PAE40 · 26f9d5fd
      Vineet Gupta 提交于
      Initial HIGHMEM support on ARC was introduced for PAE40 where the low
      memory (0x8000_0000 based) and high memory (0x1_0000_0000) were
      physically contiguous. So CONFIG_FLATMEM sufficed (despite a peipheral
      hole in the middle, which wasted a bit of struct page memory, but things
      worked).
      
      However w/o PAE, highmem was not possible and we could only reach
      ~1.75GB of DDR. Now there is a use case to access ~4GB of DDR w/o PAE40
      The idea is to have low memory at canonical 0x8000_0000 and highmem
      at 0 so enire 4GB address space is available for physical addressing
      This needs additional platform/interconnect mapping to convert
      the non contiguous physical addresses into linear bus adresses.
      
      From Linux point of view, non contiguous divide means FLATMEM no
      longer works and DISCONTIGMEM is needed to track the pfns in the 2
      regions.
      
      This scheme would also work for PAE40, only better in that we don't
      waste struct page memory for the peripheral hole.
      
      The DT description will be something like
      
          memory {
              ...
              reg = <0x80000000 0x200000000   /* 512MB: lowmem */
                     0x00000000 0x10000000>;  /* 256MB: highmem */
         }
      Signed-off-by: NNoam Camus <noamc@ezchip.com>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      26f9d5fd
    • V
      ARC: Fix PAE40 boot failures due to PTE truncation · 2519d753
      Vineet Gupta 提交于
      So a benign looking cleanup which macro'ized PAGE_SHIFT shifts turned
      out to be bad (since it was done non-sensically across the board).
      
      It caused boot failures with PAE40 as forced cast to (unsigned long)
      from newly introduced virt_to_pfn() was causing truncatiion of the
      (long long) pte/paddr values.
      
      It is OK to use this in accessors dealing with kernel virtual address,
      pointers etc, but not for PTE values themelves.
      
      Fixes: cJ2ff5cf2735c ("ARC: mm: Use virt_to_pfn() for addr >> PAGE_SHIFT pattern)
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      2519d753
  3. 12 3月, 2016 1 次提交
  4. 26 2月, 2016 1 次提交
  5. 29 10月, 2015 1 次提交
  6. 17 10月, 2015 1 次提交
    • V
      ARCv2: mm: THP support · fe6c1b86
      Vineet Gupta 提交于
      MMUv4 in HS38x cores supports Super Pages which are basis for Linux THP
      support.
      
      Normal and Super pages can co-exist (ofcourse not overlap) in TLB with a
      new bit "SZ" in TLB page desciptor to distinguish between them.
      Super Page size is configurable in hardware (4K to 16M), but fixed once
      RTL builds.
      
      The exact THP size a Linx configuration will support is a function of:
       - MMU page size (typical 8K, RTL fixed)
       - software page walker address split between PGD:PTE:PFN (typical
         11:8:13, but can be changed with 1 line)
      
      So for above default, THP size supported is 8K * 256 = 2M
      
      Default Page Walker is 2 levels, PGD:PTE:PFN, which in THP regime
      reduces to 1 level (as PTE is folded into PGD and canonically referred
      to as PMD).
      
      Thus thp PMD accessors are implemented in terms of PTE (just like sparc)
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      fe6c1b86
  7. 09 10月, 2015 1 次提交
  8. 22 6月, 2013 1 次提交
    • V
      ARC: [mm] Make stack/heap Non-executable by default · 3abc9448
      Vineet Gupta 提交于
      1. For VM_EXEC based delayed dcache/icache flush, reduces the number of
         flushes.
      
      2. Makes this security feature ON by default rather than OFF before.
      
      3. Applications can use mprotect() to selectively override this.
      
      4. ELF binaries have a GNU_STACK segment which can easily override the
         kernel default permissions.
         For nested-functions/trampolines, gcc already auto-enables executable
         stack in elf. Others needing this can use -Wl,-z,execstack option.
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      3abc9448
  9. 25 5月, 2013 1 次提交
    • V
      ARC: lazy dcache flush broke gdb in non-aliasing configs · 7bb66f6e
      Vineet Gupta 提交于
      gdbserver inserting a breakpoint ends up calling copy_user_page() for a
      code page. The generic version of which (non-aliasing config) didn't set
      the PG_arch_1 bit hence update_mmu_cache() didn't sync dcache/icache for
      corresponding dynamic loader code page - causing garbade to be executed.
      
      So now aliasing versions of copy_user_highpage()/clear_page() are made
      default. There is no significant overhead since all of special alias
      handling code is compiled out for non-aliasing build
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      7bb66f6e
  10. 10 5月, 2013 1 次提交
    • V
      ARC: [mm] Aliasing VIPT dcache support 2/4 · 4102b533
      Vineet Gupta 提交于
      This is the meat of the series which prevents any dcache alias creation
      by always keeping the U and K mapping of a page congruent.
      If a mapping already exists, and other tries to access the page, prev
      one is flushed to physical page (wback+inv)
      
      Essentially flush_dcache_page()/copy_user_highpage() create K-mapping
      of a page, but try to defer flushing, unless U-mapping exist.
      When page is actually mapped to userspace, update_mmu_cache() flushes
      the K-mapping (in certain cases this can be optimised out)
      
      Additonally flush_cache_mm(), flush_cache_range(), flush_cache_page()
      handle the puring of stale userspace mappings on exit/munmap...
      
      flush_anon_page() handles the existing U-mapping for anon page before
      kernel reads it via the GUP path.
      
      Note that while not complete, this is enough to boot a simple
      dynamically linked Busybox based rootfs
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      4102b533
  11. 16 2月, 2013 3 次提交
  12. 11 2月, 2013 1 次提交
    • V
      ARC: Fundamental ARCH data-types/defines · 3be80aae
      Vineet Gupta 提交于
      * L1_CACHE_SHIFT
      * PAGE_SIZE, PAGE_OFFSET
      * struct pt_regs, struct user_regs_struct
      * struct thread_struct, cpu_relax(), task_pt_regs(), start_thread(), ...
      * struct thread_info, THREAD_SIZE, INIT_THREAD_INFO(), TIF_*, ...
      * BUG()
      * ELF_*
      * Elf_*
      
      To disallow user-space visibility into some of the core kernel data-types
      such as struct pt_regs, #ifdef __KERNEL__ which also makes the UAPI header
      spit (further patch in the series) to NOT export it to asm/uapi/ptrace.h
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      Cc: Jonas Bonn <jonas.bonn@gmail.com>
      Cc: Al Viro <viro@ZenIV.linux.org.uk>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      3be80aae