public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Mikael Pettersson <mikpe@it.uu.se>
Cc: Ingo Molnar <mingo@elte.hu>,
	linux-kernel@vger.kernel.org, mingo@redhat.com,
	tglx@linutronix.de
Subject: Re: [BUG] 2.6.25-rc2-git8 fails to boot on 486 due to TSC breakage
Date: Sun, 24 Feb 2008 16:57:40 -0800	[thread overview]
Message-ID: <47C21284.7040607@zytor.com> (raw)
In-Reply-To: <18369.43239.964660.62249@harpo.it.uu.se>

Mikael Pettersson wrote:
> 
> Here's how the breakage occurs:
> 1. arch/x86/kernel/tsc_32.c:tsc_init() sees !cpu_has_tsc,
>    so bails and calls setup_clear_cpu_cap(X86_FEATURE_TSC).
> 2. include/asm-x86/cpufeature.h:setup_clear_cpu_cap(bit) clears
>    the bit in boot_cpu_data and sets it in cleared_cpu_caps
> 3. arch/x86/kernel/cpu/common.c:identify_cpu() XORs all caps
>    in with cleared_cpu_caps
>    HOWEVER, at this point c->x86_capability correctly has TSC
>    Off, cleared_cpu_caps has TSC On, so the XOR incorrectly
>    sets TSC to On in c->x86_capability, with disastrous results.
> 
> The real bug is that clearing bits with XOR only works if the
> bits are known to be 1 prior to the XOR, and that's not true here.
> 
> A simple fix is to convert the XOR to AND-NOT instead. The following
> patch does that, and allows my 486 to boot 2.6.25-rc kernels again.
> 

Please fix it in both places.  Using XOR instead of AND-NOT is a bug, 
plain and simple.

	-hpa

  parent reply	other threads:[~2008-02-25  1:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-24 11:07 [BUG] 2.6.25-rc2-git8 fails to boot on 486 due to TSC breakage Mikael Pettersson
2008-02-24 13:57 ` Ingo Molnar
2008-02-24 15:16   ` Mikael Pettersson
2008-02-24 15:32     ` Ingo Molnar
2008-02-24 17:27     ` Mikael Pettersson
2008-02-24 17:52       ` Ingo Molnar
2008-02-25  0:57       ` H. Peter Anvin [this message]
2008-02-25  8:26         ` Ingo Molnar
2008-02-25  9:17           ` Mikael Pettersson
2008-02-25  9:19             ` Ingo Molnar

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=47C21284.7040607@zytor.com \
    --to=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikpe@it.uu.se \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    /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