All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Fedin <p.fedin@samsung.com>
To: 'Shlomo Pongratz' <shlomo.pongratz@huawei.com>, qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, 'Ashok Kumar' <ashoks@broadcom.com>
Subject: Re: [Qemu-devel] [PATCH] Use Aff1 with mpidr
Date: Fri, 29 May 2015 09:45:14 +0300	[thread overview]
Message-ID: <00f701d099db$0510a990$0f31fcb0$@samsung.com> (raw)
In-Reply-To: <B5C21809C482C148A58516F588CD431467D8C7@szxeml557-mbx.china.huawei.com>

 Hi!

> I see that you added mpidr to ARMCpu and initialized it in virt.c then you use it in
mpidr_read.
> Thus you must fix all other virtual machines in hw/arm not just virt.c as it is not
initialized for
> them.

 The only change in virt.c is:
--- cut ---
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index a7f9a10..a1186c5 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -317,7 +317,11 @@ static void fdt_add_cpu_nodes(const VirtBoardInfo *vbi)
                                         "enable-method", "psci");
         }
 
-        qemu_fdt_setprop_cell(vbi->fdt, nodename, "reg", cpu);
+        /*
+         * If cpus node's #address-cells property is set to 1
+         * The reg cell bits [23:0] must be set to bits [23:0] of MPIDR_EL1.
+         */
+        qemu_fdt_setprop_cell(vbi->fdt, nodename, "reg", armcpu->mpidr);
         g_free(nodename);
     }
 }
--- cut ---
 So that it takes MPIDR instead of just CPU index. Theoretically - yes, may be other
machines should also be changed, but:
1. They are 32-bit, so MPIDR == index for them, because there are no more than 8 CPUs.
2. Those machines AFAIK do not compose device tree by themselves. They use pre-made ones
instead, coming for example with kernel.
 Only virt currently can be a 64-bit machine and cares about more than 8 CPUs.
 As to MPIDR initialization, it is done in arm_cpu_initfn(), therefore all ARM CPUs get
this automatically. There's no need to modify code for every machine.
 I would kindly ask you to use my patch in your next series, or base something on it, if
you dislike the implementation, but it's crucial for KVM that MPIDR values can be obtained
from the host. Your original implementation cannot do this by design, this is why i made
my own solution. See kvm_arch_init_vcpu() in my patch - without this CPUs beyond #7 will
not power up in KVM.
 And when are you planning to post v3? I am waiting for it to be integrated, in order to
add KVM vGICv3. Otherwise i'm afraid there are too many collisions.

Kind regards,
Pavel Fedin
Expert Engineer
Samsung Electronics Research center Russia

  reply	other threads:[~2015-05-29  6:45 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-22 10:32 [Qemu-devel] [PATCH] Use Aff1 with mpidr Pavel Fedin
2015-05-28 14:57 ` Shlomo Pongratz
2015-05-29  6:45   ` Pavel Fedin [this message]
2015-05-31 11:03     ` Shlomo Pongratz
2015-06-01  6:34       ` Pavel Fedin
2015-06-01  9:03       ` Pavel Fedin
2015-06-01 14:26         ` Shlomo Pongratz
2015-06-02  6:29           ` Pavel Fedin
2015-06-02 15:37       ` Igor Mammedov
2015-05-29  8:36 ` Igor Mammedov
2015-05-29  8:53   ` Pavel Fedin
2015-05-29  9:18     ` Igor Mammedov
2015-05-29 12:26       ` Pavel Fedin
2015-05-29 13:03         ` Igor Mammedov
2015-05-29 13:41           ` Pavel Fedin
2015-06-02 15:32             ` Igor Mammedov
2015-06-02 15:42               ` Peter Maydell
2015-06-02 15:54                 ` Igor Mammedov
2015-05-29 17:37           ` Pavel Fedin
2015-05-30  2:30             ` Shannon Zhao

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='00f701d099db$0510a990$0f31fcb0$@samsung.com' \
    --to=p.fedin@samsung.com \
    --cc=ashoks@broadcom.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=shlomo.pongratz@huawei.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.