Skip to content
  1. Jul 24, 2023
    • Guo Ren's avatar
      riscv: u64ilp32: Remove compat_vdso/ · ec09d040
      Guo Ren authored
      
      
      After unifying vdso32 & vdso64 into vdso/, we ever needn't compat_vdso
      directory. This commit removes the whole compat_vdso/.
      
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      Signed-off-by: default avatarGuo Ren <guoren@kernel.org>
      ec09d040
    • Guo Ren's avatar
      riscv: u64ilp32: Unify vdso32 & compat_vdso into vdso/Makefile · b105ee5a
      Guo Ren authored
      
      
      Linux kernel abi and vdso abi could be different, and current
      vdso/Makefile force vdso use the same abi as the kernel. It isn't
      suitable for the next s64ilp32 patch series because s64ilp32 uses
      64ilp32 abi in the kernel but still uses 32ilp32 in the userspace. This
      patch unifies vdso32 & compat_vdso into vdso/Makefile to solve this
      problem, similar to Powerpc's vdso framework.
      
      Before this:
       - vdso/
       - vdso/vdso.S
       - vdso/gen_vdso_offsets.sh
       - compat_vdso/compat_vdso.S
       - compat_vdso/gen_compat_vdso_offsets.sh
       - vdso.c
      
      After this:
       - vdso/
       - vdso64.S
       - vdso/gen_vdso64_offsets.sh
       - vdso32.S
       - vdso/gen_vdso32_offsets.sh
       - vdso.c
      
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      Signed-off-by: default avatarGuo Ren <guoren@kernel.org>
      b105ee5a
    • Guo Ren's avatar
      add tinylab defconfig · 4b3eaca8
      Guo Ren authored
      
      
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      4b3eaca8
    • Guo Ren's avatar
      riscv: Add combo spinlock support · f2137ceb
      Guo Ren authored
      
      
      Combo spinlock could support queued and ticket in one Linux Image and
      select them during boot time via errata mechanism. Here is the func
      size (Bytes) comparison table below:
      
      TYPE			: COMBO | TICKET | QUEUED
      arch_spin_lock		: 106	| 60     | 50
      arch_spin_unlock	: 54    | 36     | 26
      arch_spin_trylock	: 110   | 72     | 54
      arch_spin_is_locked	: 48    | 34     | 20
      arch_spin_is_contended	: 56    | 40     | 24
      rch_spin_value_unlocked	: 48    | 34     | 24
      
      One example of disassemble combo arch_spin_unlock:
         0xffffffff8000409c <+14>:    nop                # detour slot
         0xffffffff800040a0 <+18>:    fence   rw,w       # queued spinlock start
         0xffffffff800040a4 <+22>:    sb      zero,0(a4) # queued spinlock end
         0xffffffff800040a8 <+26>:    ld      s0,8(sp)
         0xffffffff800040aa <+28>:    addi    sp,sp,16
         0xffffffff800040ac <+30>:    ret
         0xffffffff800040ae <+32>:    lw      a5,0(a4)   # ticket spinlock start
         0xffffffff800040b0 <+34>:    sext.w  a5,a5
         0xffffffff800040b2 <+36>:    fence   rw,w
         0xffffffff800040b6 <+40>:    addiw   a5,a5,1
         0xffffffff800040b8 <+42>:    slli    a5,a5,0x30
         0xffffffff800040ba <+44>:    srli    a5,a5,0x30
         0xffffffff800040bc <+46>:    sh      a5,0(a4)   # ticket spinlock end
         0xffffffff800040c0 <+50>:    ld      s0,8(sp)
         0xffffffff800040c2 <+52>:    addi    sp,sp,16
         0xffffffff800040c4 <+54>:    ret
      
      The qspinlock is smaller and faster than ticket-lock when all are in
      fast-path, and combo spinlock could provide a compatible Linux Image
      for different micro-arch design (weak/strict fwd guarantee) processors.
      
      Signed-off-by: default avatarGuo Ren <guoren@kernel.org>
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      f2137ceb
  2. Jul 21, 2023
  3. Jul 10, 2023