sync: rvck92: riscv: Add qspinlock support#141
Open
xmzzz wants to merge 27 commits intoRVCK-Project:OLK-6.6from
Open
sync: rvck92: riscv: Add qspinlock support#141xmzzz wants to merge 27 commits intoRVCK-Project:OLK-6.6from
xmzzz wants to merge 27 commits intoRVCK-Project:OLK-6.6from
Conversation
mainline inclusion from Linux 6.6-rc6 commit df68f4d8cb496ea31fa42cf2620366571c05376b category: feature bugzilla: RVCK-Project/rvck#79 -------------------------------- We extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Zicond extension for Guest/VM. Signed-off-by: Anup Patel <apatel@ventanamicro.com> Signed-off-by: Anup Patel <anup@brainfault.org> Signed-off-by: yechao-w <wang.yechao255@zte.com.cn> Signed-off-by: Yanteng Si <si.yanteng@linux.dev> Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion from Linux 6.6-rc6 commit 367188297254e7f81e3c3c94e6d6a623f757c4cb category: feature bugzilla: RVCK-Project/rvck#79 -------------------------------- We extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Zbc extension for Guest/VM. Signed-off-by: Anup Patel <apatel@ventanamicro.com> Signed-off-by: Anup Patel <anup@brainfault.org> Signed-off-by: yechao-w <wang.yechao255@zte.com.cn> Signed-off-by: Yanteng Si <si.yanteng@linux.dev> Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion from Linux 6.6-rc6 commit f370b4e668f017f523968f7490163fa922dcd92e category: feature bugzilla: RVCK-Project/rvck#79 -------------------------------- We extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable scalar crypto extensions for Guest/VM. This includes extensions Zbkb, Zbkc, Zbkx, Zknd, Zkne, Zknh, Zkr, Zksed, Zksh, and Zkt. Signed-off-by: Anup Patel <apatel@ventanamicro.com> Signed-off-by: Anup Patel <anup@brainfault.org> Signed-off-by: yechao-w <wang.yechao255@zte.com.cn> Signed-off-by: Yanteng Si <si.yanteng@linux.dev> Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion from Linux 6.6-rc6 commit afd1ef3adfbc36e35fcf4f742fd90aea6480a276 category: feature bugzilla: RVCK-Project/rvck#79 -------------------------------- We extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable vector crypto extensions for Guest/VM. This includes extensions Zvbb, Zvbc, Zvkb, Zvkg, Zvkned, Zvknha, Zvknhb, Zvksed, Zvksh, and Zvkt. Signed-off-by: Anup Patel <apatel@ventanamicro.com> Signed-off-by: Anup Patel <anup@brainfault.org> Signed-off-by: yechao-w <wang.yechao255@zte.com.cn> Signed-off-by: Yanteng Si <si.yanteng@linux.dev> Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion from Linux 6.6-rc6 commit f3901ece5b3894177d1816208d0fb06b295617e0 category: feature bugzilla: RVCK-Project/rvck#79 -------------------------------- We extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Zfh[min] extensions for Guest/VM. Signed-off-by: Anup Patel <apatel@ventanamicro.com> Signed-off-by: Anup Patel <anup@brainfault.org> Signed-off-by: yechao-w <wang.yechao255@zte.com.cn> Signed-off-by: Yanteng Si <si.yanteng@linux.dev> Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion from Linux 6.6-rc6 commit ab6da9cdc3f3d1d091d657219fb6e98f710ee098 category: feature bugzilla: RVCK-Project/rvck#79 -------------------------------- We extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Zihintntl extension for Guest/VM. Signed-off-by: Anup Patel <apatel@ventanamicro.com> Signed-off-by: Anup Patel <anup@brainfault.org> Signed-off-by: yechao-w <wang.yechao255@zte.com.cn> Signed-off-by: Yanteng Si <si.yanteng@linux.dev> Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion from Linux 6.6-rc6 commit f46300285926c2b0d0c79bf40c87d45e169cecb6 category: feature bugzilla: RVCK-Project/rvck#79 -------------------------------- We extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Zvfh[min] extensions for Guest/VM. Signed-off-by: Anup Patel <apatel@ventanamicro.com> Signed-off-by: Anup Patel <anup@brainfault.org> Signed-off-by: yechao-w <wang.yechao255@zte.com.cn> Signed-off-by: Yanteng Si <si.yanteng@linux.dev> Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion from Linux 6.6-rc6 commit 41182cc6f507011a2e6c82657779e451ed9942bb category: feature bugzilla: RVCK-Project/rvck#79 -------------------------------- We extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Zfa extension for Guest/VM. Signed-off-by: Anup Patel <apatel@ventanamicro.com> Signed-off-by: Anup Patel <anup@brainfault.org> Signed-off-by: yechao-w <wang.yechao255@zte.com.cn> Signed-off-by: Yanteng Si <si.yanteng@linux.dev> Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion from Linux 6.6-rc5 commit d808f0b1be4888a87524164bc7dad2242734de38 category: feature bugzilla: RVCK-Project/rvck#79 -------------------------------- The SEED CSR access from VS/VU mode (guest) will always trap to HS-mode (KVM) when Zkr extension is available to the Guest/VM. Forward this CSR access to KVM user space so that it can be emulated based on the method chosen by VMM. Fixes: f370b4e668f0 ("RISC-V: KVM: Allow scalar crypto extensions for Guest/VM") Signed-off-by: Anup Patel <apatel@ventanamicro.com> Signed-off-by: Anup Patel <anup@brainfault.org> Signed-off-by: yechao-w <wang.yechao255@zte.com.cn> Signed-off-by: Yanteng Si <si.yanteng@linux.dev> Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion from Linux 6.6-rc6 commit f943ebe2ec26272d71f9c7643ec667c616419bb1 category: feature bugzilla: RVCK-Project/rvck#79 -------------------------------- Extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Ztso extension for Guest/VM. Signed-off-by: Anup Patel <apatel@ventanamicro.com> Signed-off-by: Anup Patel <anup@brainfault.org> Signed-off-by: yechao-w <wang.yechao255@zte.com.cn> Signed-off-by: Yanteng Si <si.yanteng@linux.dev> Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion from Linux 6.6-rc6 commit 77fc0bfa43f83c1080b35a4915c767cf2c4979ff category: feature bugzilla: RVCK-Project/rvck#79 -------------------------------- Extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Zacas extension for Guest/VM. Signed-off-by: Anup Patel <apatel@ventanamicro.com> Signed-off-by: Anup Patel <anup@brainfault.org> Signed-off-by: yechao-w <wang.yechao255@zte.com.cn> Signed-off-by: Yanteng Si <si.yanteng@linux.dev> Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion from Linux 6.6-rc6 commit fb2a3d63efefe6bd3718201daba479f4339bb4bf category: feature bugzilla: RVCK-Project/rvck#79 -------------------------------- Extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Zimop extension for Guest/VM. Signed-off-by: Clément Léger <cleger@rivosinc.com> Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com> Signed-off-by: yechao-w <wang.yechao255@zte.com.cn> Signed-off-by: Yanteng Si <si.yanteng@linux.dev> Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion from Linux 6.6-rc6 commit d964e8f2ae65dcc088345332d479d4fcc5a1d757 category: feature bugzilla: RVCK-Project/rvck#79 -------------------------------- Extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Zca, Zcf, Zcd and Zcb extensions for Guest/VM. Signed-off-by: Clément Léger <cleger@rivosinc.com> Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com> Signed-off-by: yechao-w <wang.yechao255@zte.com.cn> Signed-off-by: Yanteng Si <si.yanteng@linux.dev> Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion from Linux 6.6-rc6 commit 29cf9b803e6e9f1421f090478e624ca4c637c835 category: feature bugzilla: RVCK-Project/rvck#79 -------------------------------- Extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Zcmop extension for Guest/VM. Signed-off-by: Clément Léger <cleger@rivosinc.com> Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com> Signed-off-by: yechao-w <wang.yechao255@zte.com.cn> Signed-off-by: Yanteng Si <si.yanteng@linux.dev> Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion from Linux 6.6-rc6 commit 86d6a86e59e3aa425d829a935c0d92388e4fe55b category: feature bugzilla: RVCK-Project/rvck#79 -------------------------------- When a guest traps on wrs.nto, call kvm_vcpu_on_spin() to attempt to yield to the lock holding VCPU. Also extend the KVM ISA extension ONE_REG interface to allow KVM userspace to detect and enable the Zawrs extension for the Guest/VM. Signed-off-by: Andrew Jones <ajones@ventanamicro.com> Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com> Signed-off-by: yechao-w <wang.yechao255@zte.com.cn> Signed-off-by: Yanteng Si <si.yanteng@linux.dev> Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion from Linux 6.12-rc5 commit 1851e7836212c76bebb6944bb1541ddcccbea535 category: feature bugzilla: RVCK-Project/rvck#79 -------------------------------- The interface for controlling pointer masking in VS-mode is henvcfg.PMM, which is part of the Ssnpm extension, even though pointer masking in HS-mode is provided by the Smnpm extension. As a result, emulating Smnpm in the guest requires (only) Ssnpm on the host. The guest configures Smnpm through the SBI Firmware Features extension, which KVM does not yet implement, so currently the ISA extension has no visible effect on the guest, and thus it cannot be disabled. Ssnpm is configured using the senvcfg CSR within the guest, so that extension cannot be hidden from the guest without intercepting writes to the CSR. Signed-off-by: Samuel Holland <samuel.holland@sifive.com> Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com> Signed-off-by: yechao-w <wang.yechao255@zte.com.cn> Signed-off-by: Yanteng Si <si.yanteng@linux.dev> Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion from Linux 6.13-rc1 commit 97eccf7db4f2e5e59d16bca45f7803ae3aeff6e1 category: feature bugzilla: RVCK-Project/rvck#79 -------------------------------- We extend the KVM ISA extension ONE_REG interface to allow VMM tools to detect and enable Svade and Svadu extensions for Guest/VM. Since the henvcfg.ADUE is read-only zero if the menvcfg.ADUE is zero, the Svadu extension is available for Guest/VM and the Svade extension is allowed to disabledonly when arch_has_hw_pte_young() is true. Signed-off-by: Yong-Xuan Wang <yongxuan.wang@sifive.com> Signed-off-by: Anup Patel <anup@brainfault.org> Signed-off-by: yechao-w <wang.yechao255@zte.com.cn> Signed-off-by: Yanteng Si <si.yanteng@linux.dev> Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion from Linux 6.13-rc5 commit 0f891585971648a07e8b0c155e5b3eb697601d9d category: feature bugzilla: RVCK-Project/rvck#79 -------------------------------- Extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Svvptc extension for Guest/VM. Signed-off-by: Quan Zhou <zhouquan@iscas.ac.cn> Signed-off-by: Anup Patel <anup@brainfault.org> Signed-off-by: yechao-w <wang.yechao255@zte.com.cn> Signed-off-by: Yanteng Si <si.yanteng@linux.dev> Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion from Linux 6.13-rc6 commit 679e132c0ae2c34b425f32fb1a59fc04c6dc87cb category: feature bugzilla: RVCK-Project/rvck#79 -------------------------------- Extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Zabha extension for Guest/VM. Signed-off-by: Quan Zhou <zhouquan@iscas.ac.cn> Signed-off-by: Anup Patel <anup@brainfault.org> Signed-off-by: yechao-w <wang.yechao255@zte.com.cn> Signed-off-by: Yanteng Si <si.yanteng@linux.dev> Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion from Linux 6.13-rc6 commit 79be257b579e72ae7c5aeb942700a449d467405f category: feature bugzilla: RVCK-Project/rvck#79 -------------------------------- Extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Ziccrse extension for Guest/VM. Signed-off-by: Quan Zhou <zhouquan@iscas.ac.cn> Signed-off-by: Anup Patel <anup@brainfault.org> Signed-off-by: yechao-w <wang.yechao255@zte.com.cn> Signed-off-by: Yanteng Si <si.yanteng@linux.dev> Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion from mainline-v6.6-rc2 commit c6f4a90022524d06f6d9de323b1757031dcf0c26 category: feature bugzilla: RVCK-Project/rvck#90 -------------------------------- The arch_spin_value_unlocked() of ticket-lock would cause the compiler to generate inefficient asm code in riscv architecture because of unnecessary memory access to the contended value. Before the patch: void lockref_get(struct lockref *lockref) { 78: fd010113 add sp,sp,-48 7c: 02813023 sd s0,32(sp) 80: 02113423 sd ra,40(sp) 84: 03010413 add s0,sp,48 0000000000000088 <.LBB296>: CMPXCHG_LOOP( 88: 00053783 ld a5,0(a0) After the patch: void lockref_get(struct lockref *lockref) { CMPXCHG_LOOP( 78: 00053783 ld a5,0(a0) After the patch, the lockref_get() could get in a fast path instead of the function's prologue. This is because ticket lock complex logic would limit compiler optimization for the spinlock fast path, and qspinlock won't. The caller of arch_spin_value_unlocked() could benefit from this change. Currently, the only caller is lockref. Signed-off-by: Guo Ren <guoren@kernel.org> Signed-off-by: Guo Ren <guoren@linux.alibaba.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Gao Rui <gao.rui@zte.com.cn> Signed-off-by: Yanteng Si <si.yanteng@linux.dev> Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion from mainline-v6.12 commit 6116e22ef33a8239f3d53bb25377e9ed733c4176 category: feature bugzilla: RVCK-Project/rvck#90 -------------------------------- The current fully-ordered cmpxchgXX() implementation results in: amocas.X.rl a5,a4,(s1) fence rw,rw This provides enough sync but we can actually use the following better mapping instead: amocas.X.aqrl a5,a4,(s1) Suggested-by: Andrea Parri <andrea@rivosinc.com> Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com> Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com> Signed-off-by: Gao Rui <gao.rui@zte.com.cn> Signed-off-by: Yanteng Si <si.yanteng@linux.dev> Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion from mainline-v6.12 commit f7bd2be7663c7de1dde27dadd352b2c3f4e19106 category: feature bugzilla: RVCK-Project/rvck#90 -------------------------------- Now that Zacas is supported in the kernel, let's use the double word atomic version of amocas to improve the SLUB allocator. Note that we have to select fixed registers, otherwise gcc fails to pick even registers and then produces a reserved encoding which fails to assemble. Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com> Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com> Signed-off-by: Gao Rui <gao.rui@zte.com.cn> Signed-off-by: Yanteng Si <si.yanteng@linux.dev> Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion from mainline-v6.12 commit 97ddab7fbea8fceb044108b64ba2ee2c96ff8dab category: feature bugzilla: RVCK-Project/rvck#90 -------------------------------- This adds runtime support for Zabha in xchg8/16() operations. Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com> Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com> Signed-off-by: Gao Rui <gao.rui@zte.com.cn> Signed-off-by: Yanteng Si <si.yanteng@linux.dev> Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion from mainline-v6.12 commit cbe82e140bb76e1aa9f808cc841654a25b70d4e5 category: feature bugzilla: RVCK-Project/rvck#90 -------------------------------- The arch_spinlock_t of qspinlock has contained the atomic_t val, which satisfies the ticket-lock requirement. Thus, unify the arch_spinlock_t into qspinlock_types.h. This is the preparation for the next combo spinlock. Signed-off-by: Guo Ren <guoren@kernel.org> Signed-off-by: Guo Ren <guoren@linux.alibaba.com> Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com> Signed-off-by: Gao Rui <gao.rui@zte.com.cn> Signed-off-by: Yanteng Si <si.yanteng@linux.dev> Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion from mainline-v6.12 commit 22c33321e260c8b4c1877b2cc0c4e26a0c74c23f category: feature bugzilla: RVCK-Project/rvck#90 -------------------------------- Add a separate ticket-lock.h to include multiple spinlock versions and select one at compile time or runtime. Signed-off-by: Guo Ren <guoren@linux.alibaba.com> Signed-off-by: Guo Ren <guoren@kernel.org> Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com> Signed-off-by: Gao Rui <gao.rui@zte.com.cn> Signed-off-by: Yanteng Si <si.yanteng@linux.dev> Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion from mainline-v6.12 commit ab83647fadae2f1f723119dc066b39a461d6d288 category: feature bugzilla: RVCK-Project/rvck#90 -------------------------------- In order to produce a generic kernel, a user can select CONFIG_COMBO_SPINLOCKS which will fallback at runtime to the ticket spinlock implementation if Zabha or Ziccrse are not present. Note that we can't use alternatives here because the discovery of extensions is done too late and we need to start with the qspinlock implementation because the ticket spinlock implementation would pollute the spinlock value, so let's use static keys. This is largely based on Guo's work and Leonardo reviews at [1]. Link: https://lore.kernel.org/linux-riscv/20231225125847.2778638-1-guoren@kernel.org/ [1] Signed-off-by: Guo Ren <guoren@kernel.org> Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com> Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com> Signed-off-by: Gao Rui <gao.rui@zte.com.cn> Signed-off-by: Yanteng Si <si.yanteng@linux.dev> Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
|
开始测试 log: https://github.com/RVCK-Project/rvck-olk/actions/runs/19623396088 参数解析结果
测试完成 详细结果:RVCK result
Kunit Test Resultkunit test failed Check Patch Result
|
|
开始测试 log: https://github.com/RVCK-Project/rvck-olk/actions/runs/19623396088 参数解析结果
测试完成 详细结果:RVCK result
Kunit Test Resultkunit test failed Check Patch Result
测试完成 详细结果:RVCK result
Kunit Test Resultkunit test failed Kernel Build ResultKernel build succeeded: RVCK-Project/rvck-olk/141/ 1fc2609b36d631468b2d0d18ae8f8d0d /srv/guix_result/4286623b0ccf1cc7eb0731b5846b68f74689fe59/Image LAVA Checkargs:
result:Lava check done! lava log: https://lava.oerv.ac.cn/scheduler/job/934 lava result count: [fail]: 19, [pass]: 1587, [skip]: 293 Check Patch Result
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link: RVCK-Project/rvck#92