KVM: x86: Tweak halt emulation helper names to free up kvm_vcpu_halt()
Rename a variety of HLT-related helpers to free up the function name "kvm_vcpu_halt" for future use in generic KVM code, e.g. to differentiate between "block" and "halt". No functional change intended. Reviewed-by: David Matlack <dmatlack@google.com> Signed-off-by: Sean Christopherson <seanjc@google.com> Message-Id: <20211009021236.4122790-13-seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
f6c60d081e
commit
1460179dcd
@ -1696,7 +1696,7 @@ int kvm_emulate_monitor(struct kvm_vcpu *vcpu);
|
||||
int kvm_fast_pio(struct kvm_vcpu *vcpu, int size, unsigned short port, int in);
|
||||
int kvm_emulate_cpuid(struct kvm_vcpu *vcpu);
|
||||
int kvm_emulate_halt(struct kvm_vcpu *vcpu);
|
||||
int kvm_vcpu_halt(struct kvm_vcpu *vcpu);
|
||||
int kvm_emulate_halt_noskip(struct kvm_vcpu *vcpu);
|
||||
int kvm_emulate_ap_reset_hold(struct kvm_vcpu *vcpu);
|
||||
int kvm_emulate_wbinvd(struct kvm_vcpu *vcpu);
|
||||
|
||||
|
@ -3603,7 +3603,7 @@ static int nested_vmx_run(struct kvm_vcpu *vcpu, bool launch)
|
||||
!(nested_cpu_has(vmcs12, CPU_BASED_INTR_WINDOW_EXITING) &&
|
||||
(vmcs12->guest_rflags & X86_EFLAGS_IF))) {
|
||||
vmx->nested.nested_run_pending = 0;
|
||||
return kvm_vcpu_halt(vcpu);
|
||||
return kvm_emulate_halt_noskip(vcpu);
|
||||
}
|
||||
break;
|
||||
case GUEST_ACTIVITY_WAIT_SIPI:
|
||||
|
@ -4697,7 +4697,7 @@ static int handle_rmode_exception(struct kvm_vcpu *vcpu,
|
||||
if (kvm_emulate_instruction(vcpu, 0)) {
|
||||
if (vcpu->arch.halt_request) {
|
||||
vcpu->arch.halt_request = 0;
|
||||
return kvm_vcpu_halt(vcpu);
|
||||
return kvm_emulate_halt_noskip(vcpu);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@ -5368,7 +5368,7 @@ static int handle_invalid_guest_state(struct kvm_vcpu *vcpu)
|
||||
|
||||
if (vcpu->arch.halt_request) {
|
||||
vcpu->arch.halt_request = 0;
|
||||
return kvm_vcpu_halt(vcpu);
|
||||
return kvm_emulate_halt_noskip(vcpu);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -8725,7 +8725,7 @@ void kvm_arch_exit(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
static int __kvm_vcpu_halt(struct kvm_vcpu *vcpu, int state, int reason)
|
||||
static int __kvm_emulate_halt(struct kvm_vcpu *vcpu, int state, int reason)
|
||||
{
|
||||
++vcpu->stat.halt_exits;
|
||||
if (lapic_in_kernel(vcpu)) {
|
||||
@ -8737,11 +8737,11 @@ static int __kvm_vcpu_halt(struct kvm_vcpu *vcpu, int state, int reason)
|
||||
}
|
||||
}
|
||||
|
||||
int kvm_vcpu_halt(struct kvm_vcpu *vcpu)
|
||||
int kvm_emulate_halt_noskip(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
return __kvm_vcpu_halt(vcpu, KVM_MP_STATE_HALTED, KVM_EXIT_HLT);
|
||||
return __kvm_emulate_halt(vcpu, KVM_MP_STATE_HALTED, KVM_EXIT_HLT);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(kvm_vcpu_halt);
|
||||
EXPORT_SYMBOL_GPL(kvm_emulate_halt_noskip);
|
||||
|
||||
int kvm_emulate_halt(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
@ -8750,7 +8750,7 @@ int kvm_emulate_halt(struct kvm_vcpu *vcpu)
|
||||
* TODO: we might be squashing a GUESTDBG_SINGLESTEP-triggered
|
||||
* KVM_EXIT_DEBUG here.
|
||||
*/
|
||||
return kvm_vcpu_halt(vcpu) && ret;
|
||||
return kvm_emulate_halt_noskip(vcpu) && ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(kvm_emulate_halt);
|
||||
|
||||
@ -8758,7 +8758,8 @@ int kvm_emulate_ap_reset_hold(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
int ret = kvm_skip_emulated_instruction(vcpu);
|
||||
|
||||
return __kvm_vcpu_halt(vcpu, KVM_MP_STATE_AP_RESET_HOLD, KVM_EXIT_AP_RESET_HOLD) && ret;
|
||||
return __kvm_emulate_halt(vcpu, KVM_MP_STATE_AP_RESET_HOLD,
|
||||
KVM_EXIT_AP_RESET_HOLD) && ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(kvm_emulate_ap_reset_hold);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user