diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 56c7de3977..cb8ecd050d 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -1736,7 +1736,7 @@ void hvm_hlt(unsigned int eflags) if ( unlikely(!(eflags & X86_EFLAGS_IF)) ) return hvm_vcpu_down(curr); - do_sched_op(SCHEDOP_block, guest_handle_from_ptr(NULL, void)); + vcpu_block_enable_events(); TRACE(TRC_HVM_HLT, /* pending = */ vcpu_runnable(curr)); } diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c index db1799bb43..fce750ca1f 100644 --- a/xen/arch/x86/hvm/svm/svm.c +++ b/xen/arch/x86/hvm/svm/svm.c @@ -2159,7 +2159,7 @@ static void svm_vmexit_do_pause(struct cpu_user_regs *regs) * Do something useful, like reschedule the guest */ perfc_incr(pauseloop_exits); - do_sched_op(SCHEDOP_yield, guest_handle_from_ptr(NULL, void)); + vcpu_yield(); } static void diff --git a/xen/arch/x86/hvm/viridian/viridian.c b/xen/arch/x86/hvm/viridian/viridian.c index 33d54e587e..7ea6c90168 100644 --- a/xen/arch/x86/hvm/viridian/viridian.c +++ b/xen/arch/x86/hvm/viridian/viridian.c @@ -959,7 +959,7 @@ int viridian_hypercall(struct cpu_user_regs *regs) /* * See section 14.5.1 of the specification. */ - do_sched_op(SCHEDOP_yield, guest_handle_from_ptr(NULL, void)); + vcpu_yield(); break; case HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE: diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index ce538668c7..cb82d52ef0 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -4768,7 +4768,7 @@ void asmlinkage vmx_vmexit_handler(struct cpu_user_regs *regs) case EXIT_REASON_PAUSE_INSTRUCTION: perfc_incr(pauseloop_exits); - do_sched_op(SCHEDOP_yield, guest_handle_from_ptr(NULL, void)); + vcpu_yield(); break; case EXIT_REASON_XSETBV: diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c index f5a1099ba9..2ab4313517 100644 --- a/xen/common/sched/core.c +++ b/xen/common/sched/core.c @@ -1430,7 +1430,7 @@ void vcpu_block(void) } } -static void vcpu_block_enable_events(void) +void vcpu_block_enable_events(void) { local_event_delivery_enable(); vcpu_block(); diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index df23411869..fd5c9f9333 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -1030,6 +1030,7 @@ static inline bool vcpu_cpu_dirty(const struct vcpu *v) } void vcpu_block(void); +void vcpu_block_enable_events(void); void vcpu_unblock(struct vcpu *v); void vcpu_pause(struct vcpu *v);