Re: [PATCH] x86: uapi: Fix __BITS_PER_LONG for x32

2015-10-01 Thread Ben Hutchings
On Thu, 2015-10-01 at 21:54 +0100, Ben Hutchings wrote:
> On Thu, 2015-10-01 at 09:02 -0400, Brian Gerst wrote:
> > On Thu, Oct 1, 2015 at 4:23 AM, Ingo Molnar  wrote:
> > > 
> > > * Ben Hutchings  wrote:
> > > 
> > > > diff --git a/arch/x86/include/uapi/asm/bitsperlong.h
> > > > b/arch/x86/include/uapi/asm/bitsperlong.h
> > > > index b0ae1c4..217909b 100644
> > > > --- a/arch/x86/include/uapi/asm/bitsperlong.h
> > > > +++ b/arch/x86/include/uapi/asm/bitsperlong.h
> > > > @@ -1,7 +1,7 @@
> > > >  #ifndef __ASM_X86_BITSPERLONG_H
> > > >  #define __ASM_X86_BITSPERLONG_H
> > > > 
> > > > -#ifdef __x86_64__
> > > > +#if defined(__x86_64__) && !defined(__ILP32__)
> > > >  # define __BITS_PER_LONG 64
> > > 
> > > Can we write this as:
> > > 
> > >#ifdef __ILP64__
> 
> Assuming you meant __LP64__...
> 
> > Do all versions of gcc/clang define that, even if x32 isn't
> > supported?
> 
> For gcc, it's been defined since 2003 (gcc 3.3):
> https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=0bdab2d89e28ca4dc84f8f0fafed85a4822bca49
> 
> For clang, it's been defined since before its first public release:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?r1=38978=38987=161685
> 
> So gcc 3.1 and 3.2 didn't define it, but everything newer does.

As the kernel itself is supposed to still be compilable with gcc 3.2, I
think this means that my patch has the right condition.

Ben.

-- 
Ben Hutchings
When in doubt, use brute force. - Ken Thompson

signature.asc
Description: This is a digitally signed message part


Re: [PATCH] x86: uapi: Fix __BITS_PER_LONG for x32

2015-10-01 Thread Ben Hutchings
On Thu, 2015-10-01 at 09:02 -0400, Brian Gerst wrote:
> On Thu, Oct 1, 2015 at 4:23 AM, Ingo Molnar  wrote:
> > 
> > * Ben Hutchings  wrote:
> > 
> > > diff --git a/arch/x86/include/uapi/asm/bitsperlong.h
> > > b/arch/x86/include/uapi/asm/bitsperlong.h
> > > index b0ae1c4..217909b 100644
> > > --- a/arch/x86/include/uapi/asm/bitsperlong.h
> > > +++ b/arch/x86/include/uapi/asm/bitsperlong.h
> > > @@ -1,7 +1,7 @@
> > >  #ifndef __ASM_X86_BITSPERLONG_H
> > >  #define __ASM_X86_BITSPERLONG_H
> > > 
> > > -#ifdef __x86_64__
> > > +#if defined(__x86_64__) && !defined(__ILP32__)
> > >  # define __BITS_PER_LONG 64
> > 
> > Can we write this as:
> > 
> >#ifdef __ILP64__

Assuming you meant __LP64__...

> Do all versions of gcc/clang define that, even if x32 isn't
> supported?

For gcc, it's been defined since 2003 (gcc 3.3):
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=0bdab2d89e28ca4dc84f8f0fafed85a4822bca49

For clang, it's been defined since before its first public release:
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?r1=38978=38987=161685

So gcc 3.1 and 3.2 didn't define it, but everything newer does.

Ben.

-- 
Ben Hutchings
Knowledge is power.  France is bacon.


signature.asc
Description: This is a digitally signed message part


Re: [PATCH] x86: uapi: Fix __BITS_PER_LONG for x32

2015-10-01 Thread Brian Gerst
On Thu, Oct 1, 2015 at 4:23 AM, Ingo Molnar  wrote:
>
> * Ben Hutchings  wrote:
>
>> diff --git a/arch/x86/include/uapi/asm/bitsperlong.h 
>> b/arch/x86/include/uapi/asm/bitsperlong.h
>> index b0ae1c4..217909b 100644
>> --- a/arch/x86/include/uapi/asm/bitsperlong.h
>> +++ b/arch/x86/include/uapi/asm/bitsperlong.h
>> @@ -1,7 +1,7 @@
>>  #ifndef __ASM_X86_BITSPERLONG_H
>>  #define __ASM_X86_BITSPERLONG_H
>>
>> -#ifdef __x86_64__
>> +#if defined(__x86_64__) && !defined(__ILP32__)
>>  # define __BITS_PER_LONG 64
>
> Can we write this as:
>
>#ifdef __ILP64__

Do all versions of gcc/clang define that, even if x32 isn't supported?

--
Brian Gerst
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] x86: uapi: Fix __BITS_PER_LONG for x32

2015-10-01 Thread Ingo Molnar

* Ben Hutchings  wrote:

> diff --git a/arch/x86/include/uapi/asm/bitsperlong.h 
> b/arch/x86/include/uapi/asm/bitsperlong.h
> index b0ae1c4..217909b 100644
> --- a/arch/x86/include/uapi/asm/bitsperlong.h
> +++ b/arch/x86/include/uapi/asm/bitsperlong.h
> @@ -1,7 +1,7 @@
>  #ifndef __ASM_X86_BITSPERLONG_H
>  #define __ASM_X86_BITSPERLONG_H
>  
> -#ifdef __x86_64__
> +#if defined(__x86_64__) && !defined(__ILP32__)
>  # define __BITS_PER_LONG 64

Can we write this as:

   #ifdef __ILP64__

