diff options
| author | Paolo Bonzini <pbonzini@redhat.com> | 2021-04-22 02:39:48 -0400 |
|---|---|---|
| committer | Paolo Bonzini <pbonzini@redhat.com> | 2021-04-22 13:19:01 -0400 |
| commit | fd49e8ee70b306a003323a17bbcc0633f322c135 (patch) | |
| tree | be0e5f131ee5afdbaa7a6b5fc76bb36baad8c067 /arch/x86/kernel/kvm.c | |
| parent | 238eca821cee90e91139da84ef4f38c74d7cf0d9 (diff) | |
| parent | 7aef27f0b2a8a58c28578d3e0caf3f27e1a1c39c (diff) | |
| download | linux-fd49e8ee70b306a003323a17bbcc0633f322c135.tar.gz linux-fd49e8ee70b306a003323a17bbcc0633f322c135.tar.bz2 linux-fd49e8ee70b306a003323a17bbcc0633f322c135.zip | |
Merge branch 'kvm-sev-cgroup' into HEAD
Diffstat (limited to 'arch/x86/kernel/kvm.c')
| -rw-r--r-- | arch/x86/kernel/kvm.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index 224a7a1ed6c3..bd01a6131edf 100644 --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c @@ -828,28 +828,25 @@ static void kvm_kick_cpu(int cpu) static void kvm_wait(u8 *ptr, u8 val) { - unsigned long flags; - if (in_nmi()) return; - local_irq_save(flags); - - if (READ_ONCE(*ptr) != val) - goto out; - /* * halt until it's our turn and kicked. Note that we do safe halt * for irq enabled case to avoid hang when lock info is overwritten * in irq spinlock slowpath and no spurious interrupt occur to save us. */ - if (arch_irqs_disabled_flags(flags)) - halt(); - else - safe_halt(); + if (irqs_disabled()) { + if (READ_ONCE(*ptr) == val) + halt(); + } else { + local_irq_disable(); -out: - local_irq_restore(flags); + if (READ_ONCE(*ptr) == val) + safe_halt(); + + local_irq_enable(); + } } #ifdef CONFIG_X86_32 |
