linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] KVM: x86: cleanup the page tracking SRCU instance
@ 2017-03-28  8:14 Paolo Bonzini
  2017-03-28  9:13 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Paolo Bonzini @ 2017-03-28  8:14 UTC (permalink / raw)
  To: linux-kernel, kvm; +Cc: dvyukov, rkrcmar, stable

Suggested-by: Dmitry Vyukov <dvyukov@google.com>
Cc: stable@vger.kernel.org
Fixes: 0eb05bf290cfe8610d9680b49abef37febd1c38a
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 arch/x86/include/asm/kvm_page_track.h | 1 +
 arch/x86/kvm/page_track.c             | 8 ++++++++
 arch/x86/kvm/x86.c                    | 1 +
 3 files changed, 10 insertions(+)

diff --git a/arch/x86/include/asm/kvm_page_track.h b/arch/x86/include/asm/kvm_page_track.h
index d74747b031ec..c4eda791f877 100644
--- a/arch/x86/include/asm/kvm_page_track.h
+++ b/arch/x86/include/asm/kvm_page_track.h
@@ -46,6 +46,7 @@ struct kvm_page_track_notifier_node {
 };
 
 void kvm_page_track_init(struct kvm *kvm);
+void kvm_page_track_cleanup(struct kvm *kvm);
 
 void kvm_page_track_free_memslot(struct kvm_memory_slot *free,
 				 struct kvm_memory_slot *dont);
diff --git a/arch/x86/kvm/page_track.c b/arch/x86/kvm/page_track.c
index 37942e419c32..60168cdd0546 100644
--- a/arch/x86/kvm/page_track.c
+++ b/arch/x86/kvm/page_track.c
@@ -160,6 +160,14 @@ bool kvm_page_track_is_active(struct kvm_vcpu *vcpu, gfn_t gfn,
 	return !!ACCESS_ONCE(slot->arch.gfn_track[mode][index]);
 }
 
+void kvm_page_track_cleanup(struct kvm *kvm)
+{
+	struct kvm_page_track_notifier_head *head;
+
+	head = &kvm->arch.track_notifier_head;
+	cleanup_srcu_struct(&head->track_srcu);
+}
+
 void kvm_page_track_init(struct kvm *kvm)
 {
 	struct kvm_page_track_notifier_head *head;
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 64697fe475c3..f2379673912a 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -8070,6 +8070,7 @@ void kvm_arch_sync_events(struct kvm *kvm)
 	cancel_delayed_work_sync(&kvm->arch.kvmclock_update_work);
 	kvm_free_all_assigned_devices(kvm);
 	kvm_free_pit(kvm);
+	kvm_page_track_cleanup(kvm);
 }
 
 int __x86_set_memory_region(struct kvm *kvm, int id, gpa_t gpa, u32 size)
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] KVM: x86: cleanup the page tracking SRCU instance
  2017-03-28  8:14 [PATCH] KVM: x86: cleanup the page tracking SRCU instance Paolo Bonzini
@ 2017-03-28  9:13 ` Greg KH
  2017-03-28  9:16   ` Paolo Bonzini
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2017-03-28  9:13 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: linux-kernel, kvm, dvyukov, rkrcmar, stable

On Tue, Mar 28, 2017 at 10:14:54AM +0200, Paolo Bonzini wrote:
> Suggested-by: Dmitry Vyukov <dvyukov@google.com>
> Cc: stable@vger.kernel.org
> Fixes: 0eb05bf290cfe8610d9680b49abef37febd1c38a
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

A stable patch with no changelog text at all?  That's not ok, please
provide some information at the least to justify this patch for Linus's
tree, and especially for a reason to be backported to a stable kernel...

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] KVM: x86: cleanup the page tracking SRCU instance
  2017-03-28  9:13 ` Greg KH
@ 2017-03-28  9:16   ` Paolo Bonzini
  0 siblings, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2017-03-28  9:16 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel, kvm, dvyukov, rkrcmar, stable



On 28/03/2017 11:13, Greg KH wrote:
>> Suggested-by: Dmitry Vyukov <dvyukov@google.com>
>> Cc: stable@vger.kernel.org
>> Fixes: 0eb05bf290cfe8610d9680b49abef37febd1c38a
>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> A stable patch with no changelog text at all?  That's not ok, please
> provide some information at the least to justify this patch for Linus's
> tree, and especially for a reason to be backported to a stable kernel...

The reason I had no changelog text is that the bug is brown-paper-worthy
and I thought the patch was pretty self-commenting.  But I will fix
before pushing and also add Reported-by in addition to Suggested-by.

Paolo

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-03-28  9:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-28  8:14 [PATCH] KVM: x86: cleanup the page tracking SRCU instance Paolo Bonzini
2017-03-28  9:13 ` Greg KH
2017-03-28  9:16   ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).