From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH] KVM: Add documentation for kvm->srcu lock Date: Thu, 12 Sep 2013 18:33:42 +0200 Message-ID: <5231ECE6.4000308@redhat.com> References: <1378740776-1673-1-git-send-email-thuth@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Thomas Huth Return-path: Received: from mail-qe0-f42.google.com ([209.85.128.42]:45357 "EHLO mail-qe0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754641Ab3ILQdf (ORCPT ); Thu, 12 Sep 2013 12:33:35 -0400 Received: by mail-qe0-f42.google.com with SMTP id 1so38123qec.1 for ; Thu, 12 Sep 2013 09:33:34 -0700 (PDT) In-Reply-To: <1378740776-1673-1-git-send-email-thuth@linux.vnet.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: Il 09/09/2013 17:32, Thomas Huth ha scritto: > This patch documents the kvm->srcu lock (using the information from > a mail which has been posted by Marcelo Tosatti to the kvm mailing > list some months ago, see the following URL for details: > http://www.mail-archive.com/kvm@vger.kernel.org/msg90040.html ) > > Signed-off-by: Thomas Huth > Reviewed-by: Xiao Guangrong > --- > Documentation/virtual/kvm/locking.txt | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/Documentation/virtual/kvm/locking.txt b/Documentation/virtual/kvm/locking.txt > index 41b7ac9..a9f366e 100644 > --- a/Documentation/virtual/kvm/locking.txt > +++ b/Documentation/virtual/kvm/locking.txt > @@ -151,3 +151,14 @@ Type: spinlock_t > Arch: any > Protects: -shadow page/shadow tlb entry > Comment: it is a spinlock since it is used in mmu notifier. > + > +Name: kvm->srcu > +Type: srcu lock > +Arch: any > +Protects: - kvm->memslots > + - kvm->buses > +Comment: The srcu read lock must be held while accessing memslots (e.g. > + when using gfn_to_* functions) and while accessing in-kernel > + MMIO/PIO address->device structure mapping (kvm->buses). > + The srcu index can be stored in kvm_vcpu->srcu_idx per vcpu > + if it is needed by multiple functions. > Applied to kvm/queue for 3.12, thanks.