The commit a377ac1cd9d7b ("x86/entry: Move user return notifier out of
loop") moved fire_user_return_notifiers() into the section with
interrupts disabled, so the callback kvm_on_user_return() cannot be
interrupted by kvm_arch_disable_virtualization_cpu() now. Therefore,
remove the outdated comments and local_irq_save()/local_irq_restore()
code in kvm_on_user_return().
Signed-off-by: Hou Wenlong <houwenlong.hwl@antgroup.com>
---
v1 -> v2: Remove the lockdep_assert_irqs_disabled() because the
callback can be called by kvm_cpu_offline() with interrupts
enabled. Thanks to Chao Gao.
arch/x86/kvm/x86.c | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 33fba801b205..622a1c27d7f9 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -568,18 +568,10 @@ static void kvm_on_user_return(struct user_return_notifier *urn)
struct kvm_user_return_msrs *msrs
= container_of(urn, struct kvm_user_return_msrs, urn);
struct kvm_user_return_msr_values *values;
- unsigned long flags;
- /*
- * Disabling irqs at this point since the following code could be
- * interrupted and executed through kvm_arch_disable_virtualization_cpu()
- */
- local_irq_save(flags);
- if (msrs->registered) {
- msrs->registered = false;
- user_return_notifier_unregister(urn);
- }
- local_irq_restore(flags);
+ msrs->registered = false;
+ user_return_notifier_unregister(urn);
+
for (slot = 0; slot < kvm_nr_uret_msrs; ++slot) {
values = &msrs->values[slot];
if (values->host != values->curr) {
--
2.31.1