KVM: flush deferred static key before checking it
diff mbox series

Message ID 20210226100853.75344-1-pbonzini@redhat.com
State Accepted
Commit c462f859f895840e7cd4f20f822ad4c6df2db489
Headers show
Series
  • KVM: flush deferred static key before checking it
Related show

Commit Message

Paolo Bonzini Feb. 26, 2021, 10:08 a.m. UTC
A missing flush would cause the static branch to trigger incorrectly.

Cc: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 arch/x86/kvm/x86.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Woodhouse, David March 1, 2021, 12:24 p.m. UTC | #1
On Fri, 2021-02-26 at 05:08 -0500, Paolo Bonzini wrote:
> A missing flush would cause the static branch to trigger incorrectly.
> 
> Cc: David Woodhouse <dwmw@amazon.co.uk>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>

Thanks.




Amazon Development Centre (London) Ltd. Registered in England and Wales with registration number 04543232 with its registered office at 1 Principal Place, Worship Street, London EC2A 2FA, United Kingdom.

Patch
diff mbox series

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 1d2bc89431a2..bfc928495bd4 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -8039,6 +8039,7 @@  void kvm_arch_exit(void)
 	kvm_mmu_module_exit();
 	free_percpu(user_return_msrs);
 	kmem_cache_destroy(x86_fpu_cache);
+	static_key_deferred_flush(&kvm_xen_enabled);
 	WARN_ON(static_branch_unlikely(&kvm_xen_enabled.key));
 }