Linux Test Project
 help / color / mirror / Atom feed
From: Jan Stancek <jstancek@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] {get|set}_thread_area issue on ARM
Date: Fri, 4 Dec 2015 08:19:55 -0500 (EST)	[thread overview]
Message-ID: <1049557228.23712541.1449235195348.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <20151204130241.GA21840@yury-N73SV>



----- Original Message -----
> From: "Yury Norov" <ynorov@caviumnetworks.com>
> To: "Jan Stancek" <jstancek@redhat.com>
> Cc: ltp@lists.linux.it, "David Howells" <dhowells@redhat.com>
> Sent: Friday, 4 December, 2015 2:02:41 PM
> Subject: Re: [LTP] {get|set}_thread_area issue on ARM
> 
> On Fri, Dec 04, 2015 at 04:20:37AM -0500, Jan Stancek wrote:
> > 
> > 
> > 
> > 
> > ----- Original Message -----
> > > From: "Yury Norov" <ynorov@caviumnetworks.com>
> > > To: ltp@lists.linux.it
> > > Cc: "David Howells" <dhowells@redhat.com>
> > > Sent: Friday, 4 December, 2015 4:47:11 AM
> > > Subject: [LTP] {get|set}_thread_area issue on ARM
> > > 
> > > Hi all,
> > > 
> > > I just tried build ltp for arm, and one (maybe, first of) test failed
> > > build. Namely, set_thread_area01.c
> > > 
> > > The reason is that __NR_set_thread_area and __NR_get_thread_area are
> > > not declared. They should come from
> > > /usr/arm-linux-gnueabi/include/asm/unistd.h
> > > But there's only:
> > > [...]
> > > #define __NR_remap_file_pages           (__NR_SYSCALL_BASE+253)
> > >                                          /* for set_thread_area */
> > >                                          /* for get_thread_area */
> > > #define __NR_set_tid_address            (__NR_SYSCALL_BASE+256)
> > > [...]
> > > 
> > > In kernel, there are stubs for corresponding syscall numbers. So it
> > > looks like this pair is deprecated and unsupported. I can build ltp
> > > for aarch64 and x84_64 just fine.
> > 
> > Looking at history, it appears it was never supported.
> > 
> > > 
> > > Could someone explain me what am I doing wrong?
> > 
> > Can you try to add:
> >   #include "linux_syscall_numbers.h"
> > to testcases/kernel/syscalls/set_thread_area/set_thread_area01.c
> > and see if it compiles. And when you run it, it should end with TCONF.
> > 
> > Regards,
> > Jan
> 
> Hi Jan,
> 
> It doesn't help much. The problem is not in that ltp doesn't know
> symbols, but because they are identical - both are -1.
>   (__LTP__NR_INVALID_SYSCALL)

Hi,

That was expected.

> 
> And gcc treats is as an error:
> arm-linux-gnueabi-gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall
> -W -g -O2 -Wold-style-definition
> -I/home/yury/work/ltp/testcases/kernel/include -I../../../../include
> -I../../../../include -Wl,--rpath=/root/lib32
> -Wl,--dynamic-linker=/root/lib32/ld-2.21.so  -L../../../../lib
> set_thread_area01.c   -lltp -o set_thread_area01
> set_thread_area01.c: In function ?get_name?:
> set_thread_area01.c:70:2: error: duplicate case value
>   case __NR_get_thread_area:
>   ^
> set_thread_area01.c:67:2: error: previously used here
>   case __NR_set_thread_area:
>   ^
> set_thread_area01.c: In function ?main?:
> set_thread_area01.c:87:17: warning: comparison between signed
> and unsigned integer expressions [-Wsign-compare]
>    for (i = 0; i < sizeof(tests) / sizeof(struct test); i++) {
>                  ^
> <builtin>: recipe for target 'set_thread_area01' failed

This wasn't - I didn't realize they are used in switch.

I suggest to remove the get_name() function and store names
in struct test (with some macro to stringify those syscall __NR_#).

Would you care to send a patch?

> 
> BTW, I forgot to mention, if I "uncomment" that definitions in system
> headers, everything becomes fine.

I assume you still get TCONF when you run it, because kernel should
return ENOSYS for both.

Regards,
Jan

> 
> Preprocessed sources for arm and x86_64 are attached.
> 
> BR,
> Yury.
> 
> 
> 

  reply	other threads:[~2015-12-04 13:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-04  3:47 [LTP] {get|set}_thread_area issue on ARM Yury Norov
2015-12-04  9:20 ` Jan Stancek
2015-12-04 13:02   ` Yury Norov
2015-12-04 13:19     ` Jan Stancek [this message]
2015-12-04 15:20       ` Yury Norov
2015-12-07  9:25 ` Cyril Hrubis
2015-12-07  9:54   ` Cyril Hrubis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1049557228.23712541.1449235195348.JavaMail.zimbra@redhat.com \
    --to=jstancek@redhat.com \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox