mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
entry/kvm: Explicitly flush pending rcuog wakeup before last rescheduling point
Following the idle loop model, cleanly check for pending rcuog wakeup before the last rescheduling point upon resuming to guest mode. This way we can avoid to do it from rcu_user_enter() with the last resort self-IPI hack that enforces rescheduling. Suggested-by: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Frederic Weisbecker <frederic@kernel.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20210131230548.32970-6-frederic@kernel.org
This commit is contained in:
committed by
Ingo Molnar
parent
47b8ff194c
commit
4ae7dc97f7
@@ -46,6 +46,20 @@ static inline int arch_xfer_to_guest_mode_handle_work(struct kvm_vcpu *vcpu,
|
||||
*/
|
||||
int xfer_to_guest_mode_handle_work(struct kvm_vcpu *vcpu);
|
||||
|
||||
/**
|
||||
* xfer_to_guest_mode_prepare - Perform last minute preparation work that
|
||||
* need to be handled while IRQs are disabled
|
||||
* upon entering to guest.
|
||||
*
|
||||
* Has to be invoked with interrupts disabled before the last call
|
||||
* to xfer_to_guest_mode_work_pending().
|
||||
*/
|
||||
static inline void xfer_to_guest_mode_prepare(void)
|
||||
{
|
||||
lockdep_assert_irqs_disabled();
|
||||
rcu_nocb_flush_deferred_wakeup();
|
||||
}
|
||||
|
||||
/**
|
||||
* __xfer_to_guest_mode_work_pending - Check if work is pending
|
||||
*
|
||||
|
Reference in New Issue
Block a user