Re: [PATCH] checkpatch: add __asm__ to function-space-paren exception list

2008-02-04 Thread Timur Tabi
Andy Whitcroft wrote: It truly is not clear what "type" of thing an __asm__ is these days. Cirtainly it seems we can use it as an attribute of a type: register unsigned long __r16 __asm__("$16") = rtc_access->function; and yet also in its more traditional

Re: [PATCH] checkpatch: add __asm__ to function-space-paren exception list

2008-02-04 Thread Andy Whitcroft
On Tue, Jan 29, 2008 at 05:17:28PM -0600, Timur Tabi wrote: > checkpatch.pl thinks that __asm__ is a function name, so it complains about > a space between the function name and a parenthesis when it sees > "__asm__ ("mov ax,bx")". > > This change will also e

Re: [PATCH] checkpatch: add __asm__ to function-space-paren exception list

2008-02-04 Thread Andy Whitcroft
On Tue, Jan 29, 2008 at 05:17:28PM -0600, Timur Tabi wrote: checkpatch.pl thinks that __asm__ is a function name, so it complains about a space between the function name and a parenthesis when it sees __asm__ (mov ax,bx). This change will also encourage developers to use '__asm__' instead

Re: [PATCH] checkpatch: add __asm__ to function-space-paren exception list

2008-02-04 Thread Timur Tabi
Andy Whitcroft wrote: It truly is not clear what type of thing an __asm__ is these days. Cirtainly it seems we can use it as an attribute of a type: register unsigned long __r16 __asm__($16) = rtc_access-function; and yet also in its more traditional form: __asm__( call foo

[PATCH] checkpatch: add __asm__ to function-space-paren exception list

2008-01-29 Thread Timur Tabi
checkpatch.pl thinks that __asm__ is a function name, so it complains about a space between the function name and a parenthesis when it sees "__asm__ ("mov ax,bx")". This change will also encourage developers to use '__asm__' instead of 'asm'. Signed-off-by: Timur Ta

[PATCH] checkpatch: add __asm__ to function-space-paren exception list

2008-01-29 Thread Timur Tabi
checkpatch.pl thinks that __asm__ is a function name, so it complains about a space between the function name and a parenthesis when it sees __asm__ (mov ax,bx). This change will also encourage developers to use '__asm__' instead of 'asm'. Signed-off-by: Timur Tabi [EMAIL PROTECTED] --- scripts

Re: [PATCH 7/8] i386: bitops: Kill needless usage of __asm__ __volatile__

2007-07-23 Thread Nicholas Miell
On Mon, 2007-07-23 at 23:30 +0200, Andi Kleen wrote: > > gcc also tries to count the number of instructions, to guess how large in > > bytes the asm block is, as it could make a difference for near vs short > > jumps, etc. > > Are you sure? I doubt it. It would need a full asm parser to do this >

Re: [PATCH 7/8] i386: bitops: Kill needless usage of __asm__ __volatile__

2007-07-23 Thread Andi Kleen
> gcc also tries to count the number of instructions, to guess how large in > bytes the asm block is, as it could make a difference for near vs short > jumps, etc. Are you sure? I doubt it. It would need a full asm parser to do this properly and then even it could be wrong (e.g. when the

Re: [PATCH 7/8] i386: bitops: Kill needless usage of __asm__ __volatile__

2007-07-23 Thread Trent Piepho
On Mon, 23 Jul 2007, Jeremy Fitzhardinge wrote: > Trent Piepho wrote: > > gcc also tries to count the number of instructions, to guess how large in > > bytes the asm block is, as it could make a difference for near vs short > > jumps, etc. > > > > How does it do that? By looking for \n, ';', etc?

Re: [PATCH 7/8] i386: bitops: Kill needless usage of __asm__ __volatile__

2007-07-23 Thread Jeremy Fitzhardinge
Trent Piepho wrote: > gcc also tries to count the number of instructions, to guess how large in > bytes the asm block is, as it could make a difference for near vs short > jumps, etc. > How does it do that? By looking for \n, ';', etc? J - To unsubscribe from this list: send the line

Re: [PATCH 7/8] i386: bitops: Kill needless usage of __asm__ __volatile__

2007-07-23 Thread Trent Piepho
On Mon, 23 Jul 2007, Jeremy Fitzhardinge wrote: > Satyam Sharma wrote: > > The (3) as I had originally written / meant was that multiple > > instructions in a volatile asm would not get _individually_ > > interspersed with the rest of the code i.e. be emitted out > > _consecutively_. I don't think

Re: [PATCH 7/8] i386: bitops: Kill needless usage of __asm__ __volatile__

2007-07-23 Thread Jeremy Fitzhardinge
Satyam Sharma wrote: > The (3) as I had originally written / meant was that multiple > instructions in a volatile asm would not get _individually_ > interspersed with the rest of the code i.e. be emitted out > _consecutively_. I don't think we need any such guarantees for > the non-atomic variants

Re: [PATCH 7/8] i386: bitops: Kill needless usage of __asm__ __volatile__

2007-07-23 Thread Satyam Sharma
On Mon, 23 Jul 2007, Jeremy Fitzhardinge wrote: > I'm not quite sure what your point is. Could be a case of terminology confusion ... > The paragraph you quoted is > pretty explicit in saying that volatile doesn't prevent an "asm > volatile" from being interspersed with other code, and the

Re: [PATCH 7/8] i386: bitops: Kill needless usage of __asm__ __volatile__

2007-07-23 Thread Jeremy Fitzhardinge
Satyam Sharma wrote: > Hi Jeremy, > > > On Mon, 23 Jul 2007, Jeremy Fitzhardinge wrote: > > >> Satyam Sharma wrote: >> >>> From: Satyam Sharma <[EMAIL PROTECTED]> >>> >>> [7/8] i386: bitops: Kill needless usage of __a

Re: [PATCH 7/8] i386: bitops: Kill needless usage of __asm__ __volatile__

2007-07-23 Thread Satyam Sharma
Hi Jeremy, On Mon, 23 Jul 2007, Jeremy Fitzhardinge wrote: > Satyam Sharma wrote: > > From: Satyam Sharma <[EMAIL PROTECTED]> > > > > [7/8] i386: bitops: Kill needless usage of __asm__ __volatile__ > > > > Another oddity I noticed in this file. The

Re: [PATCH 7/8] i386: bitops: Kill needless usage of __asm__ __volatile__

2007-07-23 Thread Satyam Sharma
Hi, On Mon, 23 Jul 2007, Andi Kleen wrote: > On Monday 23 July 2007 18:06:03 Satyam Sharma wrote: > > From: Satyam Sharma <[EMAIL PROTECTED]> > > > > [7/8] i386: bitops: Kill needless usage of __asm__ __volatile__ > > > > Another oddity I noticed in t

Re: [PATCH 7/8] i386: bitops: Kill needless usage of __asm__ __volatile__

2007-07-23 Thread Jeremy Fitzhardinge
Satyam Sharma wrote: > From: Satyam Sharma <[EMAIL PROTECTED]> > > [7/8] i386: bitops: Kill needless usage of __asm__ __volatile__ > > Another oddity I noticed in this file. The semantics of __volatile__ > when used to qualify inline __asm__ are that the compiler wil

Re: [PATCH 7/8] i386: bitops: Kill needless usage of __asm__ __volatile__ II

2007-07-23 Thread Andi Kleen
BTW if you want to optimize inline asm code a bit -- find_first_bit / find_first_zero_bit / for_each_cpu could really benefit from a optimized version for cpumask_t sized bitmaps. That would save a lot of cycles in some of the hotter paths of the kernel like the scheduler. -Andi - To

Re: [PATCH 7/8] i386: bitops: Kill needless usage of __asm__ __volatile__

2007-07-23 Thread Andi Kleen
On Monday 23 July 2007 18:06:03 Satyam Sharma wrote: > From: Satyam Sharma <[EMAIL PROTECTED]> > > [7/8] i386: bitops: Kill needless usage of __asm__ __volatile__ > > Another oddity I noticed in this file. The semantics of __volatile__ > when used to qualify inline __asm

[PATCH 7/8] i386: bitops: Kill needless usage of __asm__ __volatile__

2007-07-23 Thread Satyam Sharma
From: Satyam Sharma <[EMAIL PROTECTED]> [7/8] i386: bitops: Kill needless usage of __asm__ __volatile__ Another oddity I noticed in this file. The semantics of __volatile__ when used to qualify inline __asm__ are that the compiler will not (1) elid, or, (2) reorder, or, (3) interspers

[PATCH 7/8] i386: bitops: Kill needless usage of __asm__ __volatile__

2007-07-23 Thread Satyam Sharma
From: Satyam Sharma [EMAIL PROTECTED] [7/8] i386: bitops: Kill needless usage of __asm__ __volatile__ Another oddity I noticed in this file. The semantics of __volatile__ when used to qualify inline __asm__ are that the compiler will not (1) elid, or, (2) reorder, or, (3) intersperse, our inline

Re: [PATCH 7/8] i386: bitops: Kill needless usage of __asm__ __volatile__

2007-07-23 Thread Andi Kleen
On Monday 23 July 2007 18:06:03 Satyam Sharma wrote: From: Satyam Sharma [EMAIL PROTECTED] [7/8] i386: bitops: Kill needless usage of __asm__ __volatile__ Another oddity I noticed in this file. The semantics of __volatile__ when used to qualify inline __asm__ are that the compiler

Re: [PATCH 7/8] i386: bitops: Kill needless usage of __asm__ __volatile__ II

2007-07-23 Thread Andi Kleen
BTW if you want to optimize inline asm code a bit -- find_first_bit / find_first_zero_bit / for_each_cpu could really benefit from a optimized version for cpumask_t sized bitmaps. That would save a lot of cycles in some of the hotter paths of the kernel like the scheduler. -Andi - To

Re: [PATCH 7/8] i386: bitops: Kill needless usage of __asm__ __volatile__

2007-07-23 Thread Jeremy Fitzhardinge
Satyam Sharma wrote: From: Satyam Sharma [EMAIL PROTECTED] [7/8] i386: bitops: Kill needless usage of __asm__ __volatile__ Another oddity I noticed in this file. The semantics of __volatile__ when used to qualify inline __asm__ are that the compiler will not (1) elid, or, (2) reorder

Re: [PATCH 7/8] i386: bitops: Kill needless usage of __asm__ __volatile__

2007-07-23 Thread Satyam Sharma
Hi, On Mon, 23 Jul 2007, Andi Kleen wrote: On Monday 23 July 2007 18:06:03 Satyam Sharma wrote: From: Satyam Sharma [EMAIL PROTECTED] [7/8] i386: bitops: Kill needless usage of __asm__ __volatile__ Another oddity I noticed in this file. The semantics of __volatile__ when used

Re: [PATCH 7/8] i386: bitops: Kill needless usage of __asm__ __volatile__

2007-07-23 Thread Satyam Sharma
Hi Jeremy, On Mon, 23 Jul 2007, Jeremy Fitzhardinge wrote: Satyam Sharma wrote: From: Satyam Sharma [EMAIL PROTECTED] [7/8] i386: bitops: Kill needless usage of __asm__ __volatile__ Another oddity I noticed in this file. The semantics of __volatile__ when used to qualify inline

Re: [PATCH 7/8] i386: bitops: Kill needless usage of __asm__ __volatile__

2007-07-23 Thread Jeremy Fitzhardinge
Satyam Sharma wrote: Hi Jeremy, On Mon, 23 Jul 2007, Jeremy Fitzhardinge wrote: Satyam Sharma wrote: From: Satyam Sharma [EMAIL PROTECTED] [7/8] i386: bitops: Kill needless usage of __asm__ __volatile__ Another oddity I noticed in this file. The semantics of __volatile__ when

Re: [PATCH 7/8] i386: bitops: Kill needless usage of __asm__ __volatile__

2007-07-23 Thread Satyam Sharma
On Mon, 23 Jul 2007, Jeremy Fitzhardinge wrote: I'm not quite sure what your point is. Could be a case of terminology confusion ... The paragraph you quoted is pretty explicit in saying that volatile doesn't prevent an asm volatile from being interspersed with other code, and the example

Re: [PATCH 7/8] i386: bitops: Kill needless usage of __asm__ __volatile__

2007-07-23 Thread Jeremy Fitzhardinge
Satyam Sharma wrote: The (3) as I had originally written / meant was that multiple instructions in a volatile asm would not get _individually_ interspersed with the rest of the code i.e. be emitted out _consecutively_. I don't think we need any such guarantees for the non-atomic variants of

Re: [PATCH 7/8] i386: bitops: Kill needless usage of __asm__ __volatile__

2007-07-23 Thread Trent Piepho
On Mon, 23 Jul 2007, Jeremy Fitzhardinge wrote: Satyam Sharma wrote: The (3) as I had originally written / meant was that multiple instructions in a volatile asm would not get _individually_ interspersed with the rest of the code i.e. be emitted out _consecutively_. I don't think we need

Re: [PATCH 7/8] i386: bitops: Kill needless usage of __asm__ __volatile__

2007-07-23 Thread Jeremy Fitzhardinge
Trent Piepho wrote: gcc also tries to count the number of instructions, to guess how large in bytes the asm block is, as it could make a difference for near vs short jumps, etc. How does it do that? By looking for \n, ';', etc? J - To unsubscribe from this list: send the line

Re: [PATCH 7/8] i386: bitops: Kill needless usage of __asm__ __volatile__

2007-07-23 Thread Trent Piepho
On Mon, 23 Jul 2007, Jeremy Fitzhardinge wrote: Trent Piepho wrote: gcc also tries to count the number of instructions, to guess how large in bytes the asm block is, as it could make a difference for near vs short jumps, etc. How does it do that? By looking for \n, ';', etc? Yes:

Re: [PATCH 7/8] i386: bitops: Kill needless usage of __asm__ __volatile__

2007-07-23 Thread Andi Kleen
gcc also tries to count the number of instructions, to guess how large in bytes the asm block is, as it could make a difference for near vs short jumps, etc. Are you sure? I doubt it. It would need a full asm parser to do this properly and then even it could be wrong (e.g. when the sections

Re: [PATCH 7/8] i386: bitops: Kill needless usage of __asm__ __volatile__

2007-07-23 Thread Nicholas Miell
On Mon, 2007-07-23 at 23:30 +0200, Andi Kleen wrote: gcc also tries to count the number of instructions, to guess how large in bytes the asm block is, as it could make a difference for near vs short jumps, etc. Are you sure? I doubt it. It would need a full asm parser to do this properly

Re: [patch] use __asm__ and __volatile__ in asm-x86_64/msr.h

2007-07-22 Thread H. Peter Anvin
Mike Frysinger wrote: > On Wednesday 20 June 2007, H. Peter Anvin wrote: >> Andi Kleen wrote: asm-i386/msr.h should not be exported to userspace at all, it contains nothing but kernel-internal helpers. >>> Actually rdtsc and rdtscll and potentially rdpmc which is in there can be >>> very

Re: [patch] use __asm__ and __volatile__ in asm-x86_64/msr.h

2007-07-22 Thread Mike Frysinger
On Wednesday 20 June 2007, H. Peter Anvin wrote: > Andi Kleen wrote: > >> asm-i386/msr.h should not be exported to userspace at all, it contains > >> nothing but kernel-internal helpers. > > > > Actually rdtsc and rdtscll and potentially rdpmc which is in there can be > > very useful in user space

Re: [patch] use __asm__ and __volatile__ in asm-x86_64/msr.h

2007-07-22 Thread Mike Frysinger
On Wednesday 20 June 2007, H. Peter Anvin wrote: Andi Kleen wrote: asm-i386/msr.h should not be exported to userspace at all, it contains nothing but kernel-internal helpers. Actually rdtsc and rdtscll and potentially rdpmc which is in there can be very useful in user space if you know

Re: [patch] use __asm__ and __volatile__ in asm-x86_64/msr.h

2007-07-22 Thread H. Peter Anvin
Mike Frysinger wrote: On Wednesday 20 June 2007, H. Peter Anvin wrote: Andi Kleen wrote: asm-i386/msr.h should not be exported to userspace at all, it contains nothing but kernel-internal helpers. Actually rdtsc and rdtscll and potentially rdpmc which is in there can be very useful in user

Re: [patch] use __asm__ and __volatile__ in asm-x86_64/msr.h

2007-06-20 Thread H. Peter Anvin
Andi Kleen wrote: >> asm-i386/msr.h should not be exported to userspace at all, it contains >> nothing but kernel-internal helpers. > > Actually rdtsc and rdtscll and potentially rdpmc which is in there can be > very > useful in user space if you know what you're doing. Unfortunately a lot of

Re: [patch] use __asm__ and __volatile__ in asm-x86_64/msr.h

2007-06-20 Thread H. Peter Anvin
Andi Kleen wrote: asm-i386/msr.h should not be exported to userspace at all, it contains nothing but kernel-internal helpers. Actually rdtsc and rdtscll and potentially rdpmc which is in there can be very useful in user space if you know what you're doing. Unfortunately a lot of its

Re: [patch] use __asm__ and __volatile__ in i386/arm/s390 byteorder.h

2007-06-18 Thread Christoph Hellwig
On Mon, Jun 18, 2007 at 09:00:09PM +0200, Sam Ravnborg wrote: > Do you imply that if we see asm or __asm__ in user space headers we ougth > to warn about it? > Seems at least sensible to me but if we introduce such a check we should > kill all offenders first - which Mike's p

Re: [patch] use __asm__ and __volatile__ in i386/arm/s390 byteorder.h

2007-06-18 Thread Sam Ravnborg
On Mon, Jun 18, 2007 at 07:34:50PM +0100, Christoph Hellwig wrote: > On Sun, Jun 17, 2007 at 06:33:28PM -0400, Mike Frysinger wrote: > > This changes asm() to __asm__() and volatile to __volatile__ so that these > > headers can be used with gcc's -std=c99. > > We should not

Re: [patch] use __asm__ and __volatile__ in asm-x86_64/msr.h

2007-06-18 Thread Andi Kleen
> asm-i386/msr.h should not be exported to userspace at all, it contains > nothing but kernel-internal helpers. Actually rdtsc and rdtscll and potentially rdpmc which is in there can be very useful in user space if you know what you're doing. Unfortunately a lot of its users don't, but not

Re: [patch] use __asm__ and __volatile__ in i386/arm/s390 byteorder.h

2007-06-18 Thread Christoph Hellwig
On Mon, Jun 18, 2007 at 07:34:50PM +0100, Christoph Hellwig wrote: > On Sun, Jun 17, 2007 at 06:33:28PM -0400, Mike Frysinger wrote: > > This changes asm() to __asm__() and volatile to __volatile__ so that these > > headers can be used with gcc's -std=c99. > > We should not

Re: [patch] use __asm__ and __volatile__ in asm-ia64/gcc_intrin.h

2007-06-18 Thread Christoph Hellwig
On Mon, Jun 18, 2007 at 02:19:10AM -0400, Mike Frysinger wrote: > Since asm-ia64/gcc_intrin.h gets exported to userspace, we need to make sure > to use __asm__() rather than asm() since the latter is not available when > compiling with gcc with GNU extensions turned off (like

Re: [patch] use __asm__ and __volatile__ in asm-x86_64/msr.h

2007-06-18 Thread Christoph Hellwig
On Mon, Jun 18, 2007 at 10:02:21AM -0400, Mike Frysinger wrote: > > This is wrong for two reasons: > > > > - MSRs are not accessible in user space. > > - .section .fixup is not applicable to user space. > > > > Anything MSR-related should be protected by __KERNEL__ instead. > > > > This NAK

Re: [patch] use __asm__ and __volatile__ in i386/arm/s390 byteorder.h

2007-06-18 Thread Christoph Hellwig
On Sun, Jun 17, 2007 at 06:33:28PM -0400, Mike Frysinger wrote: > This changes asm() to __asm__() and volatile to __volatile__ so that these > headers can be used with gcc's -std=c99. We should not allow inline assemly in the exported part of userspace headers at all. These headers mus

Re: [patch] use __asm__ and __volatile__ in i386/arm/s390 byteorder.h

2007-06-18 Thread Mike Frysinger
On Monday 18 June 2007, Christoph Hellwig wrote: > On Mon, Jun 18, 2007 at 01:24:24AM +0200, Arnd Bergmann wrote: > > On Monday 18 June 2007, Arjan van de Ven wrote: > > > On Sun, 2007-06-17 at 18:33 -0400, Mike Frysinger wrote: > > > > This changes asm() to __asm__(

Re: [patch] use __asm__ and __volatile__ in i386/arm/s390 byteorder.h

2007-06-18 Thread Christoph Hellwig
On Mon, Jun 18, 2007 at 08:27:15AM -0600, Robert Hancock wrote: > If we expect userspace apps to include them, then I would vote for no, > not for anything outside of #ifdef __KERNEL__ in exported headers. Keep > in mind also that C++ apps may need to include these as well and those >

Re: [patch] use __asm__ and __volatile__ in i386/arm/s390 byteorder.h

2007-06-18 Thread Christoph Hellwig
On Mon, Jun 18, 2007 at 01:24:24AM +0200, Arnd Bergmann wrote: > On Monday 18 June 2007, Arjan van de Ven wrote: > > > > On Sun, 2007-06-17 at 18:33 -0400, Mike Frysinger wrote: > > > This changes asm() to __asm__() and volatile to __volatile__ so that these > > &g

Re: [patch] use __asm__ and __volatile__ in i386/arm/s390 byteorder.h

2007-06-18 Thread H. Peter Anvin
Robert Hancock wrote: > > If we expect userspace apps to include them, then I would vote for no, > not for anything outside of #ifdef __KERNEL__ in exported headers. Keep > in mind also that C++ apps may need to include these as well and those > extensions don't always play well in C++ mode.

Re: [patch] use __asm__ and __volatile__ in i386/arm/s390 byteorder.h

2007-06-18 Thread Robert Hancock
David Woodhouse wrote: On Mon, 2007-06-18 at 01:24 +0200, Arnd Bergmann wrote: On Monday 18 June 2007, Arjan van de Ven wrote: On Sun, 2007-06-17 at 18:33 -0400, Mike Frysinger wrote: This changes asm() to __asm__() and volatile to __volatile__ so that these headers can be used with gcc's

Re: [patch] use __asm__ and __volatile__ in asm-x86_64/msr.h

2007-06-18 Thread Mike Frysinger
On Monday 18 June 2007, H. Peter Anvin wrote: > Mike Frysinger wrote: > > Most of the macros in msr.h already use __asm__ and __volatile__, this > > patch brings the rest into line. This is needed since these get exported > > into userspace (need to use strict __asm__ vs

Re: [patch] use __asm__ and __volatile__ in i386/arm/s390 byteorder.h

2007-06-18 Thread David Woodhouse
On Mon, 2007-06-18 at 01:24 +0200, Arnd Bergmann wrote: > On Monday 18 June 2007, Arjan van de Ven wrote: > > > > On Sun, 2007-06-17 at 18:33 -0400, Mike Frysinger wrote: > > > This changes asm() to __asm__() and volatile to __volatile__ so that these > > > header

Re: [patch] use __asm__ rather than asm in asm-s390/ptrace.h

2007-06-18 Thread Heiko Carstens
On Mon, Jun 18, 2007 at 10:15:18AM +0200, Martin Schwidefsky wrote: > On Mon, 2007-06-18 at 09:36 +0200, Heiko Carstens wrote: > > Hmm.. spka is a sort of priviledged instruction and shouldn't be > > user space visible. > > I will move it so it's under #ifdef __KERNEL__. > > Yes, I think this is

Re: [patch] use __asm__ rather than asm in asm-s390/ptrace.h

2007-06-18 Thread Martin Schwidefsky
On Mon, 2007-06-18 at 09:36 +0200, Heiko Carstens wrote: > Hmm.. spka is a sort of priviledged instruction and shouldn't be > user space visible. > I will move it so it's under #ifdef __KERNEL__. Yes, I think this is better. On a side node, why did we add psw_set_key to ptrace.h? processor.h

Re: [patch] make hdrscheck.sh force __asm__ in exported headers

2007-06-18 Thread Mike Frysinger
On Monday 18 June 2007, Sam Ravnborg wrote: > On Sun, Jun 17, 2007 at 06:54:24PM -0400, Mike Frysinger wrote: > > This updates scripts/hdrschecks.sh by grepping for asm() constructs and > > rejecting them in favor of __asm__() in exported headers. > > I have a new version

Re: [patch] make hdrscheck.sh force __asm__ in exported headers

2007-06-18 Thread Sam Ravnborg
On Sun, Jun 17, 2007 at 06:54:24PM -0400, Mike Frysinger wrote: > This updates scripts/hdrschecks.sh by grepping for asm() constructs and > rejecting them in favor of __asm__() in exported headers. Hi Mike. I have a new version of hdrcheck in works written in perl and a bit faster too.

Re: [patch] use __asm__ and __volatile__ in asm-x86_64/msr.h

2007-06-18 Thread H. Peter Anvin
Mike Frysinger wrote: > Most of the macros in msr.h already use __asm__ and __volatile__, this patch > brings the rest into line. This is needed since these get exported into > userspace (need to use strict __asm__ vs asm when gcc compiles with GNU > extensions turned off). > -

Re: [patch] use __asm__ rather than asm in asm-s390/ptrace.h

2007-06-18 Thread Heiko Carstens
On Mon, Jun 18, 2007 at 02:23:06AM -0400, Mike Frysinger wrote: > Since asm-s390/ptrace.h is exported to userspace, we need to make sure we use > __asm__() rather than asm() as the latter is disabled when gcc compiles with > GNU extensions turned off (like -std=c99). > > Sign

Re: [patch] make hdrscheck.sh force __asm__ in exported headers

2007-06-18 Thread Mike Frysinger
On 6/18/07, Andrew Morton <[EMAIL PROTECTED]> wrote: On Mon, 18 Jun 2007 01:17:46 -0400 Mike Frysinger <[EMAIL PROTECTED]> wrote: > On Monday 18 June 2007, Andrew Morton wrote: > > And does the kernel pass these checks? > > nope ... should i audit the arches before this gets merged ? Yes

[patch] use __asm__ rather than asm in asm-s390/ptrace.h

2007-06-18 Thread Mike Frysinger
Since asm-s390/ptrace.h is exported to userspace, we need to make sure we use __asm__() rather than asm() as the latter is disabled when gcc compiles with GNU extensions turned off (like -std=c99). Signed-off-by: Mike Frysinger <[EMAIL PROTECTED]> --- diff --git a/include/asm-s390/ptra

[patch] use __asm__ and __volatile__ in asm-ia64/gcc_intrin.h

2007-06-18 Thread Mike Frysinger
Since asm-ia64/gcc_intrin.h gets exported to userspace, we need to make sure to use __asm__() rather than asm() since the latter is not available when compiling with gcc with GNU extensions turned off (like -std=c99). Signed-off-by: Mike Frysinger <[EMAIL PROTECTED]> --- diff --git a/inclu

[patch] use __asm__ and __volatile__ in asm-x86_64/msr.h

2007-06-18 Thread Mike Frysinger
Most of the macros in msr.h already use __asm__ and __volatile__, this patch brings the rest into line. This is needed since these get exported into userspace (need to use strict __asm__ vs asm when gcc compiles with GNU extensions turned off). Signed-off-by: Mike Frysinger <[EMAIL PROTEC

[patch] use __asm__ and __volatile__ in asm-x86_64/msr.h

2007-06-18 Thread Mike Frysinger
Most of the macros in msr.h already use __asm__ and __volatile__, this patch brings the rest into line. This is needed since these get exported into userspace (need to use strict __asm__ vs asm when gcc compiles with GNU extensions turned off). Signed-off-by: Mike Frysinger [EMAIL PROTECTED

[patch] use __asm__ and __volatile__ in asm-ia64/gcc_intrin.h

2007-06-18 Thread Mike Frysinger
Since asm-ia64/gcc_intrin.h gets exported to userspace, we need to make sure to use __asm__() rather than asm() since the latter is not available when compiling with gcc with GNU extensions turned off (like -std=c99). Signed-off-by: Mike Frysinger [EMAIL PROTECTED] --- diff --git a/include/asm

[patch] use __asm__ rather than asm in asm-s390/ptrace.h

2007-06-18 Thread Mike Frysinger
Since asm-s390/ptrace.h is exported to userspace, we need to make sure we use __asm__() rather than asm() as the latter is disabled when gcc compiles with GNU extensions turned off (like -std=c99). Signed-off-by: Mike Frysinger [EMAIL PROTECTED] --- diff --git a/include/asm-s390/ptrace.h b

Re: [patch] make hdrscheck.sh force __asm__ in exported headers

2007-06-18 Thread Mike Frysinger
On 6/18/07, Andrew Morton [EMAIL PROTECTED] wrote: On Mon, 18 Jun 2007 01:17:46 -0400 Mike Frysinger [EMAIL PROTECTED] wrote: On Monday 18 June 2007, Andrew Morton wrote: And does the kernel pass these checks? nope ... should i audit the arches before this gets merged ? Yes please. I'd

Re: [patch] use __asm__ and __volatile__ in asm-x86_64/msr.h

2007-06-18 Thread H. Peter Anvin
Mike Frysinger wrote: Most of the macros in msr.h already use __asm__ and __volatile__, this patch brings the rest into line. This is needed since these get exported into userspace (need to use strict __asm__ vs asm when gcc compiles with GNU extensions turned off). --- diff --git a/include

Re: [patch] use __asm__ rather than asm in asm-s390/ptrace.h

2007-06-18 Thread Heiko Carstens
On Mon, Jun 18, 2007 at 02:23:06AM -0400, Mike Frysinger wrote: Since asm-s390/ptrace.h is exported to userspace, we need to make sure we use __asm__() rather than asm() as the latter is disabled when gcc compiles with GNU extensions turned off (like -std=c99). Signed-off-by: Mike Frysinger

Re: [patch] make hdrscheck.sh force __asm__ in exported headers

2007-06-18 Thread Sam Ravnborg
On Sun, Jun 17, 2007 at 06:54:24PM -0400, Mike Frysinger wrote: This updates scripts/hdrschecks.sh by grepping for asm() constructs and rejecting them in favor of __asm__() in exported headers. Hi Mike. I have a new version of hdrcheck in works written in perl and a bit faster too. I hope

Re: [patch] make hdrscheck.sh force __asm__ in exported headers

2007-06-18 Thread Mike Frysinger
On Monday 18 June 2007, Sam Ravnborg wrote: On Sun, Jun 17, 2007 at 06:54:24PM -0400, Mike Frysinger wrote: This updates scripts/hdrschecks.sh by grepping for asm() constructs and rejecting them in favor of __asm__() in exported headers. I have a new version of hdrcheck in works written

Re: [patch] use __asm__ rather than asm in asm-s390/ptrace.h

2007-06-18 Thread Martin Schwidefsky
On Mon, 2007-06-18 at 09:36 +0200, Heiko Carstens wrote: Hmm.. spka is a sort of priviledged instruction and shouldn't be user space visible. I will move it so it's under #ifdef __KERNEL__. Yes, I think this is better. On a side node, why did we add psw_set_key to ptrace.h? processor.h would

Re: [patch] use __asm__ rather than asm in asm-s390/ptrace.h

2007-06-18 Thread Heiko Carstens
On Mon, Jun 18, 2007 at 10:15:18AM +0200, Martin Schwidefsky wrote: On Mon, 2007-06-18 at 09:36 +0200, Heiko Carstens wrote: Hmm.. spka is a sort of priviledged instruction and shouldn't be user space visible. I will move it so it's under #ifdef __KERNEL__. Yes, I think this is better.

Re: [patch] use __asm__ and __volatile__ in i386/arm/s390 byteorder.h

2007-06-18 Thread David Woodhouse
On Mon, 2007-06-18 at 01:24 +0200, Arnd Bergmann wrote: On Monday 18 June 2007, Arjan van de Ven wrote: On Sun, 2007-06-17 at 18:33 -0400, Mike Frysinger wrote: This changes asm() to __asm__() and volatile to __volatile__ so that these headers can be used with gcc's -std=c99. hmm

Re: [patch] use __asm__ and __volatile__ in asm-x86_64/msr.h

2007-06-18 Thread Mike Frysinger
On Monday 18 June 2007, H. Peter Anvin wrote: Mike Frysinger wrote: Most of the macros in msr.h already use __asm__ and __volatile__, this patch brings the rest into line. This is needed since these get exported into userspace (need to use strict __asm__ vs asm when gcc compiles with GNU

Re: [patch] use __asm__ and __volatile__ in i386/arm/s390 byteorder.h

2007-06-18 Thread Robert Hancock
David Woodhouse wrote: On Mon, 2007-06-18 at 01:24 +0200, Arnd Bergmann wrote: On Monday 18 June 2007, Arjan van de Ven wrote: On Sun, 2007-06-17 at 18:33 -0400, Mike Frysinger wrote: This changes asm() to __asm__() and volatile to __volatile__ so that these headers can be used with gcc's

Re: [patch] use __asm__ and __volatile__ in i386/arm/s390 byteorder.h

2007-06-18 Thread H. Peter Anvin
Robert Hancock wrote: If we expect userspace apps to include them, then I would vote for no, not for anything outside of #ifdef __KERNEL__ in exported headers. Keep in mind also that C++ apps may need to include these as well and those extensions don't always play well in C++ mode. (Last

Re: [patch] use __asm__ and __volatile__ in i386/arm/s390 byteorder.h

2007-06-18 Thread Christoph Hellwig
On Mon, Jun 18, 2007 at 01:24:24AM +0200, Arnd Bergmann wrote: On Monday 18 June 2007, Arjan van de Ven wrote: On Sun, 2007-06-17 at 18:33 -0400, Mike Frysinger wrote: This changes asm() to __asm__() and volatile to __volatile__ so that these headers can be used with gcc's -std=c99

Re: [patch] use __asm__ and __volatile__ in i386/arm/s390 byteorder.h

2007-06-18 Thread Christoph Hellwig
On Mon, Jun 18, 2007 at 08:27:15AM -0600, Robert Hancock wrote: If we expect userspace apps to include them, then I would vote for no, not for anything outside of #ifdef __KERNEL__ in exported headers. Keep in mind also that C++ apps may need to include these as well and those extensions

Re: [patch] use __asm__ and __volatile__ in i386/arm/s390 byteorder.h

2007-06-18 Thread Mike Frysinger
On Monday 18 June 2007, Christoph Hellwig wrote: On Mon, Jun 18, 2007 at 01:24:24AM +0200, Arnd Bergmann wrote: On Monday 18 June 2007, Arjan van de Ven wrote: On Sun, 2007-06-17 at 18:33 -0400, Mike Frysinger wrote: This changes asm() to __asm__() and volatile to __volatile__ so

Re: [patch] use __asm__ and __volatile__ in i386/arm/s390 byteorder.h

2007-06-18 Thread Christoph Hellwig
On Sun, Jun 17, 2007 at 06:33:28PM -0400, Mike Frysinger wrote: This changes asm() to __asm__() and volatile to __volatile__ so that these headers can be used with gcc's -std=c99. We should not allow inline assemly in the exported part of userspace headers at all. These headers must only

Re: [patch] use __asm__ and __volatile__ in asm-x86_64/msr.h

2007-06-18 Thread Christoph Hellwig
On Mon, Jun 18, 2007 at 10:02:21AM -0400, Mike Frysinger wrote: This is wrong for two reasons: - MSRs are not accessible in user space. - .section .fixup is not applicable to user space. Anything MSR-related should be protected by __KERNEL__ instead. This NAK doesn't apply to

Re: [patch] use __asm__ and __volatile__ in asm-ia64/gcc_intrin.h

2007-06-18 Thread Christoph Hellwig
On Mon, Jun 18, 2007 at 02:19:10AM -0400, Mike Frysinger wrote: Since asm-ia64/gcc_intrin.h gets exported to userspace, we need to make sure to use __asm__() rather than asm() since the latter is not available when compiling with gcc with GNU extensions turned off (like -std=c99). This header

Re: [patch] use __asm__ and __volatile__ in i386/arm/s390 byteorder.h

2007-06-18 Thread Christoph Hellwig
On Mon, Jun 18, 2007 at 07:34:50PM +0100, Christoph Hellwig wrote: On Sun, Jun 17, 2007 at 06:33:28PM -0400, Mike Frysinger wrote: This changes asm() to __asm__() and volatile to __volatile__ so that these headers can be used with gcc's -std=c99. We should not allow inline assemly

Re: [patch] use __asm__ and __volatile__ in asm-x86_64/msr.h

2007-06-18 Thread Andi Kleen
asm-i386/msr.h should not be exported to userspace at all, it contains nothing but kernel-internal helpers. Actually rdtsc and rdtscll and potentially rdpmc which is in there can be very useful in user space if you know what you're doing. Unfortunately a lot of its users don't, but not

Re: [patch] use __asm__ and __volatile__ in i386/arm/s390 byteorder.h

2007-06-18 Thread Sam Ravnborg
On Mon, Jun 18, 2007 at 07:34:50PM +0100, Christoph Hellwig wrote: On Sun, Jun 17, 2007 at 06:33:28PM -0400, Mike Frysinger wrote: This changes asm() to __asm__() and volatile to __volatile__ so that these headers can be used with gcc's -std=c99. We should not allow inline assemly

Re: [patch] use __asm__ and __volatile__ in i386/arm/s390 byteorder.h

2007-06-18 Thread Christoph Hellwig
On Mon, Jun 18, 2007 at 09:00:09PM +0200, Sam Ravnborg wrote: Do you imply that if we see asm or __asm__ in user space headers we ougth to warn about it? Seems at least sensible to me but if we introduce such a check we should kill all offenders first - which Mike's patches seems to trigger

Re: [patch] make hdrscheck.sh force __asm__ in exported headers

2007-06-17 Thread Mike Frysinger
On Monday 18 June 2007, Andrew Morton wrote: > Also, your changelog sucks: > > This updates scripts/hdrschecks.sh by grepping for asm() constructs and > rejecting them in favor of __asm__() in exported headers. > > well OK. But for what reason? We can see a lot of

Re: [patch] make hdrscheck.sh force __asm__ in exported headers

2007-06-17 Thread Mike Frysinger
t; > This updates scripts/hdrschecks.sh by grepping for asm() constructs > > > > and rejecting them in favor of __asm__() in exported headers. > > > > > > And does the kernel pass these checks? > > > > nope ... should i audit the arches before this gets merg

Re: [patch] make hdrscheck.sh force __asm__ in exported headers

2007-06-17 Thread Andrew Morton
grepping for asm() constructs and > > > rejecting them in favor of __asm__() in exported headers. > > > > And does the kernel pass these checks? > > nope ... should i audit the arches before this gets merged ? Yes please. I'd rather not break things in this fashion: it causes a st

Re: [patch] make hdrscheck.sh force __asm__ in exported headers

2007-06-17 Thread Mike Frysinger
On Monday 18 June 2007, Andrew Morton wrote: > On Sun, 17 Jun 2007 18:54:24 -0400 Mike Frysinger <[EMAIL PROTECTED]> wrote: > > This updates scripts/hdrschecks.sh by grepping for asm() constructs and > > rejecting them in favor of __asm__() in exported headers. > &g

Re: [patch] make hdrscheck.sh force __asm__ in exported headers

2007-06-17 Thread Andrew Morton
On Sun, 17 Jun 2007 18:54:24 -0400 Mike Frysinger <[EMAIL PROTECTED]> wrote: > This updates scripts/hdrschecks.sh by grepping for asm() constructs and > rejecting them in favor of __asm__() in exported headers. And does the kernel pass these checks? Which architectures have

Re: [patch] use __asm__ and __volatile__ in i386/arm/s390 byteorder.h

2007-06-17 Thread Mike Frysinger
On Sunday 17 June 2007, Arnd Bergmann wrote: > On Monday 18 June 2007, Arjan van de Ven wrote: > > On Sun, 2007-06-17 at 18:33 -0400, Mike Frysinger wrote: > > > This changes asm() to __asm__() and volatile to __volatile__ so that > > > these headers can be used with

Re: [patch] use __asm__ and __volatile__ in i386/arm/s390 byteorder.h

2007-06-17 Thread Arnd Bergmann
On Monday 18 June 2007, Arjan van de Ven wrote: > > On Sun, 2007-06-17 at 18:33 -0400, Mike Frysinger wrote: > > This changes asm() to __asm__() and volatile to __volatile__ so that these > > headers can be used with gcc's -std=c99. > > hmm but the kernel doesn't use -s

Re: [patch] use __asm__ and __volatile__ in i386/arm/s390 byteorder.h

2007-06-17 Thread Arjan van de Ven
On Sun, 2007-06-17 at 18:33 -0400, Mike Frysinger wrote: > This changes asm() to __asm__() and volatile to __volatile__ so that these > headers can be used with gcc's -std=c99. hmm but the kernel doesn't use -std=c99... - To unsubscribe from this list: send the line "unsubscribe l

[patch] make hdrscheck.sh force __asm__ in exported headers

2007-06-17 Thread Mike Frysinger
This updates scripts/hdrschecks.sh by grepping for asm() constructs and rejecting them in favor of __asm__() in exported headers. Signed-off-by: Mike Frysinger <[EMAIL PROTECTED]> --- diff --git a/scripts/hdrcheck.sh b/scripts/hdrcheck.sh index 3159858..33d17cc 100755 --- a/scripts/hdrch

[patch] use __asm__ and __volatile__ in i386/arm/s390 byteorder.h

2007-06-17 Thread Mike Frysinger
This changes asm() to __asm__() and volatile to __volatile__ so that these headers can be used with gcc's -std=c99. Signed-off-by: Mike Frysinger <[EMAIL PROTECTED]> --- diff --git a/include/asm-arm/byteorder.h b/include/asm-arm/byteorder.h index e6f7fcd..39105dc 100644 --- a/include/a

[patch] use __asm__ and __volatile__ in i386/arm/s390 byteorder.h

2007-06-17 Thread Mike Frysinger
This changes asm() to __asm__() and volatile to __volatile__ so that these headers can be used with gcc's -std=c99. Signed-off-by: Mike Frysinger [EMAIL PROTECTED] --- diff --git a/include/asm-arm/byteorder.h b/include/asm-arm/byteorder.h index e6f7fcd..39105dc 100644 --- a/include/asm-arm

Re: [patch] use __asm__ and __volatile__ in i386/arm/s390 byteorder.h

2007-06-17 Thread Arjan van de Ven
On Sun, 2007-06-17 at 18:33 -0400, Mike Frysinger wrote: This changes asm() to __asm__() and volatile to __volatile__ so that these headers can be used with gcc's -std=c99. hmm but the kernel doesn't use -std=c99... - To unsubscribe from this list: send the line unsubscribe linux-kernel

  1   2   >