From: Sandipan Das <sandipan@linux.ibm.com>
To: mpe@ellerman.id.au
Cc: sachinp@linux.vnet.ibm.com, aneesh.kumar@linux.ibm.com,
linuxppc-dev@lists.ozlabs.org
Subject: [PATCH] selftests/powerpc: Fix pkey syscall redefinitions
Date: Mon, 3 Aug 2020 13:10:43 +0530 [thread overview]
Message-ID: <20200803074043.466809-1-sandipan@linux.ibm.com> (raw)
Some distros have the pkey syscall numbers defined under
unistd.h. This conflicts with the definitions in the pkeys
selftest header and causes build failures.
E.g. this works
$ grep -nr "SYS_pkey" /usr/include/
/usr/include/bits/syscall.h:1575:# define SYS_pkey_alloc __NR_pkey_alloc
/usr/include/bits/syscall.h:1579:# define SYS_pkey_free __NR_pkey_free
/usr/include/bits/syscall.h:1583:# define SYS_pkey_mprotect __NR_pkey_mprotect
While this does not
$ grep -nr "SYS_pkey" /usr/include/
/usr/include/bits/syscall.h:1575:# define SYS_pkey_alloc __NR_pkey_alloc
/usr/include/bits/syscall.h:1579:# define SYS_pkey_free __NR_pkey_free
/usr/include/bits/syscall.h:1583:# define SYS_pkey_mprotect __NR_pkey_mprotect
/usr/include/asm-generic/unistd.h:728:__SYSCALL(__NR_pkey_mprotect, sys_pkey_mprotect)
/usr/include/asm-generic/unistd.h:730:__SYSCALL(__NR_pkey_alloc, sys_pkey_alloc)
/usr/include/asm-generic/unistd.h:732:__SYSCALL(__NR_pkey_free, sys_pkey_free)
Reported-by: Sachin Sant <sachinp@linux.vnet.ibm.com>
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
---
tools/testing/selftests/powerpc/include/pkeys.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tools/testing/selftests/powerpc/include/pkeys.h b/tools/testing/selftests/powerpc/include/pkeys.h
index 6ba95039a034..26eef5c1f8ea 100644
--- a/tools/testing/selftests/powerpc/include/pkeys.h
+++ b/tools/testing/selftests/powerpc/include/pkeys.h
@@ -31,8 +31,13 @@
#define SI_PKEY_OFFSET 0x20
+#undef SYS_pkey_mprotect
#define SYS_pkey_mprotect 386
+
+#undef SYS_pkey_alloc
#define SYS_pkey_alloc 384
+
+#undef SYS_pkey_free
#define SYS_pkey_free 385
#define PKEY_BITS_PER_PKEY 2
--
2.25.1
reply other threads:[~2020-08-03 7:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20200803074043.466809-1-sandipan@linux.ibm.com \
--to=sandipan@linux.ibm.com \
--cc=aneesh.kumar@linux.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=sachinp@linux.vnet.ibm.com \
/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;
as well as URLs for NNTP newsgroup(s).