linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: Alexander Graf <agraf@suse.de>
Cc: Mihai Caraman <mihai.caraman@freescale.com>,
	"<linuxppc-dev@lists.ozlabs.org>" <linuxppc-dev@lists.ozlabs.org>,
	"<kvm@vger.kernel.org>" <kvm@vger.kernel.org>,
	"<kvm-ppc@vger.kernel.org>" <kvm-ppc@vger.kernel.org>
Subject: Re: [PATCH] KVM: PPC: e500mc: Add support for single threaded vcpus on e6500 core
Date: Mon, 11 Aug 2014 18:56:18 -0500	[thread overview]
Message-ID: <1407801378.7427.117.camel@snotra.buserror.net> (raw)
In-Reply-To: <3CE03B7F-D9C3-4CD0-8215-9815494A19AF@suse.de>

On Tue, 2014-08-12 at 01:53 +0200, Alexander Graf wrote:
> 
> > Am 12.08.2014 um 01:36 schrieb Scott Wood <scottwood@freescale.com>:
> > 
> >> On Wed, 2014-08-06 at 19:33 +0300, Mihai Caraman wrote:
> >> @@ -390,19 +400,30 @@ static void kvmppc_core_vcpu_free_e500mc(struct kvm_vcpu *vcpu)
> >> 
> >> static int kvmppc_core_init_vm_e500mc(struct kvm *kvm)
> >> {
> >> -    int lpid;
> >> +    int i, lpid;
> >> 
> >> -    lpid = kvmppc_alloc_lpid();
> >> -    if (lpid < 0)
> >> -        return lpid;
> >> +    /* The lpid pool supports only 2 entries now */
> >> +    if (threads_per_core > 2)
> >> +        return -ENOMEM;
> >> +
> >> +    /* Each VM allocates one LPID per HW thread index */
> >> +    for (i = 0; i < threads_per_core; i++) {
> >> +        lpid = kvmppc_alloc_lpid();
> >> +        if (lpid < 0)
> >> +            return lpid;
> >> +
> >> +        kvm->arch.lpid_pool[i] = lpid;
> >> +    }
> > 
> > Wouldn't it be simpler to halve the size of the lpid pool that the
> > allocator sees, and just OR in the high bit based on the low bit of the
> > cpu number?
> 
> Heh, I wrote the same and then removed the section from my reply again. It wouldn't really make that much of a difference if you think it through completely.
> 
> But yes, it certainly would be quite a bit more natural. I'm ok either way.

It's not a huge difference, but it would at least get rid of some of the
ifdeffing in the headers.  It'd also be nicer when debugging to have the
LPIDs correlated.

-Scott

      reply	other threads:[~2014-08-11 23:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-06 16:33 [PATCH] KVM: PPC: e500mc: Add support for single threaded vcpus on e6500 core Mihai Caraman
2014-08-11 14:01 ` Alexander Graf
2014-08-11 23:36 ` Scott Wood
2014-08-11 23:53   ` Alexander Graf
2014-08-11 23:56     ` Scott Wood [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=1407801378.7427.117.camel@snotra.buserror.net \
    --to=scottwood@freescale.com \
    --cc=agraf@suse.de \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mihai.caraman@freescale.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 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).