Re: [PATCH] x86: Clean up stack access code in irq_32.c

2014-10-12 Thread Chuck Ebbert
On Sun, 12 Oct 2014 10:13:33 -0700 "H. Peter Anvin" wrote: > That's not a justification for change. Claiming no harm is nevessary but not > sufficient. > The optimization is also a little better with GCC when using C instead of asm for current_stack_pointer. Probably not enough better to do d

Re: [PATCH] x86: Clean up stack access code in irq_32.c

2014-10-12 Thread Chuck Ebbert
On Sun, 12 Oct 2014 12:00:03 -0500 Jeff Epler wrote: > It looks like the proposed variant still miscompiles in clang 3.4 and 3.5, the > two versions I had handy to test. > > I extracted your code to a simple standalone C translation unit and > inspected various compilers' results via objdump. >

Re: [PATCH] x86: Clean up stack access code in irq_32.c

2014-10-12 Thread Jeff Epler
It looks like the proposed variant still miscompiles in clang 3.4 and 3.5, the two versions I had handy to test. I extracted your code to a simple standalone C translation unit and inspected various compilers' results via objdump. // cut here for cso.c struct thread_info { long l[32]; }; // who k

Re: [PATCH] x86: Clean up stack access code in irq_32.c

2014-10-12 Thread H. Peter Anvin
That's not a justification for change. Claiming no harm is nevessary but not sufficient. On October 12, 2014 9:53:32 AM PDT, Chuck Ebbert wrote: >On Sun, 12 Oct 2014 09:47:53 -0700 >"H. Peter Anvin" wrote: > >[replying to the list this time, sigh] > >> We changed this to asm because the C brok

Re: [PATCH] x86: Clean up stack access code in irq_32.c

2014-10-12 Thread Chuck Ebbert
On Sun, 12 Oct 2014 09:47:53 -0700 "H. Peter Anvin" wrote: [replying to the list this time, sigh] > We changed this to asm because the C broke some compilers. Why are you > changing it back? > The C broke some compilers because it was using a global register variable. This is a local one, wh

Re: [PATCH] x86: Clean up stack access code in irq_32.c

2014-10-12 Thread H. Peter Anvin
We changed this to asm because the C broke some compilers. Why are you changing it back? On October 12, 2014 9:43:53 AM PDT, Chuck Ebbert wrote: >Use C instead of asm for accessing the stack pointer. And define some >macros to make the code easier to understand. > >Signed-off-by: Chuck Ebbert

[PATCH] x86: Clean up stack access code in irq_32.c

2014-10-12 Thread Chuck Ebbert
Use C instead of asm for accessing the stack pointer. And define some macros to make the code easier to understand. Signed-off-by: Chuck Ebbert diff --git a/arch/x86/include/asm/page_32_types.h b/arch/x86/include/asm/page_32_types.h index f48b17d..a8ca0cb 100644 --- a/arch/x86/include/asm/page_