From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755794AbcJVCS1 (ORCPT ); Fri, 21 Oct 2016 22:18:27 -0400 Received: from mga03.intel.com ([134.134.136.65]:5664 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755140AbcJVCS0 (ORCPT ); Fri, 21 Oct 2016 22:18:26 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,527,1473145200"; d="scan'208";a="1057411103" From: ville.syrjala@linux.intel.com To: linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org, Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Prarit Bhargava , Peter Zijlstra , Len Brown , Borislav Petkov , Andi Kleen , Jiri Olsa , Juergen Gross , dyoung@redhat.com, Eric Biederman , kexec@lists.infradead.org, Thomas Gleixner , =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= Subject: [PATCH] arch/x86: Don't try to poke disabled/non-existent APIC Date: Sat, 22 Oct 2016 05:18:04 +0300 Message-Id: <1477102684-5092-1-git-send-email-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ville Syrjälä Apparently trying to poke a disabled or non-existent APIC leads to a box that doesn't even boot. Let's not do that. No real clue if this is the right fix, but at least my P3 machine boots again. Cc: stable@vger.kernel.org Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: x86@kernel.org Cc: Prarit Bhargava Cc: Peter Zijlstra Cc: Len Brown Cc: Borislav Petkov Cc: Andi Kleen Cc: Jiri Olsa Cc: Juergen Gross Cc: dyoung@redhat.com Cc: Eric Biederman Cc: kexec@lists.infradead.org Cc: Thomas Gleixner Fixes: 2a51fe083eba ("arch/x86: Handle non enumerated CPU after physical hotplug") Signed-off-by: Ville Syrjälä --- arch/x86/kernel/smpboot.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 951f093a96fe..42f5eb7b4f6c 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -1409,15 +1409,17 @@ __init void prefill_possible_map(void) /* No boot processor was found in mptable or ACPI MADT */ if (!num_processors) { - int apicid = boot_cpu_physical_apicid; - int cpu = hard_smp_processor_id(); + if (boot_cpu_has(X86_FEATURE_APIC)) { + int apicid = boot_cpu_physical_apicid; + int cpu = hard_smp_processor_id(); - pr_warn("Boot CPU (id %d) not listed by BIOS\n", cpu); + pr_warn("Boot CPU (id %d) not listed by BIOS\n", cpu); - /* Make sure boot cpu is enumerated */ - if (apic->cpu_present_to_apicid(0) == BAD_APICID && - apic->apic_id_valid(apicid)) - generic_processor_info(apicid, boot_cpu_apic_version); + /* Make sure boot cpu is enumerated */ + if (apic->cpu_present_to_apicid(0) == BAD_APICID && + apic->apic_id_valid(apicid)) + generic_processor_info(apicid, boot_cpu_apic_version); + } if (!num_processors) num_processors = 1; -- 2.7.4