All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: kvm-ppc@vger.kernel.org
Subject: Re: [PATCH 11/13] KVM: PPC: e500: Add shadow PID support
Date: Tue, 14 Jun 2011 20:01:36 +0000	[thread overview]
Message-ID: <9DDFD01C-FBC2-459C-82B9-9E267567F279@suse.de> (raw)
In-Reply-To: <20110517234242.GI3580@schlenkerla.am.freescale.net>


On 14.06.2011, at 21:37, Scott Wood wrote:

> On Tue, 14 Jun 2011 12:41:03 +0200
> Alexander Graf <agraf@suse.de> wrote:
> 
>> 
>> On 03.06.2011, at 01:17, Scott Wood wrote:
>> 
>>> +static void kvmppc_e500_stlbe_invalidate(struct kvmppc_vcpu_e500 *vcpu_e500,
>>> +					 int tlbsel, int esel)
>>> +{
>>> +	struct tlbe *gtlbe = &vcpu_e500->gtlb_arch[tlbsel][esel];
>>> +	struct vcpu_id_table *idt = vcpu_e500->idt;
>>> +	unsigned int pr, tid, ts, pid;
>>> +	u32 val, eaddr;
>>> +	unsigned long flags;
>>> +
>>> +	ts = get_tlb_ts(gtlbe);
>>> +	tid = get_tlb_tid(gtlbe);
>>> +
>>> +	preempt_disable();
>>> +
>>> +	/* One guest ID may be mapped to two shadow IDs */
>>> +	for (pr = 0; pr < 2; pr++) {
>>> +		/*
>>> +		 * The shadow PID can have a valid mapping on at most one
>>> +		 * host CPU.  In the common case, it will be valid on this
>> 
>> Not sure I understand this part. Who ensures that a shadow pid is only valid on a single CPU? 
> 
> vcpu_e500->idt->id[...]->pentry can only point to one place at a time.  Any
> other shadow PIDs (e.g. on other host CPUs) that it used to point to are
> now invalid, and will not be re-used if the vcpu returns to that host CPU
> (other than by having that host CPU reset its shadow PIDs once
> they're exhausted, invalidating everything).
> 
> The linkage must match in both directions in local_sid_lookup(), or a new
> shadow ID will be allocated (and the old one put out of use when pentry is
> updated).

Ah, and since the other direction is vcpu local, there's no need to do anything atomically. Very nice indeed.


Alex


      parent reply	other threads:[~2011-06-14 20:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-17 23:42 [PATCH 11/13] KVM: PPC: e500: Add shadow PID support Scott Wood
2011-05-19 13:18 ` Alexander Graf
2011-05-19 18:26 ` Scott Wood
2011-06-02 23:17 ` Scott Wood
2011-06-14 10:41 ` Alexander Graf
2011-06-14 19:37 ` Scott Wood
2011-06-14 20:01 ` Alexander Graf [this message]

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=9DDFD01C-FBC2-459C-82B9-9E267567F279@suse.de \
    --to=agraf@suse.de \
    --cc=kvm-ppc@vger.kernel.org \
    /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.