lkml.org 
[lkml]   [2009]   [Jun]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: LOCK prefix on uni processor has its use
Date
On Tue June 2 2009, Andi Kleen wrote:
> > After another week of chasing this - -
>
> Did you use the "compile part of the kernel with LOCK and others without"
> technique I described earlier?
>

That would only help if it where a single point failure.

Although there are some assembly language things that can
be done to help in finding what to examine, like:

#define LOCK_PREFIX "\n### Lock pre-fix removed:\n\t"

Or whatever might help your favorite text search program.

Which yields asm expansion in your *.s file (gcc -S) as:

#APP
# 33 "test_bytelock.c" 1

1: xchgb %ah, %al
test %al,%al
jz 3f

### Lock pre-fix removed:
incb splock+1
2: xchgw %ax, %ax
cmpb $1, splock
je 2b

### Lock pre-fix removed:
decb splock+1
jmp 1b
3:
# 0 "" 2
#NO_APP

Note: For the readers not familar with (g)as;
#APP -> Assembler Pre-Process (gcc generated)
<ragged whitespace and comments allowed>
#NO_APP -> No Assembler Pre-Process (gcc generated)

If ambitious, you can add a comment to each asm-macro
to note the line and source filename of where it is
defined. (the line number and name gcc put there is
where it was expanded, not where it was defined).

Not really too ambitious - there are only 140 files
of interest (with asm-macros) in a x86, uni-processor build.

Mike

> -Andi




\
 
 \ /
  Last update: 2009-06-03 13:49    [W:0.086 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site