Re: [PATCH v3 1/4] scripts: add a script to generate syscall_nr.h

2020-03-16 Thread Laurent Vivier
Le 16/03/2020 à 20:27, Taylor Simpson a écrit :
> 
> 
>> Le 16/03/2020 à 17:21, Taylor Simpson a écrit :
>>>
>>>
 -Original Message-
 From: Laurent Vivier 
 Sent: Monday, March 16, 2020 3:56 AM
 To: qemu-devel@nongnu.org
 Cc: Laurent Vivier ; Richard Henderson
 ; Riku Voipio ; Taylor
 Simpson ; Alistair Francis
 
 Subject: [PATCH v3 1/4] scripts: add a script to generate syscall_nr.h

 This script is needed for targets based on asm-generic syscall numbers
 generation

 +
 +filter_defines()
 +{
 +grep -e "#define __NR_" -e "#define __NR3264"
>>>
>>> For Hexagon, we're still running a 4.9 kernel.  When I tried out this 
>>> script on
>> that code base, there are a handful of these
>>> #undef __NR_syscalls
>>> #define __NR_syscalls 291
>>> This works fine with normal C preprocessing, and the last one wins.
>> However, when the #undef's are filtered out, it lease to build errors from
>> multiple #define's of TARGET_NR_syscalls.  AFAIK, qemu doesn't use this, so
>> it should be OK to filter out.  So, I changed the above line to
>>> grep -e "#define __NR_" -e "#define __NR3264" | grep -v
>> "__NR_syscalls"
>>>
>>> If you're OK incorporating that now, great!  Otherwise, I'll add it to the
>> Hexagon RFC patch series until we get to a newer kernel.
>>
>> Sorry, I've just sent the pull-request.
>>
>> Add it to your RFC, please.
> 
> Sure.
> 
>>
>> It's why this script is only an helper, so it means once the file is
>> generated it can be edited before being committed.
> 
> Oh, I thought the goal was to have them all generated.  That's why I 
> suggested generating the "Do not modify" comment.

The "Do not modify" is a good idea: people will re-run the script
instead of editing directly the file, but then it can be adjusted.

Thanks,
Laurent





RE: [PATCH v3 1/4] scripts: add a script to generate syscall_nr.h

2020-03-16 Thread Taylor Simpson


> Le 16/03/2020 à 17:21, Taylor Simpson a écrit :
> >
> >
> >> -Original Message-
> >> From: Laurent Vivier 
> >> Sent: Monday, March 16, 2020 3:56 AM
> >> To: qemu-devel@nongnu.org
> >> Cc: Laurent Vivier ; Richard Henderson
> >> ; Riku Voipio ; Taylor
> >> Simpson ; Alistair Francis
> >> 
> >> Subject: [PATCH v3 1/4] scripts: add a script to generate syscall_nr.h
> >>
> >> This script is needed for targets based on asm-generic syscall numbers
> >> generation
> >>
> >> +
> >> +filter_defines()
> >> +{
> >> +grep -e "#define __NR_" -e "#define __NR3264"
> >
> > For Hexagon, we're still running a 4.9 kernel.  When I tried out this 
> > script on
> that code base, there are a handful of these
> > #undef __NR_syscalls
> > #define __NR_syscalls 291
> > This works fine with normal C preprocessing, and the last one wins.
> However, when the #undef's are filtered out, it lease to build errors from
> multiple #define's of TARGET_NR_syscalls.  AFAIK, qemu doesn't use this, so
> it should be OK to filter out.  So, I changed the above line to
> > grep -e "#define __NR_" -e "#define __NR3264" | grep -v
> "__NR_syscalls"
> >
> > If you're OK incorporating that now, great!  Otherwise, I'll add it to the
> Hexagon RFC patch series until we get to a newer kernel.
>
> Sorry, I've just sent the pull-request.
>
> Add it to your RFC, please.

Sure.

>
> It's why this script is only an helper, so it means once the file is
> generated it can be edited before being committed.

Oh, I thought the goal was to have them all generated.  That's why I suggested 
generating the "Do not modify" comment.

>
> Thanks,
> Laurent


RE: [PATCH v3 1/4] scripts: add a script to generate syscall_nr.h

2020-03-16 Thread Taylor Simpson



> -Original Message-
> From: Laurent Vivier 
> Sent: Monday, March 16, 2020 3:56 AM
> To: qemu-devel@nongnu.org
> Cc: Laurent Vivier ; Richard Henderson
> ; Riku Voipio ; Taylor
> Simpson ; Alistair Francis
> 
> Subject: [PATCH v3 1/4] scripts: add a script to generate syscall_nr.h
>
> This script is needed for targets based on asm-generic syscall numbers
> generation
>
> +
> +filter_defines()
> +{
> +grep -e "#define __NR_" -e "#define __NR3264"

For Hexagon, we're still running a 4.9 kernel.  When I tried out this script on 
that code base, there are a handful of these
#undef __NR_syscalls
#define __NR_syscalls 291
This works fine with normal C preprocessing, and the last one wins.  However, 
when the #undef's are filtered out, it lease to build errors from multiple 
#define's of TARGET_NR_syscalls.  AFAIK, qemu doesn't use this, so it should be 
OK to filter out.  So, I changed the above line to
grep -e "#define __NR_" -e "#define __NR3264" | grep -v "__NR_syscalls"

If you're OK incorporating that now, great!  Otherwise, I'll add it to the 
Hexagon RFC patch series until we get to a newer kernel.

Thanks,
Taylor


> +}
> +





Re: [PATCH v3 1/4] scripts: add a script to generate syscall_nr.h

2020-03-16 Thread Laurent Vivier
Le 16/03/2020 à 17:21, Taylor Simpson a écrit :
> 
> 
>> -Original Message-
>> From: Laurent Vivier 
>> Sent: Monday, March 16, 2020 3:56 AM
>> To: qemu-devel@nongnu.org
>> Cc: Laurent Vivier ; Richard Henderson
>> ; Riku Voipio ; Taylor
>> Simpson ; Alistair Francis
>> 
>> Subject: [PATCH v3 1/4] scripts: add a script to generate syscall_nr.h
>>
>> This script is needed for targets based on asm-generic syscall numbers
>> generation
>>
>> +
>> +filter_defines()
>> +{
>> +grep -e "#define __NR_" -e "#define __NR3264"
> 
> For Hexagon, we're still running a 4.9 kernel.  When I tried out this script 
> on that code base, there are a handful of these
> #undef __NR_syscalls
> #define __NR_syscalls 291
> This works fine with normal C preprocessing, and the last one wins.  However, 
> when the #undef's are filtered out, it lease to build errors from multiple 
> #define's of TARGET_NR_syscalls.  AFAIK, qemu doesn't use this, so it should 
> be OK to filter out.  So, I changed the above line to
> grep -e "#define __NR_" -e "#define __NR3264" | grep -v "__NR_syscalls"
> 
> If you're OK incorporating that now, great!  Otherwise, I'll add it to the 
> Hexagon RFC patch series until we get to a newer kernel.

Sorry, I've just sent the pull-request.

Add it to your RFC, please.

It's why this script is only an helper, so it means once the file is
generated it can be edited before being committed.

Thanks,
Laurent