402 Star 1.4K Fork 1.3K

GVPopenEuler / kernel

 / 详情

[OLK-5.10] smp: early_param csdlock_debug 造成arm64 panic

已完成
缺陷
创建于  
2022-06-30 11:53

csdlock_debug 在 early_param 中使用 static_branch_enable 控制功能branch开关
在arm64上当关闭了CONFIG_SPARSEMEM_VMEMMAP=n 时启动触发panic

复现:
开启CONFIG_SPARSEMEM_EXTREME 同时关闭 CONFIG_SPARSEMEM_VMEMMAP
设置启动参数csdlock_debug=1
启动虚拟机,虚拟机在启动过程中卡死

调用栈:
virtual address ", '0' <repeats 16 times>, "
...
Call trace:
__aarch64_insn_write+0x9c/0x18c
...
static_key_enable+0x1c/0x30
csdlock_debug+0x4c/0x78
do_early_param+0x9c/0xcc
parse_args+0x26c/0x3a8
parse_early_options+0x34/0x40
parse_early_param+0x80/0xa4
setup_arch+0x150/0x6c8
start_kernel+0x8c/0x720
...
Kernel panic - not syncing: Oops: Fatal exception

__aarch64_insn_write中调用:
__nr_to_section
__pfn_to_page
phys_to_page
patch_map
__aarch64_insn_write

__nr_to_section 返回NULL并导致空指针引用,因为返回的mem_section在 sparse_init 之后初始化的,晚于parse_early_param的阶段。
因此 static_branch_enable 不应该在 early_param 阶段使用,将 early_param 改为 __setup 以规避此问题。

评论 (1)

czj-hw 创建了缺陷

Hi chenzhongjin641354, welcome to the openEuler Community.
I'm the Bot here serving you. You can find the instructions on how to interact with me at Here.
If you have any questions, please contact the SIG: Kernel, and any of the maintainers: @YangYingliang , @pi3orama , @成坚 (CHENG Jian) , @jiaoff , @zhengzengkai , @Qiuuuuu , @刘勇强 , @Xie XiuQi

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(2)
5329419 openeuler ci bot 1632792936
C
1
https://gitee.com/openeuler/kernel.git
git@gitee.com:openeuler/kernel.git
openeuler
kernel
kernel

搜索帮助