Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753376AbcLLTGp (ORCPT ); Mon, 12 Dec 2016 14:06:45 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:35857 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752430AbcLLTGn (ORCPT ); Mon, 12 Dec 2016 14:06:43 -0500 Subject: Re: [PATCH v2] x86/smpboot: Make logical package management more robust To: Thomas Gleixner References: <8aa33de4-db18-759b-d2cb-0e25d5ab9d88@oracle.com> <730d61ff-ff1e-df80-3446-7fceb25a6d63@oracle.com> <60e7a807-27fb-f666-270a-9512804deae8@oracle.com> Cc: LKML , x86@kernel.org, Peter Zijlstra , Borislav Petkov , "Charles (Chas) Williams" , "M. Vefa Bicakci" , Alok Kataria , xen-devel , =?UTF-8?Q?Juergen_Gro=c3=9f?= From: Boris Ostrovsky Message-ID: <4b04a0a1-205f-3c6e-50c1-ad3f79d3d89a@oracle.com> Date: Mon, 12 Dec 2016 14:07:54 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1889 Lines: 46 On 12/12/2016 05:04 AM, Thomas Gleixner wrote: > The logical package management has several issues: > > - The APIC ids provided by ACPI are not required to be the same as the > initial APIC id which can be retrieved by CPUID. The APIC ids provided > by ACPI are those which are written by the BIOS into the APIC. The > initial id is set by hardware and can not be changed. The hardware > provided ids contain the real hardware package information. > > Especially AMD sets the effective APIC id different from the hardware id > as they need to reserve space for the IOAPIC ids starting at id 0. > > As a consequence those machines trigger the currently active firmware > bug printouts in dmesg, These are obviously wrong. > > - Virtual machines have their own interesting of enumerating APICs and > packages which are not reliably covered by the current implementation. > > The sizing of the mapping array has been tweaked to be generously large to > handle systems which provide a wrong core count when HT is disabled so the > whole magic which checks for space in the physical hotplug case is not > needed anymore. > > Simplify the whole machinery and do the mapping when the CPU starts and the > CPUID derived physical package information is available. This solves the > observed problems on AMD machines and works for the virtualization issues > as well. > > Remove the extra call from XEN cpu bringup code as it is not longer > required. > > Fixes: d49597fd3bc7 ("x86/cpu: Deal with broken firmware (VMWare/XEN)") > Reported-and-tested-by: Borislav Petkov > Signed-off-by: Thomas Gleixner > Cc: stable@vger.kernel.org For Xen: Tested-by: Boris Ostrovsky (Note that we still have [Firmware Bug]: CPU13: APIC id mismatch. Firmware: 0 APIC: d but that will be fixed in Xen code.) -boris