Received: from eggs.gnu.org ([2001:4830:134:3::10]:58155) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYKfI-0005Uq-Hj for qemu-devel@nongnu.org; Tue, 23 Feb 2016 16:38:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aYKfF-00085z-3p for qemu-devel@nongnu.org; Tue, 23 Feb 2016 16:38:40 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43032) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYKfE-00085p-UY for qemu-devel@nongnu.org; Tue, 23 Feb 2016 16:38:37 -0500 Date: Tue, 23 Feb 2016 18:38:33 -0300 From: Eduardo Habkost Message-ID: <20160223213833.GG3901@thinpad.lan.raisama.net> References: <1456243560-67516-1-git-send-email-imammedo@redhat.com> <1456243560-67516-3-git-send-email-imammedo@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1456243560-67516-3-git-send-email-imammedo@redhat.com> Subject: Re: [Qemu-devel] [PATCH v3 2/8] cpu: introduce possible-cpus interface List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: mst@redhat.com, qemu-devel@nongnu.org, marcel.apfelbaum@gmail.com, Paolo Bonzini , afaerber@suse.de, Richard Henderson On Tue, Feb 23, 2016 at 05:05:54PM +0100, Igor Mammedov wrote: > on x86 currently range 0..max_cpus is used to generate > architecture-dependent CPU ID (APIC Id) for each present > and possible CPUs. However architecture-dependent CPU IDs > list could be sparse and code that needs to enumerate > all IDs (ACPI) ended up doing guess work enumerating all > possible and impossible IDs up to > apic_id_limit = x86_cpu_apic_id_from_index(max_cpus). > > That leads to creation of MADT/SRAT entries and Processor > objects in ACPI tables for not possible CPUs. > Fix it by allowing board specify a concrete list of > CPU IDs accourding its own rules (which for x86 depends > on topology). So that code that needs this list could > request it from board instead of trying to figure out > what IDs are correct on its own. > > This interface will also allow to help making AML > part of CPU hotplug target independent so it could > be reused for ARM target. Do you expect any non-TYPE_MACHINE class to implement this interface? If not, why not just make it a simple MachineClass field? Machines that don't implement the get_possible_cpus_list() method would just have it set to NULL. -- Eduardo