qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: "Alexander Graf" <agraf@suse.de>,
	qemu-devel@nongnu.org, qemu-ppc@nongnu.org,
	"Badari Pulavarty" <pbadari@linux.vnet.ibm.com>,
	"Paul Mackerras" <paulus@samba.org>,
	"Andreas Färber" <afaerber@suse.de>,
	"David Gibson" <david@gibson.dropbear.id.au>
Subject: Re: [Qemu-devel] [PATCH] RFC: spapr: introduce smt_cpu_index
Date: Thu, 31 Oct 2013 13:50:05 +0100	[thread overview]
Message-ID: <527251FD.3000002@redhat.com> (raw)
In-Reply-To: <1383211692-25020-1-git-send-email-aik@ozlabs.ru>

Il 31/10/2013 10:28, Alexey Kardashevskiy ha scritto:
> This is not really a patch to accept or review, this is a conversation
> starter.
> 
> Cc: Badari Pulavarty  <pbadari@linux.vnet.ibm.com>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: David Gibson <david@gibson.dropbear.id.au>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Andreas Färber <afaerber@suse.de>
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> 
> ---
> 
> Normall CPUState::cpu_index is used to pick the right CPU for various
> operations. However default consecutive numbering does not always work
> for PPC64.
> 
> For example, on POWER7 (which supports 4 threads per core),
> "-smp 8,threads=4" should create CPUs with indexes 0,1,2,3,4,5,6,7 and
> "-smp 8,threads=1" should create CPUs with indexes 0,4,8,12,16,20,24,28.
> 
> These indexes are reflected in /proc/device-tree/cpus/PowerPC,POWER7@XX
> and used to call KVM VCPU's ioctl.

I think these two uses should be separated, even if they use the same
formula.  Define a PPC-specific concept, used by TCG as well, and make
kvm_arch_vcpu_id use it.

In other words:

- the hw/ppc/spapr* changes should not use kvm_arch_vcpu_id and
kvm_arch_get_vcpu_by_id, but something like ppc_get_vcpu_dt_id and
ppc_get_vcpu_by_dt_id.

- the comment for the new field should be something like /* The CPU
index used in the device tree.  KVM uses this index too.  */

- kvm_arch_vcpu_id can be a simple wrapper for ppc_get_vcpu_dt_id; no
need for the new kvm_arch_get_vcpu_by_id, and no kvm-stub.c changes
should be necessary either.

- everything else seems fine.

> 2. Apply the patch below and make sure it does not break x86/ARM/s390
> with and without KVM (does not it?);

If you do it right (i.e. do not touch kvm-stub.c) it should "obviously"
not break anything outside PPC.

Paolo

      reply	other threads:[~2013-10-31 12:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-31  9:28 [Qemu-devel] [PATCH] RFC: spapr: introduce smt_cpu_index Alexey Kardashevskiy
2013-10-31 12:50 ` Paolo Bonzini [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=527251FD.3000002@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=afaerber@suse.de \
    --cc=agraf@suse.de \
    --cc=aik@ozlabs.ru \
    --cc=david@gibson.dropbear.id.au \
    --cc=paulus@samba.org \
    --cc=pbadari@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.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 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).