All of lore.kernel.org
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: Scott Wood <scottwood@freescale.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
	Alexander Graf <agraf@suse.de>,
	kvm-ppc@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH 1/3] kvm/ppc/booke: Hold srcu lock when calling gfn functions
Date: Thu, 02 May 2013 00:30:04 +0000	[thread overview]
Message-ID: <1367454604.29231.21@snotra> (raw)
In-Reply-To: <1367454443.29231.20@snotra> (from scottwood@freescale.com on Wed May  1 19:27:23 2013)

On 05/01/2013 07:27:23 PM, Scott Wood wrote:
> On 05/01/2013 07:15:53 PM, Marcelo Tosatti wrote:
>> This is not good practice (codepaths should either hold srcu or not  
>> hold
>> it, unconditionally).
> 
> How is it different from moving the srcu lock into individual cases  
> of the switch?  I just did it this way to make it easier to add new  
> exception types if necessary (e.g. at the time I thought I'd end up  
> adding exceptions which lead to instruction emulation, but I ended up  
> acquiring the lock further down the path in that case).
> 
>> Can you give more details of the issue? (not obvious)
> 
> ITLB/DTLB miss call things like gfn_to_memslot() which need the lock  
> (but don't grab it themselves -- that seems like the real bad  
> practice here...).

Never mind on the parenthetical -- grabbing it themselves wouldn't work  
because they return RCU-protected data.

-Scott

WARNING: multiple messages have this Message-ID (diff)
From: Scott Wood <scottwood@freescale.com>
To: Scott Wood <scottwood@freescale.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
	Alexander Graf <agraf@suse.de>, <kvm-ppc@vger.kernel.org>,
	<kvm@vger.kernel.org>
Subject: Re: [PATCH 1/3] kvm/ppc/booke: Hold srcu lock when calling gfn functions
Date: Wed, 1 May 2013 19:30:04 -0500	[thread overview]
Message-ID: <1367454604.29231.21@snotra> (raw)
In-Reply-To: <1367454443.29231.20@snotra> (from scottwood@freescale.com on Wed May  1 19:27:23 2013)

On 05/01/2013 07:27:23 PM, Scott Wood wrote:
> On 05/01/2013 07:15:53 PM, Marcelo Tosatti wrote:
>> This is not good practice (codepaths should either hold srcu or not  
>> hold
>> it, unconditionally).
> 
> How is it different from moving the srcu lock into individual cases  
> of the switch?  I just did it this way to make it easier to add new  
> exception types if necessary (e.g. at the time I thought I'd end up  
> adding exceptions which lead to instruction emulation, but I ended up  
> acquiring the lock further down the path in that case).
> 
>> Can you give more details of the issue? (not obvious)
> 
> ITLB/DTLB miss call things like gfn_to_memslot() which need the lock  
> (but don't grab it themselves -- that seems like the real bad  
> practice here...).

Never mind on the parenthetical -- grabbing it themselves wouldn't work  
because they return RCU-protected data.

-Scott

  reply	other threads:[~2013-05-02  0:30 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-27  0:53 [PATCH 1/3] kvm/ppc/booke: Hold srcu lock when calling gfn functions Scott Wood
2013-04-27  0:53 ` Scott Wood
2013-04-27  0:53 ` [PATCH 2/3] kvm/ppc: Hold srcu lock when calling kvm_io_bus_read/write Scott Wood
2013-04-27  0:53   ` Scott Wood
2013-05-02 11:22   ` Alexander Graf
2013-05-02 11:22     ` Alexander Graf
2013-04-27  0:53 ` [PATCH 3/3] kvm: Fix obsolete comment about locking for kvm_io_bus_read/write Scott Wood
2013-04-27  0:53   ` Scott Wood
2013-05-01 23:24   ` Alexander Graf
2013-05-01 23:24     ` Alexander Graf
2013-05-02  7:18     ` Gleb Natapov
2013-05-02  7:18       ` Gleb Natapov
2013-05-02 10:53       ` Alexander Graf
2013-05-02 10:53         ` Alexander Graf
2013-05-02 11:00         ` Gleb Natapov
2013-05-02 11:00           ` Gleb Natapov
2013-05-02 11:25           ` Alexander Graf
2013-05-02 11:25             ` Alexander Graf
2013-05-02  0:15 ` [PATCH 1/3] kvm/ppc/booke: Hold srcu lock when calling gfn functions Marcelo Tosatti
2013-05-02  0:15   ` Marcelo Tosatti
2013-05-02  0:27   ` Scott Wood
2013-05-02  0:27     ` Scott Wood
2013-05-02  0:30     ` Scott Wood [this message]
2013-05-02  0:30       ` Scott Wood
2013-05-02 11:20     ` Alexander Graf
2013-05-02 11:20       ` Alexander Graf
2013-05-02 14:37     ` Marcelo Tosatti
2013-05-02 14:37       ` Marcelo Tosatti
2013-05-02 16:47       ` Scott Wood
2013-05-02 16:47         ` Scott Wood

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1367454604.29231.21@snotra \
    --to=scottwood@freescale.com \
    --cc=agraf@suse.de \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.