From: Dave Hansen <dave.hansen@linux.intel.com>
To: linux-kernel@vger.kernel.org
Cc: linux-mm@kvack.org, x86@kernel.org,
kirill.shutemov@linux.intel.com,
Dave Hansen <dave.hansen@linux.intel.com>
Subject: [RFC][PATCH 6/7] x86, mpx, selftests: Use prctl header instead of magic numbers
Date: Wed, 01 Feb 2017 15:24:16 -0800 [thread overview]
Message-ID: <20170201232416.25090E28@viggo.jf.intel.com> (raw)
In-Reply-To: <20170201232408.FA486473@viggo.jf.intel.com>
I got away with just hard-coding the prctl() numbers in the MPX
selftests. Include the kernel header so we can just use the
symbolic names.
---
b/tools/testing/selftests/x86/mpx-mini-test.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff -puN tools/testing/selftests/x86/mpx-mini-test.c~mawa-068-selftests-inc tools/testing/selftests/x86/mpx-mini-test.c
--- a/tools/testing/selftests/x86/mpx-mini-test.c~mawa-068-selftests-inc 2017-02-01 15:12:18.083231385 -0800
+++ b/tools/testing/selftests/x86/mpx-mini-test.c 2017-02-01 15:12:18.087231565 -0800
@@ -40,6 +40,8 @@ int zap_all_every_this_many_mallocs = 10
#include "mpx-debug.h"
#include "mpx-mm.h"
+#include "../../../../include/uapi/linux/prctl.h"
+
#ifndef __always_inline
#define __always_inline inline __attribute__((always_inline)
#endif
@@ -666,7 +668,7 @@ bool process_specific_init(void)
check_clear(dir, size);
enable_mpx(dir);
check_clear(dir, size);
- if (prctl(43, 0, 0, 0, 0)) {
+ if (prctl(PR_MPX_ENABLE_MANAGEMENT, 0, 0, 0, 0)) {
printf("no MPX support\n");
abort();
return false;
@@ -676,7 +678,7 @@ bool process_specific_init(void)
bool process_specific_finish(void)
{
- if (prctl(44)) {
+ if (prctl(PR_MPX_DISABLE_MANAGEMENT)) {
printf("no MPX support\n");
return false;
}
_
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2017-02-01 23:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-01 23:24 [RFC][PATCH 0/7] x86, mpx: Support larger address space (MAWA) (v2) Dave Hansen
2017-02-01 23:24 ` [RFC][PATCH 1/7] x86, mpx: introduce per-mm MPX table size tracking Dave Hansen
2017-02-01 23:24 ` [RFC][PATCH 2/7] x86, mpx: update MPX to grok larger bounds tables Dave Hansen
2017-02-12 19:05 ` Thomas Gleixner
2017-02-01 23:24 ` [RFC][PATCH 3/7] x86, mpx: extend MPX prctl() to pass in size of bounds directory Dave Hansen
2017-02-12 19:15 ` Thomas Gleixner
2017-02-01 23:24 ` [RFC][PATCH 4/7] x86, mpx: context-switch new MPX address size MSR Dave Hansen
2017-02-12 19:37 ` Thomas Gleixner
2017-02-01 23:24 ` [RFC][PATCH 5/7] x86, mpx: shrink per-mm MPX data Dave Hansen
2017-02-12 22:44 ` Thomas Gleixner
2017-02-01 23:24 ` Dave Hansen [this message]
2017-02-01 23:24 ` [RFC][PATCH 7/7] x86, mpx: update MPX selftest to test larger bounds dir Dave Hansen
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=20170201232416.25090E28@viggo.jf.intel.com \
--to=dave.hansen@linux.intel.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=x86@kernel.org \
/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