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:02
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:x86_virt_spec_ctrl

Proto:void x86_virt_spec_ctrl(u64 guest_spec_ctrl, u64 guest_virt_spec_ctrl, bool setguest)

Type:void

Parameter:

TypeParameterName
u64guest_spec_ctrl
u64guest_virt_spec_ctrl
boolsetguest
155  hostval = The base value of the SPEC_CTRL MSR that always has to be preserved.
156  ti = current_thread_info()
159  If static_cpu_has("" MSR SPEC_CTRL is implemented ) Then
165  guestval = hostval & ~The vendor and possibly platform specific bits which can be modified in* x86_spec_ctrl_base.
166  guestval |= guest_spec_ctrl & The vendor and possibly platform specific bits which can be modified in* x86_spec_ctrl_base.
169  If static_cpu_has("" Speculative Store Bypass Disable ) || static_cpu_has("" Speculative Store Bypass Disable ) Then hostval |= ssbd_tif_to_spec_ctrl( low level flags )
174  If static_branch_unlikely( & Control conditional STIBP in switch_to() ) Then hostval |= stibp_tif_to_spec_ctrl( low level flags )
177  If hostval != guestval Then
178  msrval = If setguest Then guestval Else hostval
187  If Not static_cpu_has("" AMD SSBD implementation via LS_CFG MSR ) && Not static_cpu_has(Virtualized Speculative Store Bypass Disable ) Then Return
196  If static_cpu_has("" Disable Speculative Store Bypass. ) Then hostval = Speculative Store Bypass Disable
198  Else hostval = ssbd_tif_to_spec_ctrl( low level flags )
202  guestval = guest_virt_spec_ctrl & Speculative Store Bypass Disable
204  If hostval != guestval Then
207  tif = If setguest Then ssbd_spec_ctrl_to_tif(guestval) Else ssbd_spec_ctrl_to_tif(hostval)
210  speculation_ctrl_update(tif)