Skip to content

sync: rvck #276: [Backport]: RISC-V: KVM: Add SBI system suspend support#236

Merged
xmzzz merged 4 commits into
RVCK-Project:OLK-6.6from
ieiao:PR276@rvck
Jun 5, 2026
Merged

sync: rvck #276: [Backport]: RISC-V: KVM: Add SBI system suspend support#236
xmzzz merged 4 commits into
RVCK-Project:OLK-6.6from
ieiao:PR276@rvck

Conversation

@ieiao

@ieiao ieiao commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Sync commits from rvck PR 276.
Source PR: RVCK-Project/rvck#276

yong-xuan and others added 4 commits June 2, 2026 19:27
mainline inclusion
from mainline-6.10-rc1
commit 9752fed8f67c258213535d72f7669279921a6491
category: feature
bugzilla: RVCK-Project#262

--------------------------------

Originally, the use of kvm->lock in SBI_EXT_HSM_HART_START also avoids
the simultaneous updates to the reset context of target VCPU. Since this
lock has been replace with vcpu->mp_state_lock, and this new lock also
protects the vcpu->mp_state. We have to add a separate lock for
vcpu->reset_cntx.

Signed-off-by: Yong-Xuan Wang <yongxuan.wang@sifive.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/20240417074528.16506-3-yongxuan.wang@sifive.com
Signed-off-by: Anup Patel <anup@brainfault.org>
Signed-off-by: Wang Yechao <wang.yechao255@zte.com.cn>
[sync from rvck.]
Signed-off-by: WeiHao Li <cn.liweihao@gmail.com>
mainline inclusion
from mainline-6.14-rc1
commit 023c15151fbb65f8dde23e28af1d6d4382404d58
category: feature
bugzilla: RVCK-Project#262

--------------------------------

Implement a KVM SBI SUSP extension handler. The handler only
validates the system suspend entry criteria and prepares for resuming
in the appropriate state at the resume_addr (as specified by the SBI
spec), but then it forwards the call to the VMM where any system
suspend behavior may be implemented. Since VMM support is needed, KVM
disables the extension by default.

Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/20241017074538.18867-5-ajones@ventanamicro.com
Signed-off-by: Anup Patel <anup@brainfault.org>
Signed-off-by: Wang Yechao <wang.yechao255@zte.com.cn>
[sync from rvck.]
Signed-off-by: WeiHao Li <cn.liweihao@gmail.com>
mainline inclusion
from mainline-6.14-rc1
commit cc57f6cbef65c796a5661decaeffe3f5de397d19
category: feature
bugzilla: RVCK-Project#262

--------------------------------

KVM supports SBI SUSP, so add it to the get-reg-list test.

Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/20241017074538.18867-6-ajones@ventanamicro.com
Signed-off-by: Anup Patel <anup@brainfault.org>
Signed-off-by: Wang Yechao <wang.yechao255@zte.com.cn>
[sync from rvck.]
Signed-off-by: WeiHao Li <cn.liweihao@gmail.com>
mainline inclusion
from mainline-6.14-rc5
commit 351e02b1733b057e33fe13fc03ca93ec799e4f78
category: feature
bugzilla: RVCK-Project#262

--------------------------------

The spec says sleep_type is 32 bits wide and "In case the data is
defined as 32bit wide, higher privilege software must ensure that it
only uses 32 bit data." Mask off upper bits of sleep_type before
using it.

Fixes: 023c15151fbb ("RISC-V: KVM: Add SBI system suspend support")
Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/20250217084506.18763-12-ajones@ventanamicro.com
Signed-off-by: Anup Patel <anup@brainfault.org>
Signed-off-by: Wang Yechao <wang.yechao255@zte.com.cn>
[sync from rvck.]
Signed-off-by: WeiHao Li <cn.liweihao@gmail.com>
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown

开始测试 log: https://github.com/RVCK-Project/rvck-olk/actions/runs/26991367555

参数解析结果
args value
repository RVCK-Project/rvck-olk
head ref pull/236/head
base ref OLK-6.6
LAVA repo RVCK-Project/lavaci
LAVA hardware ['qemu']
LAVA Testcase path lava-testcases/common-test/ltp/ltp.yaml
need run job kunit-test,kernel-build,check-patch,lava-trigger

测试完成

详细结果:
check result
kunit-test failure
kernel-build success
check-patch success
lava-trigger-qemu success
lava-trigger-sg2042 skipped
lava-trigger-k1 skipped
lava-trigger-lpi4a skipped

Kunit Test Result

kunit test failed

Kernel Build Result

Check Patch Result

Total Errors 0
Total Warnings 4

LAVA Check (qemu)

args value
testcase_repo RVCK-Project/lavaci
lava_template lava-job-template/qemu/qemu-ltp.yaml
testcase_path lava-testcases/common-test/ltp/ltp.yaml
kernel_download_url http://10.30.190.110/openEuler-RISC-V/RVCK/OERV-RVCI/RVCK-Project/rvck-olk/236_26991367555_1/Image
initramfs_download_url http://10.30.190.110/openEuler-RISC-V/RVCK/OERV-RVCI/RVCK-Project/rvck-olk/236_26991367555_1/initramfs.img
rootfs_download_url https://fast-mirror.isrc.ac.cn/openeuler-sig-riscv/openEuler-RISC-V/RVCK/openEuler24.03-LTS-SP1/openeuler-rootfs.img.zst
testcase_ref main
testitem_name RVCK-Project_rvck-olk_pull_request_target_236__common-test_qemu

result: Lava check done!

@xmzzz
xmzzz merged commit 656c889 into RVCK-Project:OLK-6.6 Jun 5, 2026
51 of 53 checks passed
@ieiao
ieiao deleted the PR276@rvck branch June 9, 2026 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants