From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44719) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZIvi-0006k6-Sr for qemu-devel@nongnu.org; Fri, 26 Feb 2016 08:59:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aZIve-0008SQ-38 for qemu-devel@nongnu.org; Fri, 26 Feb 2016 08:59:38 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54746) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZIvd-0008SL-Rj for qemu-devel@nongnu.org; Fri, 26 Feb 2016 08:59:34 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 46C02C00F6E2 for ; Fri, 26 Feb 2016 13:59:33 +0000 (UTC) From: Igor Mammedov Date: Fri, 26 Feb 2016 14:59:18 +0100 Message-Id: <1456495168-144510-1-git-send-email-imammedo@redhat.com> Subject: [Qemu-devel] [PATCH v4 00/10] pc: do not create invalid MADT.LAPIC/Processor entries List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: marcel@redhat.com, ehabkost@redhat.com, mst@redhat.com Changes since v3: - replace possible-cpus QOM interface with MachineClass.possible_cpu_arch_ids() hook Eduardo Habkost - add ACPI tables test case for sparse topology Changes since v2: - build possible CPUs list only once. Marcel Apfelbaum - replace MachineClass possible_cpu_arch_ids() hook with QOM interface, so only targets that need it would implement it - fix ^2 times present CPU lookup for initial CPUs Eduardo Habkost - drop found_cpus bitmap altogether Changes since v1: - rebased on top of PCI tree that contains Eduardo's guest_info removel series - fix ^2 times present CPU lookup when creating CPON package (spotted-by: Eduardo Habkost ) It's mostly clean up series that removes invalid CPU entries from MADT/DSDT/SRAT tables when APIC IDs are sparse distributed*. Series also removes intermediate present CPUs bitmap in ACPI tables generation code, replacing it with machine reported presence status. That should help later for consolidating and sharing CPU hotplug codebase and extending supported CPU count above 256 on ACPI side, where I'm going to replace current "not scalable" bitmap based CPU hotplug MMIO interface with memory-hotplug like one, which could easily scale and provide additional info for ACPI CPU device objects. Tested hoptlug with: RHEL72 and WS2003 / WS2012R2. Git tree for testing: https://github.com/imammedo/qemu.git pc_madt_dsdt_lapic_cleanups_v4 * example topology with sparse APIC IDs: -smp X,sockets=2,cores=3,maxcpus=6 * it's not possible to remove notion of apic_ad_limit since guest visible interfaces like CPU hoptlug MMIO (CPON array in ACPI + corresponding MMIO in QEMU) and FWCFG should stay the same for compat reasons with current setups and legacy SeaBIOS. Igor Mammedov (10): tests: pc: acpi: piix4: add sparse CPU hotplug case pc: init pcms->apic_id_limit once and use it throughout pc.c machine: introduce MachineClass.possible_cpu_arch_ids() hook pc: acpi: cleanup qdev_get_machine() calls pc: acpi: SRAT: create only valid processor lapic entries pc: acpi: create MADT.lapic entries only for valid lapics pc: acpi: create Processor and Notify objects only for valid lapics pc: acpi: drop cpu->found_cpus bitmap pc: acpi: clarify why possible LAPIC entries must be present in MADT tests: update ACPI tables blobs for cpuhp_sparse case hw/i386/acpi-build.c | 147 +++++++++++++++--------------- hw/i386/pc.c | 89 ++++++++++++------ include/hw/boards.h | 26 ++++++ include/hw/i386/pc.h | 1 + tests/acpi-test-data/pc/APIC.cpuhp_sparse | Bin 0 -> 160 bytes tests/acpi-test-data/pc/DSDT.cpuhp_sparse | Bin 0 -> 5821 bytes tests/acpi-test-data/pc/SRAT.cpuhp_sparse | Bin 0 -> 264 bytes tests/bios-tables-test.c | 16 ++++ 8 files changed, 175 insertions(+), 104 deletions(-) create mode 100644 tests/acpi-test-data/pc/APIC.cpuhp_sparse create mode 100644 tests/acpi-test-data/pc/DSDT.cpuhp_sparse create mode 100644 tests/acpi-test-data/pc/SRAT.cpuhp_sparse -- 1.8.3.1