1. 11 Aug, 2023 4 commits
    • Guo Ren's avatar
      csky: Fixup -Wmissing-prototypes warning · c8171a86
      Guo Ren authored
      Cleanup the warnings:
      
      arch/csky/kernel/ptrace.c:320:16: error: no previous prototype for 'syscall_trace_enter' [-Werror=missing-prototypes]
      arch/csky/kernel/ptrace.c:336:17: error: no previous prototype for 'syscall_trace_exit' [-Werror=missing-prototypes]
      arch/csky/kernel/setup.c:116:34: error: no previous prototype for 'csky_start' [-Werror=missing-prototypes]
      arch/csky/kernel/signal.c:255:17: error: no previous prototype for 'do_notify_resume' [-Werror=missing-prototypes]
      arch/csky/kernel/traps.c:150:15: error: no previous prototype for 'do_trap_unknown' [-Werror=missing-prototypes]
      arch/csky/kernel/traps.c:152:15: error: no previous prototype for 'do_trap_zdiv' [-Werror=missing-prototypes]
      arch/csky/kernel/traps.c:154:15: error: no previous prototype for 'do_trap_buserr' [-Werror=missing-prototypes]
      arch/csky/kernel/traps.c:157:17: error: no previous prototype for 'do_trap_misaligned' [-Werror=missing-prototypes]
      arch/csky/kernel/traps.c:168:17: error: no previous prototype for 'do_trap_bkpt' [-Werror=missing-prototypes]
      arch/csky/kernel/traps.c:187:17: error: no previous prototype for 'do_trap_illinsn' [-Werror=missing-prototypes]
      arch/csky/kernel/traps.c:210:17: error: no previous prototype for 'do_trap_fpe' [-Werror=missing-prototypes]
      arch/csky/kernel/traps.c:220:17: error: no previous prototype for 'do_trap_priv' [-Werror=missing-prototypes]
      arch/csky/kernel/traps.c:230:17: error: no previous prototype for 'trap_c' [-Werror=missing-prototypes]
      arch/csky/kernel/traps.c:57:13: error: no previous prototype for 'trap_init' [-Werror=missing-prototypes]
      arch/csky/kernel/vdso/vgettimeofday.c:12:5: error: no previous prototype for '__vdso_clock_gettime64' [-Werror=missing-prototypes]
      arch/csky/kernel/vdso/vgettimeofday.c:18:5: error: no previous prototype for '__vdso_gettimeofday' [-Werror=missing-prototypes]
      arch/csky/kernel/vdso/vgettimeofday.c:24:5: error: no previous prototype for '__vdso_clock_getres' [-Werror=missing-prototypes]
      arch/csky/kernel/vdso/vgettimeofday.c:6:5: error: no previous prototype for '__vdso_clock_gettime' [-Werror=missing-prototypes]
      arch/csky/mm/fault.c:187:17: error: no previous prototype for 'do_page_fault' [-Werror=missing-prototypes]
      
      Link: https://lore.kernel.org/lkml/20230810141947.1236730-17-arnd@kernel.org/Reported-by: default avatarArnd Bergmann <arnd@kernel.org>
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      Signed-off-by: default avatarGuo Ren <guoren@kernel.org>
      c8171a86
    • Linus Walleij's avatar
      csky: Make pfn accessors static inlines · c1884e1e
      Linus Walleij authored
      Making virt_to_pfn() a static inline taking a strongly typed
      (const void *) makes the contract of a passing a pointer of that
      type to the function explicit and exposes any misuse of the
      macro virt_to_pfn() acting polymorphic and accepting many types
      such as (void *), (unitptr_t) or (unsigned long) as arguments
      without warnings.
      
      For symmetry to the same thing with pfn_to_virt().
      
      In order to do this we move the virt_to_phys() and
      phys_to_virt() below the definitions of the __pa()
      and __va() macros so it compiles. The macro version was also
      able to do recursive symbol resolution.
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      Signed-off-by: default avatarGuo Ren <guoren@kernel.org>
      c1884e1e
    • Linus Walleij's avatar
      csky: Cast argument to virt_to_pfn() to (void *) · ee12fe28
      Linus Walleij authored
      The virt_to_pfn() function takes a (void *) as argument, fix
      this up to avoid exploiting the unintended polymorphism of
      virt_to_pfn.
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      Signed-off-by: default avatarGuo Ren <guoren@kernel.org>
      ee12fe28
    • Guo Ren's avatar
      csky: pgtable: Invalidate stale I-cache lines in update_mmu_cache · 1362d15f
      Guo Ren authored
      The final icache_flush was in the update_mmu_cache, and update_mmu_cache
      is after the set_pte_at. Thus, when CPU0 sets the pte,  the other CPU
      would see it before the icache_flush broadcast happens, and their
      icaches may have cached stale VIPT cache lines in their I-caches. When
      address translation was ready for the new cache line, they will use the
      stale data of icache, not the fresh one of the dcache.
      
      The csky instruction cache is VIPT, and it needs an origin virtual
      address to invalidate the virtual address index entries of cache ways.
      The current implementation uses a temporary mapping mechanism -
      kmap_atomic, which returns a new virtual address for invalidation. But,
      the original virtual address cache line may still in the I-cache.
      
      So force invalidation I-cache in update_mmu_cache, and prevent
      flush_dcache when there is an EXEC page. This bug was detected in the
      4*c860 SMP system, and this patch could pass the stress test.
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      Signed-off-by: default avatarGuo Ren <guoren@kernel.org>
      1362d15f
  2. 29 Jul, 2023 1 commit
  3. 09 Jul, 2023 10 commits
  4. 08 Jul, 2023 25 commits