From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32794) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gUXqk-0000tW-LX for qemu-devel@nongnu.org; Wed, 05 Dec 2018 09:08:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gUXqg-0004GE-Lt for qemu-devel@nongnu.org; Wed, 05 Dec 2018 09:08:26 -0500 References: <65d3a572-9a80-f332-1f88-69e43e8a3663@redhat.com> <20181126132731.GJ18284@habkost.net> <50645862-a638-ad2a-bafe-1b46be42aec4@greensocs.com> <20181204180607.GB18284@habkost.net> <20181204190548.GH18284@habkost.net> <20181204194532.GJ18284@habkost.net> From: Luc Michel Message-ID: Date: Wed, 5 Dec 2018 15:02:45 +0100 MIME-Version: 1.0 In-Reply-To: <20181204194532.GJ18284@habkost.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v7 01/16] hw/cpu: introduce CPU clusters List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost , Peter Maydell Cc: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , Alistair Francis , Mark Burton , QEMU Developers , =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , Sai Pavan Boddu , Edgar Iglesias , qemu-arm , Paolo Bonzini On 12/4/18 8:45 PM, Eduardo Habkost wrote: > On Tue, Dec 04, 2018 at 07:16:39PM +0000, Peter Maydell wrote: >> On Tue, 4 Dec 2018 at 19:05, Eduardo Habkost wro= te: >>> On Tue, Dec 04, 2018 at 06:24:19PM +0000, Peter Maydell wrote: >>>> A cluster is a group of CPUs which are all identical and have >>>> the same view of the rest of the system. >> >>> With that definition in mind, why can't QEMU cluster CPUs >>> automatically by looking at CPU models and address space objects? >> >> That sounds like it is in theory feasible and in practice >> quite tricky. You would have to look not just at the CPU >> model name but also introspect all its properties for >> ones which change features of the CPU and are set differently >> on different CPUs (and I don't think there's any way to >> automatically tell which properties are ones which make >> the CPU different for which-cluster purposes and which aren't). >> And if we automatically checked whether address space objects >> were the same it would rule out implementing devices with >> per-cpu banked memory mapped registers by mapping different >> things into the AS for each CPU (though that's a hypothetical >> at the moment -- I've thought about implementing stuff that >> way but we tend to implement that sort of thing by looking >> at current_cpu->cpu_index at the moment). >=20 > I see. >=20 > Can't we at least do something to make sure the cluster objects > make sense? e.g. by ensuring at least QOM CPU type is the same, > and that cpu->address_space somehow points to > cpu->cluster->address_space? Where such a check should be placed? Cluster realize function is not good since children can still be added after device realization. A good place would be when object_property_add_child() is called, but I'm not aware of a way of hooking into that with the QOM API... --=20 Luc >=20 > CCing Paolo, so he can correct me if this doesn't make sense. >=20