Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\cpu\bugs.c Create Date:2022-07-28 07:56:14
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:spectre_v2_parse_cmdline

Proto:static enum spectre_v2_mitigation_cmd __init spectre_v2_parse_cmdline(void)

Type:enum spectre_v2_mitigation_cmd

Parameter:Nothing

715  cmd = SPECTRE_V2_CMD_AUTO
719  If cmdline_find_option_bool(boot_command_line, "nospectre_v2") || cpu_mitigations_off() Then Return SPECTRE_V2_CMD_NONE
723  ret = cmdline_find_option(boot_command_line, "spectre_v2", arg, size of arg )
724  If ret < 0 Then Return SPECTRE_V2_CMD_AUTO
727  When i < ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(mitigation_options) cycle
728  If Not match_option(arg, ret, option) Then Continue
730  cmd = cmd
731  Break
734  If i >= ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(mitigation_options) Then
735  pr_err("unknown option (%s). Switching to AUTO select\n", arg)
736  Return SPECTRE_V2_CMD_AUTO
739  If ( cmd == SPECTRE_V2_CMD_RETPOLINE || cmd == SPECTRE_V2_CMD_RETPOLINE_AMD || cmd == SPECTRE_V2_CMD_RETPOLINE_GENERIC ) && Not IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_RETPOLINE) Then
743  pr_err("%s selected but not compiled in. Switching to AUTO select\n", option)
744  Return SPECTRE_V2_CMD_AUTO
747  If cmd == SPECTRE_V2_CMD_RETPOLINE_AMD && CPU vendor != X86_VENDOR_HYGON && CPU vendor != X86_VENDOR_AMD Then
750  pr_err("retpoline,amd selected but CPU is not AMD. Switching to AUTO select\n")
751  Return SPECTRE_V2_CMD_AUTO
754  spec_v2_print_cond(option, secure)
756  Return cmd
Caller
NameDescribe
spectre_v2_select_mitigation