Skip to content

Commit bd3d394

Browse files
committed
x86, KVM: remove unnecessary argument to x86_virt_spec_ctrl and callers
x86_virt_spec_ctrl only deals with the paravirtualized MSR_IA32_VIRT_SPEC_CTRL now and does not handle MSR_IA32_SPEC_CTRL anymore; remove the corresponding, unused argument. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent 9f2febf commit bd3d394

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

arch/x86/include/asm/spec-ctrl.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* Takes the guest view of SPEC_CTRL MSR as a parameter and also
1414
* the guest's version of VIRT_SPEC_CTRL, if emulated.
1515
*/
16-
extern void x86_virt_spec_ctrl(u64 guest_spec_ctrl, u64 guest_virt_spec_ctrl, bool guest);
16+
extern void x86_virt_spec_ctrl(u64 guest_virt_spec_ctrl, bool guest);
1717

1818
/**
1919
* x86_spec_ctrl_set_guest - Set speculation control registers for the guest
@@ -24,9 +24,9 @@ extern void x86_virt_spec_ctrl(u64 guest_spec_ctrl, u64 guest_virt_spec_ctrl, bo
2424
* Avoids writing to the MSR if the content/bits are the same
2525
*/
2626
static inline
27-
void x86_spec_ctrl_set_guest(u64 guest_spec_ctrl, u64 guest_virt_spec_ctrl)
27+
void x86_spec_ctrl_set_guest(u64 guest_virt_spec_ctrl)
2828
{
29-
x86_virt_spec_ctrl(guest_spec_ctrl, guest_virt_spec_ctrl, true);
29+
x86_virt_spec_ctrl(guest_virt_spec_ctrl, true);
3030
}
3131

3232
/**
@@ -38,9 +38,9 @@ void x86_spec_ctrl_set_guest(u64 guest_spec_ctrl, u64 guest_virt_spec_ctrl)
3838
* Avoids writing to the MSR if the content/bits are the same
3939
*/
4040
static inline
41-
void x86_spec_ctrl_restore_host(u64 guest_spec_ctrl, u64 guest_virt_spec_ctrl)
41+
void x86_spec_ctrl_restore_host(u64 guest_virt_spec_ctrl)
4242
{
43-
x86_virt_spec_ctrl(guest_spec_ctrl, guest_virt_spec_ctrl, false);
43+
x86_virt_spec_ctrl(guest_virt_spec_ctrl, false);
4444
}
4545

4646
/* AMD specific Speculative Store Bypass MSR data */

arch/x86/kernel/cpu/bugs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ void __init check_bugs(void)
200200
* MSR_IA32_SPEC_CTRL for SSBD.
201201
*/
202202
void
203-
x86_virt_spec_ctrl(u64 guest_spec_ctrl, u64 guest_virt_spec_ctrl, bool setguest)
203+
x86_virt_spec_ctrl(u64 guest_virt_spec_ctrl, bool setguest)
204204
{
205205
u64 guestval, hostval;
206206
struct thread_info *ti = current_thread_info();

arch/x86/kvm/svm/svm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3984,15 +3984,15 @@ static __no_kcsan fastpath_t svm_vcpu_run(struct kvm_vcpu *vcpu)
39843984
* being speculatively taken.
39853985
*/
39863986
if (!static_cpu_has(X86_FEATURE_V_SPEC_CTRL))
3987-
x86_spec_ctrl_set_guest(svm->spec_ctrl, svm->virt_spec_ctrl);
3987+
x86_spec_ctrl_set_guest(svm->virt_spec_ctrl);
39883988

39893989
svm_vcpu_enter_exit(vcpu, spec_ctrl_intercepted);
39903990

39913991
if (!sev_es_guest(vcpu->kvm))
39923992
reload_tss(vcpu);
39933993

39943994
if (!static_cpu_has(X86_FEATURE_V_SPEC_CTRL))
3995-
x86_spec_ctrl_restore_host(svm->spec_ctrl, svm->virt_spec_ctrl);
3995+
x86_spec_ctrl_restore_host(svm->virt_spec_ctrl);
39963996

39973997
if (!sev_es_guest(vcpu->kvm)) {
39983998
vcpu->arch.cr2 = svm->vmcb->save.cr2;

0 commit comments

Comments
 (0)