From: Prarit Bhargava <prarit@redhat.com>
To: ville.syrjala@linux.intel.com, linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org, Ingo Molnar <mingo@redhat.com>,
"H. Peter Anvin" <hpa@zytor.com>,
x86@kernel.org, Peter Zijlstra <peterz@infradead.org>,
Len Brown <len.brown@intel.com>, Borislav Petkov <bp@suse.de>,
Andi Kleen <ak@linux.intel.com>, Jiri Olsa <jolsa@redhat.com>,
Juergen Gross <jgross@suse.com>,
dyoung@redhat.com, Eric Biederman <ebiederm@xmission.com>,
kexec@lists.infradead.org, Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH] arch/x86: Don't try to poke disabled/non-existent APIC
Date: Tue, 25 Oct 2016 14:32:16 -0400 [thread overview]
Message-ID: <580FA530.6040905@redhat.com> (raw)
In-Reply-To: <1477102684-5092-1-git-send-email-ville.syrjala@linux.intel.com>
On 10/21/2016 10:18 PM, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> 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 <mingo@redhat.com>
> Cc: "H. Peter Anvin" <hpa@zytor.com>
> Cc: x86@kernel.org
> Cc: Prarit Bhargava <prarit@redhat.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Len Brown <len.brown@intel.com>
> Cc: Borislav Petkov <bp@suse.de>
> Cc: Andi Kleen <ak@linux.intel.com>
> Cc: Jiri Olsa <jolsa@redhat.com>
> Cc: Juergen Gross <jgross@suse.com>
> Cc: dyoung@redhat.com
> Cc: Eric Biederman <ebiederm@xmission.com>
> Cc: kexec@lists.infradead.org
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Fixes: 2a51fe083eba ("arch/x86: Handle non enumerated CPU after physical hotplug")
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> 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)) {
It looks okay to gate on X86_FEATURE_APIC, but not sure if it should be
cpu_has(&cpu_data(0), X86_FEATURE_APIC)
since smp_store_boot_cpu_info() was already called.
tglx?
P.
> + 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;
>
prev parent reply other threads:[~2016-10-25 18:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-22 2:18 [PATCH] arch/x86: Don't try to poke disabled/non-existent APIC ville.syrjala
2016-10-25 18:32 ` Prarit Bhargava [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=580FA530.6040905@redhat.com \
--to=prarit@redhat.com \
--cc=ak@linux.intel.com \
--cc=bp@suse.de \
--cc=dyoung@redhat.com \
--cc=ebiederm@xmission.com \
--cc=hpa@zytor.com \
--cc=jgross@suse.com \
--cc=jolsa@redhat.com \
--cc=kexec@lists.infradead.org \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=stable@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=ville.syrjala@linux.intel.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).