Re: [PATCH 1/2] tools/testing/selftests/x86: fix warning: "SEGV_PKUERR|SEGV_BNDERR" redefined

2018-05-18 Thread Ingo Molnar

* Shuah Khan  wrote:

> On 05/14/2018 03:31 AM, Ingo Molnar wrote:
> > 
> > * Shuah Khan  wrote:
> > 
> >> On 05/08/2018 10:25 AM, Dave Hansen wrote:
> >>> On 05/08/2018 02:14 AM, Li Zhijian wrote:
>  SEGV_PKUERR and SEGV_BNDERR are defined since glibc-2.27
> >>>
> >>>
> >>> Acked-by: Dave Hansen 
> >>>
> >>
> >> Thanks. Queuing this up for 4.17-rc5
> > 
> > Please drop these patches, I have fixed them slightly differently and there 
> > are 
> > dependencies with followup patches.
> > 
> > Tanks,
> > 
> > Ingo
> > 
> 
> Dropped now.

Thanks!

Ingo


Re: [PATCH 1/2] tools/testing/selftests/x86: fix warning: "SEGV_PKUERR|SEGV_BNDERR" redefined

2018-05-15 Thread Shuah Khan
On 05/14/2018 03:31 AM, Ingo Molnar wrote:
> 
> * Shuah Khan  wrote:
> 
>> On 05/08/2018 10:25 AM, Dave Hansen wrote:
>>> On 05/08/2018 02:14 AM, Li Zhijian wrote:
 SEGV_PKUERR and SEGV_BNDERR are defined since glibc-2.27
>>>
>>>
>>> Acked-by: Dave Hansen 
>>>
>>
>> Thanks. Queuing this up for 4.17-rc5
> 
> Please drop these patches, I have fixed them slightly differently and there 
> are 
> dependencies with followup patches.
> 
> Tanks,
> 
>   Ingo
> 

Dropped now.

thanks,
-- Shuah


Re: [PATCH 1/2] tools/testing/selftests/x86: fix warning: "SEGV_PKUERR|SEGV_BNDERR" redefined

2018-05-14 Thread Ingo Molnar

* Shuah Khan  wrote:

> On 05/08/2018 10:25 AM, Dave Hansen wrote:
> > On 05/08/2018 02:14 AM, Li Zhijian wrote:
> >> SEGV_PKUERR and SEGV_BNDERR are defined since glibc-2.27
> > 
> > 
> > Acked-by: Dave Hansen 
> > 
> 
> Thanks. Queuing this up for 4.17-rc5

Please drop these patches, I have fixed them slightly differently and there are 
dependencies with followup patches.

Tanks,

Ingo


Re: [PATCH 1/2] tools/testing/selftests/x86: fix warning: "SEGV_PKUERR|SEGV_BNDERR" redefined

2018-05-08 Thread Shuah Khan
On 05/08/2018 10:25 AM, Dave Hansen wrote:
> On 05/08/2018 02:14 AM, Li Zhijian wrote:
>> SEGV_PKUERR and SEGV_BNDERR are defined since glibc-2.27
> 
> 
> Acked-by: Dave Hansen 
> 

Thanks. Queuing this up for 4.17-rc5

-- Shuah


Re: [PATCH 1/2] tools/testing/selftests/x86: fix warning: "SEGV_PKUERR|SEGV_BNDERR" redefined

2018-05-08 Thread Dave Hansen
On 05/08/2018 02:14 AM, Li Zhijian wrote:
> SEGV_PKUERR and SEGV_BNDERR are defined since glibc-2.27


Acked-by: Dave Hansen 


[PATCH 1/2] tools/testing/selftests/x86: fix warning: "SEGV_PKUERR|SEGV_BNDERR" redefined

2018-05-08 Thread Li Zhijian
SEGV_PKUERR and SEGV_BNDERR are defined since glibc-2.27

fix the following issue:
---
root@vm-lkp-nex04-4G-5 
/usr/src/linux-selftests-x86_64-rhel-7.2-75bc37fefc4471e718ba8e651aa74673d4e0a9eb/tools/testing/selftests/x86#
 make
gcc -m32 -o 
/usr/src/linux-selftests-x86_64-rhel-7.2-75bc37fefc4471e718ba8e651aa74673d4e0a9eb/tools/testing/selftests/x86/protection_keys_32
 -O2 -g -std=gnu99 -pthread -Wall -no-pie -DCAN_BUILD_32 -DCAN_BUILD_64 
protection_keys.c -lrt -ldl -lm
gcc -m64 -o 
/usr/src/linux-selftests-x86_64-rhel-7.2-75bc37fefc4471e718ba8e651aa74673d4e0a9eb/tools/testing/selftests/x86/protection_keys_64
 -O2 -g -std=gnu99 -pthread -Wall -no-pie -DCAN_BUILD_32 -DCAN_BUILD_64 
protection_keys.c -lrt -ldl
protection_keys.c:228:0: warning: "SEGV_BNDERR" redefined
 #define SEGV_BNDERR 3  /* failed address bound checks */
 ^
In file included from /usr/include/signal.h:58:0,
 from protection_keys.c:33:
/usr/include/bits/siginfo-consts.h:117:0: note: this is the location of the 
previous definition
 #  define SEGV_BNDERR SEGV_BNDERR
 ^
protection_keys.c:229:0: warning: "SEGV_PKUERR" redefined
 #define SEGV_PKUERR 4
 ^
In file included from /usr/include/signal.h:58:0,
 from protection_keys.c:33:
/usr/include/bits/siginfo-consts.h:119:0: note: this is the location of the 
previous definition
 #  define SEGV_PKUERR SEGV_PKUERR
 ^
protection_keys.c:228:0: warning: "SEGV_BNDERR" redefined
 #define SEGV_BNDERR 3  /* failed address bound checks */
 ^
In file included from /usr/include/signal.h:58:0,
 from protection_keys.c:33:
/usr/include/x86_64-linux-gnu/bits/siginfo-consts.h:117:0: note: this is the 
location of the previous definition
 #  define SEGV_BNDERR SEGV_BNDERR
 ^
protection_keys.c:229:0: warning: "SEGV_PKUERR" redefined
 #define SEGV_PKUERR 4
 ^
In file included from /usr/include/signal.h:58:0,
 from protection_keys.c:33:
/usr/include/x86_64-linux-gnu/bits/siginfo-consts.h:119:0: note: this is the 
location of the previous definition
 #  define SEGV_PKUERR SEGV_PKUERR
 ^
---

Signed-off-by: Li Zhijian 
---
 tools/testing/selftests/x86/protection_keys.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/x86/protection_keys.c 
b/tools/testing/selftests/x86/protection_keys.c
index f15aa5a..757bb16 100644
--- a/tools/testing/selftests/x86/protection_keys.c
+++ b/tools/testing/selftests/x86/protection_keys.c
@@ -225,8 +225,12 @@ void dump_mem(void *dumpme, int len_bytes)
}
 }
 
-#define SEGV_BNDERR 3  /* failed address bound checks */
-#define SEGV_PKUERR 4
+#ifndef SEGV_BNDERR
+# define SEGV_BNDERR 3  /* failed address bound checks */
+#endif
+#ifndef SEGV_PKUERR
+# define SEGV_PKUERR 4
+#endif
 
 static char *si_code_str(int si_code)
 {
-- 
2.7.4