public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Yinghai Lu <yhlu.kernel@gmail.com>
Cc: mingo@redhat.com, hpa@zytor.com, linux-kernel@vger.kernel.org,
	yinghai@kernel.org, tglx@linutronix.de, mingo@elte.hu,
	linux-tip-commits@vger.kernel.org
Subject: Re: [tip:irq/numa] x86, apic: Fix dummy apic read operation together with broken MP handling
Date: Mon, 8 Jun 2009 00:39:51 +0400	[thread overview]
Message-ID: <20090607203951.GF4547@lenovo> (raw)
In-Reply-To: <86802c440906071223w3116f452n7ccd028d52f11c77@mail.gmail.com>

[Yinghai Lu - Sun, Jun 07, 2009 at 12:23:47PM -0700]
...
| > diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
| > index d2e8de9..7c80007 100644
| > --- a/arch/x86/kernel/smpboot.c
| > +++ b/arch/x86/kernel/smpboot.c
| > @@ -992,10 +992,12 @@ static int __init smp_sanity_check(unsigned max_cpus)
| >         */
| >        if (APIC_INTEGRATED(apic_version[boot_cpu_physical_apicid]) &&
| >            !cpu_has_apic) {
| > -               printk(KERN_ERR "BIOS bug, local APIC #%d not detected!...\n",
| > -                       boot_cpu_physical_apicid);
| > -               printk(KERN_ERR "... forcing use of dummy APIC emulation."
| > +               if (!disable_apic) {
| > +                       pr_err("BIOS bug, local APIC #%d not detected!...\n",
| > +                               boot_cpu_physical_apicid);
| > +                       pr_err("... forcing use of dummy APIC emulation."
| >                                "(tell your hw vendor)\n");
| > +               }
| 
| It seems we don't need this check here.
| when we have disable_apic, cpu_has_apic is cleared forcely.
| 
| YH
| 

No Yinghai, it's needed. The check is for !disable_apic
and if we really has a BIOS bug we should report about
it _only_ in case if it's a bios bug not apic being
disabled via boot line. I could be missing something
of course. Rechecking...

Ah, I remember the scenario I've kept in mind while
was cooking the patch.

1) MP apic entry is broken.
2) apic was disabled via boot option.
3) kernel compiled with smp support.

So we have the calls

init_apic_mappings
		(due to boot option)
		apic_disable()
	(due to broken MP)
	apic_version[new_apicid] = 0
smp_sanity_check
	if (APIC_INTEGRATED(apic_version[boot_cpu_physical_apicid]) &&
	    !cpu_has_apic) {
Stop! So APIC_INTEGRATED returns false now regargless of what
really we have on HW level. Darn! Actually I was in idea
this if() should be true so SMP support will be turned _off_.

Yinghai, I think we need to set apic_version[boot_cpu_physical_apicid]
to 0xf0 in case if apic is disabled via cmdline option together with
broken MP. Thoughts?

To Ingo: this !disable_apic will be needed if Yinghai confirm
that my idea is right. Meanwhile -- it's just an always-true
cpu consuming operation. So should not be harming. But sorry
anyway -- was thinking about one way but reached another.

	-- Cyrill

  reply	other threads:[~2009-06-07 20:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-07 12:48 [PATCH -tip] x86: apic - fix dummy apic read operation together with broken MP handling Cyrill Gorcunov
2009-06-07 14:24 ` [tip:irq/numa] x86, apic: Fix " tip-bot for Cyrill Gorcunov
2009-06-07 14:33   ` Cyrill Gorcunov
2009-06-07 19:23   ` Yinghai Lu
2009-06-07 20:39     ` Cyrill Gorcunov [this message]
2009-06-07 22:59       ` Yinghai Lu
2009-06-08 15:16         ` Cyrill Gorcunov
2009-06-08 17:47           ` Cyrill Gorcunov

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=20090607203951.GF4547@lenovo \
    --to=gorcunov@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=yhlu.kernel@gmail.com \
    --cc=yinghai@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