?

Thanks,

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] x86: uapi: Fix __BITS_PER_LONG for x32

2015-10-01 Thread Ingo Molnar

* Ben Hutchings  wrote:

> diff --git a/arch/x86/include/uapi/asm/bitsperlong.h 
> b/arch/x86/include/uapi/asm/bitsperlong.h
> index b0ae1c4..217909b 100644
> --- a/arch/x86/include/uapi/asm/bitsperlong.h
> +++ b/arch/x86/include/uapi/asm/bitsperlong.h
> @@ -1,7 +1,7 @@
>  #ifndef __ASM_X86_BITSPERLONG_H
>  #define __ASM_X86_BITSPERLONG_H
>  
> -#ifdef __x86_64__
> +#if defined(__x86_64__) && !defined(__ILP32__)
>  # define __BITS_PER_LONG 64

Can we write this as:

   #ifdef __ILP64__

?

Thanks,

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] x86: uapi: Fix __BITS_PER_LONG for x32

2015-10-01 Thread Brian Gerst
On Thu, Oct 1, 2015 at 4:23 AM, Ingo Molnar  wrote:
>
> * Ben Hutchings  wrote:
>
>> diff --git a/arch/x86/include/uapi/asm/bitsperlong.h 
>> b/arch/x86/include/uapi/asm/bitsperlong.h
>> index b0ae1c4..217909b 100644
>> --- a/arch/x86/include/uapi/asm/bitsperlong.h
>> +++ b/arch/x86/include/uapi/asm/bitsperlong.h
>> @@ -1,7 +1,7 @@
>>  #ifndef __ASM_X86_BITSPERLONG_H
>>  #define __ASM_X86_BITSPERLONG_H
>>
>> -#ifdef __x86_64__
>> +#if defined(__x86_64__) && !defined(__ILP32__)
>>  # define __BITS_PER_LONG 64
>
> Can we write this as:
>
>#ifdef __ILP64__

Do all versions of gcc/clang define that, even if x32 isn't supported?

--
Brian Gerst
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] x86: uapi: Fix __BITS_PER_LONG for x32

2015-10-01 Thread Ben Hutchings
On Thu, 2015-10-01 at 09:02 -0400, Brian Gerst wrote:
> On Thu, Oct 1, 2015 at 4:23 AM, Ingo Molnar  wrote:
> > 
> > * Ben Hutchings  wrote:
> > 
> > > diff --git a/arch/x86/include/uapi/asm/bitsperlong.h
> > > b/arch/x86/include/uapi/asm/bitsperlong.h
> > > index b0ae1c4..217909b 100644
> > > --- a/arch/x86/include/uapi/asm/bitsperlong.h
> > > +++ b/arch/x86/include/uapi/asm/bitsperlong.h
> > > @@ -1,7 +1,7 @@
> > >  #ifndef __ASM_X86_BITSPERLONG_H
> > >  #define __ASM_X86_BITSPERLONG_H
> > > 
> > > -#ifdef __x86_64__
> > > +#if defined(__x86_64__) && !defined(__ILP32__)
> > >  # define __BITS_PER_LONG 64
> > 
> > Can we write this as:
> > 
> >#ifdef __ILP64__

Assuming you meant __LP64__...

> Do all versions of gcc/clang define that, even if x32 isn't
> supported?

For gcc, it's been defined since 2003 (gcc 3.3):
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=0bdab2d89e28ca4dc84f8f0fafed85a4822bca49

For clang, it's been defined since before its first public release:
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?r1=38978=38987=161685

So gcc 3.1 and 3.2 didn't define it, but everything newer does.

Ben.

-- 
Ben Hutchings
Knowledge is power.  France is bacon.


signature.asc
Description: This is a digitally signed message part


Re: [PATCH] x86: uapi: Fix __BITS_PER_LONG for x32

2015-10-01 Thread Ben Hutchings
On Thu, 2015-10-01 at 21:54 +0100, Ben Hutchings wrote:
> On Thu, 2015-10-01 at 09:02 -0400, Brian Gerst wrote:
> > On Thu, Oct 1, 2015 at 4:23 AM, Ingo Molnar  wrote:
> > > 
> > > * Ben Hutchings  wrote:
> > > 
> > > > diff --git a/arch/x86/include/uapi/asm/bitsperlong.h
> > > > b/arch/x86/include/uapi/asm/bitsperlong.h
> > > > index b0ae1c4..217909b 100644
> > > > --- a/arch/x86/include/uapi/asm/bitsperlong.h
> > > > +++ b/arch/x86/include/uapi/asm/bitsperlong.h
> > > > @@ -1,7 +1,7 @@
> > > >  #ifndef __ASM_X86_BITSPERLONG_H
> > > >  #define __ASM_X86_BITSPERLONG_H
> > > > 
> > > > -#ifdef __x86_64__
> > > > +#if defined(__x86_64__) && !defined(__ILP32__)
> > > >  # define __BITS_PER_LONG 64
> > > 
> > > Can we write this as:
> > > 
> > >#ifdef __ILP64__
> 
> Assuming you meant __LP64__...
> 
> > Do all versions of gcc/clang define that, even if x32 isn't
> > supported?
> 
> For gcc, it's been defined since 2003 (gcc 3.3):
> https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=0bdab2d89e28ca4dc84f8f0fafed85a4822bca49
> 
> For clang, it's been defined since before its first public release:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?r1=38978=38987=161685
> 
> So gcc 3.1 and 3.2 didn't define it, but everything newer does.

As the kernel itself is supposed to still be compilable with gcc 3.2, I
think this means that my patch has the right condition.

Ben.

-- 
Ben Hutchings
When in doubt, use brute force. - Ken Thompson

signature.asc
Description: This is a digitally signed message part