Skip to content

Commit c3e8abf

Browse files
sean-jcbonzini
authored andcommitted
KVM: x86: Remove defunct pre_block/post_block kvm_x86_ops hooks
Drop kvm_x86_ops' pre/post_block() now that all implementations are nops. No functional change intended. Signed-off-by: Sean Christopherson <[email protected]> Reviewed-by: Maxim Levitsky <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent b6d42ba commit c3e8abf

File tree

4 files changed

+1
-32
lines changed

4 files changed

+1
-32
lines changed

arch/x86/include/asm/kvm-x86-ops.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,6 @@ KVM_X86_OP(handle_exit_irqoff)
9999
KVM_X86_OP_NULL(request_immediate_exit)
100100
KVM_X86_OP(sched_in)
101101
KVM_X86_OP_NULL(update_cpu_dirty_logging)
102-
KVM_X86_OP_NULL(pre_block)
103-
KVM_X86_OP_NULL(post_block)
104102
KVM_X86_OP_NULL(vcpu_blocking)
105103
KVM_X86_OP_NULL(vcpu_unblocking)
106104
KVM_X86_OP_NULL(update_pi_irte)

arch/x86/include/asm/kvm_host.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1454,18 +1454,6 @@ struct kvm_x86_ops {
14541454
const struct kvm_pmu_ops *pmu_ops;
14551455
const struct kvm_x86_nested_ops *nested_ops;
14561456

1457-
/*
1458-
* Architecture specific hooks for vCPU blocking due to
1459-
* HLT instruction.
1460-
* Returns for .pre_block():
1461-
* - 0 means continue to block the vCPU.
1462-
* - 1 means we cannot block the vCPU since some event
1463-
* happens during this period, such as, 'ON' bit in
1464-
* posted-interrupts descriptor is set.
1465-
*/
1466-
int (*pre_block)(struct kvm_vcpu *vcpu);
1467-
void (*post_block)(struct kvm_vcpu *vcpu);
1468-
14691457
void (*vcpu_blocking)(struct kvm_vcpu *vcpu);
14701458
void (*vcpu_unblocking)(struct kvm_vcpu *vcpu);
14711459

arch/x86/kvm/vmx/vmx.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7566,16 +7566,6 @@ void vmx_update_cpu_dirty_logging(struct kvm_vcpu *vcpu)
75667566
secondary_exec_controls_clearbit(vmx, SECONDARY_EXEC_ENABLE_PML);
75677567
}
75687568

7569-
static int vmx_pre_block(struct kvm_vcpu *vcpu)
7570-
{
7571-
return 0;
7572-
}
7573-
7574-
static void vmx_post_block(struct kvm_vcpu *vcpu)
7575-
{
7576-
7577-
}
7578-
75797569
static void vmx_setup_mce(struct kvm_vcpu *vcpu)
75807570
{
75817571
if (vcpu->arch.mcg_cap & MCG_LMCE_P)
@@ -7777,9 +7767,6 @@ static struct kvm_x86_ops vmx_x86_ops __initdata = {
77777767
.cpu_dirty_log_size = PML_ENTITY_NUM,
77787768
.update_cpu_dirty_logging = vmx_update_cpu_dirty_logging,
77797769

7780-
.pre_block = vmx_pre_block,
7781-
.post_block = vmx_post_block,
7782-
77837770
.pmu_ops = &intel_pmu_ops,
77847771
.nested_ops = &vmx_nested_ops,
77857772

arch/x86/kvm/x86.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10148,8 +10148,7 @@ static inline int vcpu_block(struct kvm *kvm, struct kvm_vcpu *vcpu)
1014810148
{
1014910149
bool hv_timer;
1015010150

10151-
if (!kvm_arch_vcpu_runnable(vcpu) &&
10152-
(!kvm_x86_ops.pre_block || static_call(kvm_x86_pre_block)(vcpu) == 0)) {
10151+
if (!kvm_arch_vcpu_runnable(vcpu)) {
1015310152
/*
1015410153
* Switch to the software timer before halt-polling/blocking as
1015510154
* the guest's timer may be a break event for the vCPU, and the
@@ -10171,9 +10170,6 @@ static inline int vcpu_block(struct kvm *kvm, struct kvm_vcpu *vcpu)
1017110170
if (hv_timer)
1017210171
kvm_lapic_switch_to_hv_timer(vcpu);
1017310172

10174-
if (kvm_x86_ops.post_block)
10175-
static_call(kvm_x86_post_block)(vcpu);
10176-
1017710173
if (!kvm_check_request(KVM_REQ_UNHALT, vcpu))
1017810174
return 1;
1017910175
}

0 commit comments

Comments
 (0)