public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Darren Hart <dvhltc@us.ibm.com>
To: Joseph Parmelee <jparmele@wildbear.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@elte.hu>,
	Eric Dumazet <eric.dumazet@gmail.com>,
	Dinakar Guniguntala <dino@in.ibm.com>,
	linux-kernel@vger.kernel.org
Subject: Re: futex_cmpxchg_enabled not set in futex_init on pentium3
Date: Mon, 30 Nov 2009 13:36:40 -0800	[thread overview]
Message-ID: <4B143AE8.5090608@us.ibm.com> (raw)
In-Reply-To: <alpine.LNX.2.00.0911291057100.2912@bruno>

Joseph Parmelee wrote:

Hi Joseph,

Adding futex folks on CC.

> Greetings all:
> 
> Sometime between 2.6.28.6 and 2.6.31.5 a regression (feature?) in the futex
> system now causes futex test failures on glibc-2.9 which where not present
> before.  That is, recompiling the binaries of glibc-2.9 and rerunning its
> test suite now produces futex errors that passed previously.  The problem
> appears now with glibc-2.9 compiled with either gcc-4.1.2 or gcc-4.4.2, and
> with glibc-2.11 compiled with gcc-4.4.2, which is what I am currently
> running on this machine, failures and all.
> 
> The system under discussion is a uniprocessor pentium3 with an AMI BIOS. 
> Full details available on request should that prove necessary.
> 
> I have tracked the test failures down to the fact that 
> futex_cmpxchg_enabled
> is not set because the test in futex_init now "fails" (actually 
> succeeds). This appears to be happening because the expected page fault 
> intentionally
> provoked by a null dereference appears to be working now in kernel mode. 
> This *may* (rank speculation) be associated with the AMI BIOS low-memory
> corruption protection added sometime during this gap, and which is 
> activated
> on this machine.

Hrm... interesting...

> 
> Before I muck any further with this, especially involving the quite tricky
> futex mess, I would appreciate some insight into the idea behind the 
> test in
> futex_init.  I don't understand why you would bother to invoke a fault in
> what is apparently a test to determine if the cmpxchg instruction works. 

I suspect this is because the test asks for a userspace address. So rather
than hack something up to use a real userspace address, we just send NULL.
EFAULT=success and ENOSYS=failure.

> The fault is supposed to occur as a result of a null dereference that takes
> place *before* the cmpxchg instruction is even executed.  If you want to
> test that cmpxchg works, why not just make a little test in futex_init that
> uses it and fails (not succeeds) if it doesn't behave as expected, or if
> there is a fault of some kind (like illegal instruction)?  Or is the fact
> that we don't get a fault the whole point here?

I believe the NULL pointer is just a convenience.


-- 
Darren Hart
IBM Linux Technology Center
Real-Time Linux Team

  reply	other threads:[~2009-11-30 21:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-29 17:46 futex_cmpxchg_enabled not set in futex_init on pentium3 Joseph Parmelee
2009-11-30 21:36 ` Darren Hart [this message]
2009-11-30 22:26   ` Thomas Gleixner
2009-12-01  4:27     ` Joseph Parmelee
2009-12-01 20:44     ` Joseph Parmelee
2009-12-01 21:39       ` Thomas Gleixner
2009-12-01 21:52         ` Joseph Parmelee
2009-12-01 22:55           ` H. Peter Anvin
2009-12-02  0:53             ` Joseph Parmelee
2009-12-02  1:40               ` H. Peter Anvin
2009-12-05 23:24         ` Joseph Parmelee
2009-12-05  0:46     ` Joseph Parmelee

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=4B143AE8.5090608@us.ibm.com \
    --to=dvhltc@us.ibm.com \
    --cc=dino@in.ibm.com \
    --cc=eric.dumazet@gmail.com \
    --cc=jparmele@wildbear.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --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