diff options
author | Lan Tianyu <tianyu.lan@intel.com> | 2016-03-12 22:10:25 -0500 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2016-03-22 11:38:29 -0400 |
commit | 36ca7e0a577aa61f648953886958e50398732d63 (patch) | |
tree | 2dc262ff52cec489c35342541ea1e49e3d444a7d | |
parent | 9753f529156d03112d1ff6f3758ccd6fa6faf189 (diff) |
KVM/x86: Replace smp_mb() with smp_store_mb/release() in the walk_shadow_page_lockless_begin/end()
Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r-- | arch/x86/kvm/mmu.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index fc8ab1f67d00..6bdfbc23ecaa 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c | |||
@@ -632,12 +632,12 @@ static void walk_shadow_page_lockless_begin(struct kvm_vcpu *vcpu) | |||
632 | * kvm_flush_remote_tlbs() IPI to all active vcpus. | 632 | * kvm_flush_remote_tlbs() IPI to all active vcpus. |
633 | */ | 633 | */ |
634 | local_irq_disable(); | 634 | local_irq_disable(); |
635 | vcpu->mode = READING_SHADOW_PAGE_TABLES; | 635 | |
636 | /* | 636 | /* |
637 | * Make sure a following spte read is not reordered ahead of the write | 637 | * Make sure a following spte read is not reordered ahead of the write |
638 | * to vcpu->mode. | 638 | * to vcpu->mode. |
639 | */ | 639 | */ |
640 | smp_mb(); | 640 | smp_store_mb(vcpu->mode, READING_SHADOW_PAGE_TABLES); |
641 | } | 641 | } |
642 | 642 | ||
643 | static void walk_shadow_page_lockless_end(struct kvm_vcpu *vcpu) | 643 | static void walk_shadow_page_lockless_end(struct kvm_vcpu *vcpu) |
@@ -647,8 +647,7 @@ static void walk_shadow_page_lockless_end(struct kvm_vcpu *vcpu) | |||
647 | * reads to sptes. If it does, kvm_commit_zap_page() can see us | 647 | * reads to sptes. If it does, kvm_commit_zap_page() can see us |
648 | * OUTSIDE_GUEST_MODE and proceed to free the shadow page table. | 648 | * OUTSIDE_GUEST_MODE and proceed to free the shadow page table. |
649 | */ | 649 | */ |
650 | smp_mb(); | 650 | smp_store_release(&vcpu->mode, OUTSIDE_GUEST_MODE); |
651 | vcpu->mode = OUTSIDE_GUEST_MODE; | ||
652 | local_irq_enable(); | 651 | local_irq_enable(); |
653 | } | 652 | } |
654 | 653 | ||