Skip to content

Comments

RISC-V SBI debug console extension support#100

Merged
sterling-teng merged 10 commits intoRVCK-Project:rvck-6.6from
yechao-w:rvck-6.6-sbi-dbcn
Sep 14, 2025
Merged

RISC-V SBI debug console extension support#100
sterling-teng merged 10 commits intoRVCK-Project:rvck-6.6from
yechao-w:rvck-6.6-sbi-dbcn

Conversation

@yechao-w
Copy link
Contributor

【验证方法】
1)在qemu仿真器环境进行验证,qemu仿真器版本:10.0.0;
2)仿真器的内核版本以及qemu-kvm虚拟机的内核版本均为合入此补丁的内核;
3)qemu-kvm版本:10.0.0,qemu-kvm虚拟机启动参数:(内核启动参数携带earlycon=sbi),

/usr/bin/qemu-system-riscv64 \
        -nographic -enable-kvm \
        -machine virt,pflash0=pflash0,pflash1=pflash1,acpi=on,aia=aplic-imsic,accel=kvm \
        -blockdev node-name=pflash0,driver=file,read-only=on,filename="./RISCV_VIRT_CODE.fd" \
        -blockdev node-name=pflash1,driver=file,filename="./riscv_test_VARS.fd" \
        -smp 4,sockets=2,dies=1,clusters=1,cores=2,threads=1 \
        -m 4G \
        -kernel /boot/vmlinuz-6.6.101+ \
        -initrd /boot/initramfs-6.6.101+.img \
        -append "root=UUID=fce3cee6-e5eb-4694-85f3-48a369464c19 earlycon=sbi console=tty0 console=ttyS0 selinux=0 cgroup_disable=files apparmor=0" \
        -drive file="/rvck/openEuler-24.03-LTS-riscv64.qcow2",format=qcow2,id=hd0,if=none \
        -device virtio-blk-device,drive=hd0,bootindex=1 \
        -object rng-random,filename=/dev/urandom,id=rng0 \
        -device virtio-rng-device,rng=rng0 \
        -device virtio-net-pci,netdev=net1 \
        -netdev tap,id=net1,ifname=vnet1,script=no,downscript=no \
        -cpu host \
        -device qemu-xhci \
        -usb -device usb-kbd \
        -device usb-tablet \
        -chardev socket,id=qmp,path=/var/lib/libvirt/qemu/riscv-test,server=on,wait=off \
        -mon mode=control,chardev=qmp

【验证结果】
系统启动后,启动日志如下:

[root@localhost ~]# dmesg |less
[    0.000000] Linux version 6.6.101+ (root@c8_dev) (riscv64-unknown-linux-gnu-gcc (ZTE Embsys-TSP V4.07.10.10) 12.2.0, GNU ld (ZTE Embsys-TSP V4.07.10.10) 2.39) #4 SMP Fri Aug 22 05:35:52 EDT 2025
[    0.000000] SBI specification v2.0 detected
[    0.000000] SBI implementation ID=0x3 Version=0x60665
[    0.000000] SBI TIME extension detected
[    0.000000] SBI IPI extension detected
[    0.000000] SBI RFENCE extension detected
[    0.000000] SBI SRST extension detected
[    0.000000] SBI DBCN extension detected
[    0.000000] earlycon: sbi0 at I/O port 0x0 (options '')
[    0.000000] printk: bootconsole [sbi0] enabled
[    0.000000] efi: EFI v2.7 by EDK II
[    0.000000] efi: SMBIOS 3.0=0xfff43000 MEMATTR=0xf8934018 ACPI=0xff5d5000 ACPI 2.0=0xff5d5014 INITRD=0xf898cf18 RNG=0xf8932018 MEMRESERVE=0xf898cf98 
[    0.000000] random: crng init done

内核检测到 SBI spec 2.0,以及支持DBCN extension,earlycon sbi使能成功。

@oervci
Copy link

oervci commented Aug 22, 2025

开始测试

@oervci
Copy link

oervci commented Aug 22, 2025

@oervci
Copy link

oervci commented Aug 22, 2025

Kernel build success!

@oervci
Copy link

oervci commented Aug 22, 2025

@oervci
Copy link

oervci commented Aug 22, 2025

@wangliu-iscas
Copy link
Collaborator

/check

@oervci
Copy link

oervci commented Aug 27, 2025

开始测试

@oervci
Copy link

oervci commented Sep 2, 2025

@oervci
Copy link

oervci commented Sep 2, 2025

Kernel build success!

@oervci
Copy link

oervci commented Sep 2, 2025

@oervci
Copy link

oervci commented Sep 2, 2025

Lava check done! result url: https://lava.oerv.ac.cn/results/617/0_rvck_common-test_qemu

@sterling-teng
Copy link
Contributor

补丁没有问题,进入物理机测试阶段,通过测试后将尝试合并。

@sterling-teng sterling-teng merged commit 1eaf4e6 into RVCK-Project:rvck-6.6 Sep 14, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants