mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vivek Goyal <vgoyal@in.ibm.com>
To: "Mika Penttilä" <mika.penttila@kolumbus.fi>
Cc: vgoyal@in.ibm.com,
	linux kernel mailing list <linux-kernel@vger.kernel.org>,
	Fastboot mailing list <fastboot@lists.osdl.org>,
	Andi Kleen <ak@muc.de>, Morton Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH] x86_64 write apic id fix
Date: Fri, 30 Dec 2005 17:14:53 +0530	[thread overview]
Message-ID: <20051230114453.GF11470@in.ibm.com> (raw)
In-Reply-To: <43B40757.7040706@kolumbus.fi>

On Thu, Dec 29, 2005 at 05:57:11PM +0200, Mika Penttilä wrote:
> Vivek Goyal wrote:
> 
> >o Apic id is in most significant 8 bits of APIC_ID register. Current code
> > is trying to write apic id to least significant 8 bits. This patch fixes
> > it.
> >
> >o This fix enables booting uni kdump capture kernel on a cpu with non-zero
> > apic id.
> >
> >Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
> >---
> >
> > 
> >
> What difference does it make in the first place? In 
> APIC_init_uniprocessor() you write back the apic id read before from 
> processor, not from mp table (because you wouldn't be in 
> APIC_init_uniprocessor() otherwise).
> 

In this case APIC_init_uniprocessor() is being called from smp_init() as
I have compiled this as a uni kernel. And smp_found_config is 1. So this
can not be guaranteed that boot_cpu_id has been read from APIC.

But at the same time I see two functions (detect_init_APIC() and
init_apic_mappings()) which overwrite the boot_cpu_id unconditionally. Former
sets it to zero by default and later always reads it from APIC. This 
basically means that we just don't trust the MP tables in all the cases.

For kdump case, this becomes further tricky, as we boot into a second
kernel without going through the BIOS and we might be booting on a cpu
with non-zero apic id. But ACPI and MP tables will continue to report
boot cpu id as 0 and that's not correct. 

To come back to your question, I have just fixed one problem and that is
if you are writing boot_cpu_id to APIC_ID register, write it in a proper
manner. Otherwise what happens in this case is that boot_cpu_id is 1 and
if I use apic_write_around(apic, boot_cpu_id) then it writes 0 to APIC_ID
register instead of 1 and definitely that's not the requirement.

Thanks
Vivek

      reply	other threads:[~2005-12-30 11:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-29  8:27 Vivek Goyal
2005-12-29 12:16 ` Andi Kleen
2005-12-29 15:57 ` Mika Penttilä
2005-12-30 11:44   ` Vivek Goyal [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=20051230114453.GF11470@in.ibm.com \
    --to=vgoyal@in.ibm.com \
    --cc=ak@muc.de \
    --cc=akpm@osdl.org \
    --cc=fastboot@lists.osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.penttila@kolumbus.fi \
    /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

Powered by JetHome