public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mathieu Desnoyers <compudj@krystal.dyndns.org>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [patch 1/2] F00F bug fixup for i386 - use immediate values
Date: Sat, 14 Jul 2007 22:54:25 -0400	[thread overview]
Message-ID: <20070715025425.GA26164@Krystal> (raw)
In-Reply-To: <20070715024931.GA25152@Krystal>

* Mathieu Desnoyers (mathieu.desnoyers@polymtl.ca) wrote:
> * Alexey Dobriyan (adobriyan@gmail.com) wrote:
> > On Fri, Jul 13, 2007 at 09:26:43PM -0400, Mathieu Desnoyers wrote:
> > > Use the faster immediate values for F00F bug handling in do_page_fault.
> > 
> > > --- linux-2.6-lttng.orig/arch/i386/mm/fault.c
> > > +++ linux-2.6-lttng/arch/i386/mm/fault.c
> > > @@ -492,7 +493,7 @@
> > >  	/*
> > >  	 * Pentium F0 0F C7 C8 bug workaround.
> > >  	 */
> > > -	if (boot_cpu_data.f00f_bug) {
> > > +	immediate_if (&f00f_bug_fix) {
> > 
> > This code is not called during normal pagefaults and even during invalid
> > userspace accesses.
> > 
> > Out of curiosity, I inserted printk() at this place to see where I was
> > wrong. I got only two hits:
> > 
> > 	Checking if this processor honours the WP bit even in supervisor mode... do_page_fault:
> > 	Freeing unused kernel memory: 116k freed
> > 	do_page_fault:
> > 
> > Resume: nobody gives a fuck about performance of this particular if,
> > 	so conversion it totally pointless.
> > 
> 
> Interesting investigation, let's push it further:
> 
> instrumenting the f00f test site with a printk, I get:
> 
> [    0.000000] Checking if this processor honours the WP bit even in
> supervisor mode... TEST: would test f00f bug at vadd ffecc000, eip c011928e
> [    0.000000] Ok.
> ... and (whenever xdm restarts) :
> [   64.768165] TEST: would test f00f bug at vadd 00000000, eip c0237596
> [   64.787136] TEST: would test f00f bug at vadd 0000004c, eip c02375a2
> 
> Those EIPs are:
> 
> 0xc011928e <do_test_wp_bit+20>: mov    %cl,0xffecd000(%edx)
> -> Will trigger fixup_exception.
> 
> 0xc0237596 <__copy_from_user_ll+53>:    rep movsl %ds:(%esi),%es:(%edi)
> 0xc02375a2 <__copy_from_user_ll+65>:    mov    0x20(%esi),%eax
> -> Those look like user-space programs that gave NULL pointers to kernel
> system calls.
> 
> I agree with you that this is not a "hot path". It was mostly a
> straightforward test conversion.
> 
> Mathieu

Actually, what is even more weird is that my system is configured to
output the segfaults, i.e. a small user-space program that does a memory
read of *(char*)NULL causes:
[ 1413.164212] null[3740]: segfault at 00000000 eip 0804836a esp
bffde2c0 error 4

But there is no message for the __copy_from_user_ll fault, so I wonder
1 - has the process been killed ?
2 - Is it just the printk that is missing ?

Mathieu

-- 
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68

  reply	other threads:[~2007-07-15  2:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-14  1:26 [patch 0/2] Immediate Values - in kernel users Mathieu Desnoyers
2007-07-14  1:26 ` [patch 1/2] F00F bug fixup for i386 - use immediate values Mathieu Desnoyers
2007-07-14  7:22   ` Alexey Dobriyan
2007-07-15  2:49     ` Mathieu Desnoyers
2007-07-15  2:54       ` Mathieu Desnoyers [this message]
2007-07-14  1:26 ` [patch 2/2] Scheduler profiling - Use " Mathieu Desnoyers

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=20070715025425.GA26164@Krystal \
    --to=compudj@krystal.dyndns.org \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.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