Skip to content
Snippets Groups Projects
  1. Dec 03, 2020
  2. Nov 16, 2020
    • Max Filippov's avatar
      xtensa: fix TLBTEMP area placement · 481535c5
      Max Filippov authored
      
      fast_second_level_miss handler for the TLBTEMP area has an assumption
      that page table directory entry for the TLBTEMP address range is 0. For
      it to be true the TLBTEMP area must be aligned to 4MB boundary and not
      share its 4MB region with anything that may use a page table. This is
      not true currently: TLBTEMP shares space with vmalloc space which
      results in the following kinds of runtime errors when
      fast_second_level_miss loads page table directory entry for the vmalloc
      space instead of fixing up the TLBTEMP area:
      
       Unable to handle kernel paging request at virtual address c7ff0e00
        pc = d0009275, ra = 90009478
       Oops: sig: 9 [#1] PREEMPT
       CPU: 1 PID: 61 Comm: kworker/u9:2 Not tainted 5.10.0-rc3-next-20201110-00007-g1fe4962fa983-dirty #58
       Workqueue: xprtiod xs_stream_data_receive_workfn
       a00: 90009478 d11e1dc0 c7ff0e00 00000020 c7ff0000 00000001 7f8b8107 00000000
       a08: 900c5992 d11e1d90 d0cc88b8 5506e97c 00000000 5506e97c d06c8074 d11e1d90
       pc: d0009275, ps: 00060310, depc: 00000014, excvaddr: c7ff0e00
       lbeg: d0009275, lend: d0009287 lcount: 00000003, sar: 00000010
       Call Trace:
         xs_stream_data_receive_workfn+0x43c/0x770
         process_one_work+0x1a1/0x324
         worker_thread+0x1cc/0x3c0
         kthread+0x10d/0x124
         ret_from_kernel_thread+0xc/0x18
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
      481535c5
  3. Jul 15, 2019
  4. Feb 04, 2019
  5. Dec 17, 2017
    • Max Filippov's avatar
      xtensa: add support for KASAN · c633544a
      Max Filippov authored
      
      Cover kernel addresses above 0x90000000 by the shadow map. Enable
      HAVE_ARCH_KASAN when MMU is enabled. Provide kasan_early_init that fills
      shadow map with writable copies of kasan_zero_page. Call
      kasan_early_init right after mmu initialization in the setup_arch.
      Provide kasan_init that allocates proper shadow map pages from the
      memblock and puts these pages into the shadow map for addresses from
      VMALLOC area to the end of KSEG. Call kasan_init right after memblock
      initialization. Don't use KASAN for the boot code, MMU and KASAN
      initialization and page fault handler. Make kernel stack size 4 times
      larger when KASAN is enabled to avoid stack overflows.
      GCC 7.3, 8 or newer is required to build the xtensa kernel with KASAN.
      
      Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
      c633544a
    • Max Filippov's avatar
      xtensa: move fixmap and kmap just above the KSEG · 1af1e8a3
      Max Filippov authored
      
      The virtual address space between the page table and the VMALLOC region
      is big enough to host KASAN shadow map and there's enough space between
      the VMALLOC area and KSEG for the fixmap and kmap.
      Move fixmap and kmap to the gap between VMALLOC area and KSEG, just
      above the KSEG. Reorder entries in the kernel memory layout printing
      code. Drop duplicate PGTABLE_START definition, use
      XCHAL_PAGE_TABLE_VADDR instead.
      
      Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
      1af1e8a3
  6. Jun 22, 2017
  7. Jul 24, 2016
    • Max Filippov's avatar
      xtensa: cleanup MMU setup and kernel layout macros · a9f2fc62
      Max Filippov authored
      
      Make kernel load address explicit, independent of the selected MMU
      configuration and configurable from Kconfig. Do not restrict it to the
      first 512MB of the physical address space.
      
      Cleanup kernel memory layout macros:
      
      - rename VECBASE_RESET_VADDR to VECBASE_VADDR, XC_VADDR to VECTOR_VADDR;
      - drop VIRTUAL_MEMORY_ADDRESS and LOAD_MEMORY_ADDRESS;
      - introduce PHYS_OFFSET and use it in __va and __pa definitions;
      - synchronize MMU/noMMU vectors, drop unused NMI vector;
      - replace hardcoded vectors offset of 0x3000 with Kconfig symbol.
      
      Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
      a9f2fc62
    • Max Filippov's avatar
      xtensa: add alternative kernel memory layouts · d39af902
      Max Filippov authored
      
      MMUv3 is able to support low memory bigger than 128MB.
      Implement 256MB and 512MB KSEG layouts:
      
      - add Kconfig selector for KSEG layout;
      - add KSEG base address, size and alignment definitions to
        arch/xtensa/include/asm/kmem_layout.h;
      - use new definitions in TLB initialization;
      - add build time memory map consistency checks.
      
      See Documentation/xtensa/mmu.txt for the details of new memory layouts.
      
      Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
      d39af902
  8. Jan 14, 2014
  9. May 09, 2013
  10. Dec 19, 2012
Loading