From patchwork Fri May 29 06:45:14 2015
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Pavel Fedin
X-Patchwork-Id: 477596
Return-Path:
X-Original-To: incoming@patchwork.ozlabs.org
Delivered-To: patchwork-incoming@bilbo.ozlabs.org
Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])
(using TLSv1 with cipher AES256-SHA (256/256 bits))
(No client certificate requested)
by ozlabs.org (Postfix) with ESMTPS id D942E140E1E
for ;
Fri, 29 May 2015 16:45:44 +1000 (AEST)
Received: from localhost ([::1]:33859 helo=lists.gnu.org)
by lists.gnu.org with esmtp (Exim 4.71) (envelope-from
)
id 1YyE33-0005S8-G3
for incoming@patchwork.ozlabs.org; Fri, 29 May 2015 02:45:41 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:57438)
by lists.gnu.org with esmtp (Exim 4.71)
(envelope-from ) id 1YyE2m-00055u-OP
for qemu-devel@nongnu.org; Fri, 29 May 2015 02:45:25 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from ) id 1YyE2i-0007ux-ND
for qemu-devel@nongnu.org; Fri, 29 May 2015 02:45:24 -0400
Received: from mailout1.w1.samsung.com ([210.118.77.11]:39895)
by eggs.gnu.org with esmtp (Exim 4.71)
(envelope-from ) id 1YyE2i-0007uN-I9
for qemu-devel@nongnu.org; Fri, 29 May 2015 02:45:20 -0400
Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245])
by mailout1.w1.samsung.com
(Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5
2014)) with ESMTP id <0NP3008F6MRGTXA0@mailout1.w1.samsung.com> for
qemu-devel@nongnu.org; Fri, 29 May 2015 07:45:16 +0100 (BST)
X-AuditID: cbfec7f5-f794b6d000001495-24-55680afb5f05
Received: from eusync3.samsung.com ( [203.254.199.213])
by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 1E.A5.05269.BFA08655;
Fri, 29 May 2015 07:45:15 +0100 (BST)
Received: from fedinw7x64 ([106.109.131.169])
by eusync3.samsung.com (Oracle Communications Messaging Server
7.0.5.31.0 64bit (built May 5 2014))
with ESMTPA id <0NP3004PPMREAX20@eusync3.samsung.com>; Fri,
29 May 2015 07:45:15 +0100 (BST)
From: Pavel Fedin
To: 'Shlomo Pongratz' , qemu-devel@nongnu.org
References: <011801d0947a$a9e1e8a0$fda5b9e0$@samsung.com>
In-reply-to:
Date: Fri, 29 May 2015 09:45:14 +0300
Message-id: <00f701d099db$0510a990$0f31fcb0$@samsung.com>
MIME-version: 1.0
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7bit
X-Mailer: Microsoft Outlook 14.0
Thread-index: AQIymkSLvn57n+10ATPOiWjKqlF/qAHTQAEtnL/kYcA=
Content-language: ru
X-Brightmail-Tracker:
H4sIAAAAAAAAA+NgFnrNLMWRmVeSWpSXmKPExsVy+t/xq7q/uTJCDV63aVscWPyJxWLOmQcs
Fsd7d7BYtH3+zu7A4jHr/lk2j5Yjb1k97lzbw+bx5NpmpgCWKC6blNSczLLUIn27BK6MiRcv
MxZcEahYMI2rgfEWTxcjB4eEgInE+lUpXYycQKaYxIV769m6GLk4hASWMkrMa13LDuF8Z5T4
3DORDaSKTUBd4vTXDywgtoiAp8S3BdvYQWxmAUeJDW/7WCAamhkllk9oYQZJcAqESRyf0cgI
YgsLaEgsbV/LCrKZRUBVYutxV5Awr4ClxIotF9ggbEGJH5PvsUDM1JJYv/M4E4QtL7F5zVtm
iEsVJHacfc0IcYOVxO4X2xghakQkpv27xzyBUWgWklGzkIyahWTULCQtCxhZVjGKppYmFxQn
peca6RUn5haX5qXrJefnbmKERMHXHYxLj1kdYhTgYFTi4e24kR4qxJpYVlyZe4hRgoNZSYR3
51ugEG9KYmVValF+fFFpTmrxIUZpDhYlcd6Zu96HCAmkJ5akZqemFqQWwWSZODilGhgvnd/6
T8h/7amENbuebbrgEfj6ldbEtv0volx1y844B3xwvFIct68mLGcS/52vEyYeq2Lkeel5xIj1
lstDv/yi7+cPdlZeP3zsvLmitIDgSZNfdxW1n8yYLH/i+GKL1L0S/zXKw2x/bGG4+2fxxpYT
vPwqJS7n4lKWXHZ5du25nFDy/suWglEpSizFGYmGWsxFxYkA9z+dTn4CAAA=
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
recognized.
X-Received-From: 210.118.77.11
Cc: peter.maydell@linaro.org, 'Ashok Kumar'
Subject: Re: [Qemu-devel] [PATCH] Use Aff1 with mpidr
X-BeenThere: qemu-devel@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id:
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org
Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org
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
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
--- 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 ---