From: gorcunov at gmail.com (Cyrill Gorcunov)
Subject: [PATCH] proc: fix proc-self-map-files selftest for arm
Date: Thu, 11 Oct 2018 22:42:10 +0300 [thread overview]
Message-ID: <20181011194210.GD2401@uranus.lan> (raw)
In-Reply-To: <20181011184359.15627-1-rafael.tinoco@linaro.org>
On Thu, Oct 11, 2018 at 03:43:59PM -0300, Rafael David Tinoco wrote:
> MAP_FIXED is important for this test but, unfortunately, lowest virtual
> address for user space mapping on arm is (PAGE_SIZE * 2) and NULL hint
> does not seem to guarantee that when MAP_FIXED is given. This patch sets
> the virtual address that will hold the mapping for the test, fixing the
> issue.
>
> Link: https://bugs.linaro.org/show_bug.cgi?id=3782
> Signed-off-by: Rafael David Tinoco <rafael.tinoco at linaro.org>
> ---
> tools/testing/selftests/proc/proc-self-map-files-002.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/proc/proc-self-map-files-002.c b/tools/testing/selftests/proc/proc-self-map-files-002.c
> index 6f1f4a6e1ecb..0a47eaca732a 100644
> --- a/tools/testing/selftests/proc/proc-self-map-files-002.c
> +++ b/tools/testing/selftests/proc/proc-self-map-files-002.c
> @@ -55,7 +55,9 @@ int main(void)
> if (fd == -1)
> return 1;
>
> - p = mmap(NULL, PAGE_SIZE, PROT_NONE, MAP_PRIVATE|MAP_FILE|MAP_FIXED, fd, 0);
> + p = mmap((void *) (2 * PAGE_SIZE), PAGE_SIZE, PROT_NONE,
> + MAP_PRIVATE|MAP_FILE|MAP_FIXED, fd, 0);
> +
> if (p == MAP_FAILED) {
> if (errno == EPERM)
> return 2;
As far as I remember nil virtual address has been there only to be sure the
vma allocated won't be merged with another vmas. Fore sure most of x86
standart application won't be using 8K address as well, so should do the
trick I think.
(Strictlly speaking the test should be rather parsing own maps first and
find unused address instead but whatever :)
Reviewed-by: Cyrill Gorcunov <gorcunov at gmail.com>
WARNING: multiple messages have this Message-ID (diff)
From: gorcunov@gmail.com (Cyrill Gorcunov)
Subject: [PATCH] proc: fix proc-self-map-files selftest for arm
Date: Thu, 11 Oct 2018 22:42:10 +0300 [thread overview]
Message-ID: <20181011194210.GD2401@uranus.lan> (raw)
Message-ID: <20181011194210.4SihthtHd2ZutVex2CPQlLRb8PXVYGZmsU_YMOxcGNo@z> (raw)
In-Reply-To: <20181011184359.15627-1-rafael.tinoco@linaro.org>
On Thu, Oct 11, 2018@03:43:59PM -0300, Rafael David Tinoco wrote:
> MAP_FIXED is important for this test but, unfortunately, lowest virtual
> address for user space mapping on arm is (PAGE_SIZE * 2) and NULL hint
> does not seem to guarantee that when MAP_FIXED is given. This patch sets
> the virtual address that will hold the mapping for the test, fixing the
> issue.
>
> Link: https://bugs.linaro.org/show_bug.cgi?id=3782
> Signed-off-by: Rafael David Tinoco <rafael.tinoco at linaro.org>
> ---
> tools/testing/selftests/proc/proc-self-map-files-002.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/proc/proc-self-map-files-002.c b/tools/testing/selftests/proc/proc-self-map-files-002.c
> index 6f1f4a6e1ecb..0a47eaca732a 100644
> --- a/tools/testing/selftests/proc/proc-self-map-files-002.c
> +++ b/tools/testing/selftests/proc/proc-self-map-files-002.c
> @@ -55,7 +55,9 @@ int main(void)
> if (fd == -1)
> return 1;
>
> - p = mmap(NULL, PAGE_SIZE, PROT_NONE, MAP_PRIVATE|MAP_FILE|MAP_FIXED, fd, 0);
> + p = mmap((void *) (2 * PAGE_SIZE), PAGE_SIZE, PROT_NONE,
> + MAP_PRIVATE|MAP_FILE|MAP_FIXED, fd, 0);
> +
> if (p == MAP_FAILED) {
> if (errno == EPERM)
> return 2;
As far as I remember nil virtual address has been there only to be sure the
vma allocated won't be merged with another vmas. Fore sure most of x86
standart application won't be using 8K address as well, so should do the
trick I think.
(Strictlly speaking the test should be rather parsing own maps first and
find unused address instead but whatever :)
Reviewed-by: Cyrill Gorcunov <gorcunov at gmail.com>
WARNING: multiple messages have this Message-ID (diff)
From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Rafael David Tinoco <rafael.tinoco@linaro.org>
Cc: linux-kselftest@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
shuah@kernel.org, adobriyan@gmail.com
Subject: Re: [PATCH] proc: fix proc-self-map-files selftest for arm
Date: Thu, 11 Oct 2018 22:42:10 +0300 [thread overview]
Message-ID: <20181011194210.GD2401@uranus.lan> (raw)
In-Reply-To: <20181011184359.15627-1-rafael.tinoco@linaro.org>
On Thu, Oct 11, 2018 at 03:43:59PM -0300, Rafael David Tinoco wrote:
> MAP_FIXED is important for this test but, unfortunately, lowest virtual
> address for user space mapping on arm is (PAGE_SIZE * 2) and NULL hint
> does not seem to guarantee that when MAP_FIXED is given. This patch sets
> the virtual address that will hold the mapping for the test, fixing the
> issue.
>
> Link: https://bugs.linaro.org/show_bug.cgi?id=3782
> Signed-off-by: Rafael David Tinoco <rafael.tinoco@linaro.org>
> ---
> tools/testing/selftests/proc/proc-self-map-files-002.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/proc/proc-self-map-files-002.c b/tools/testing/selftests/proc/proc-self-map-files-002.c
> index 6f1f4a6e1ecb..0a47eaca732a 100644
> --- a/tools/testing/selftests/proc/proc-self-map-files-002.c
> +++ b/tools/testing/selftests/proc/proc-self-map-files-002.c
> @@ -55,7 +55,9 @@ int main(void)
> if (fd == -1)
> return 1;
>
> - p = mmap(NULL, PAGE_SIZE, PROT_NONE, MAP_PRIVATE|MAP_FILE|MAP_FIXED, fd, 0);
> + p = mmap((void *) (2 * PAGE_SIZE), PAGE_SIZE, PROT_NONE,
> + MAP_PRIVATE|MAP_FILE|MAP_FIXED, fd, 0);
> +
> if (p == MAP_FAILED) {
> if (errno == EPERM)
> return 2;
As far as I remember nil virtual address has been there only to be sure the
vma allocated won't be merged with another vmas. Fore sure most of x86
standart application won't be using 8K address as well, so should do the
trick I think.
(Strictlly speaking the test should be rather parsing own maps first and
find unused address instead but whatever :)
Reviewed-by: Cyrill Gorcunov <gorcunov@gmail.com>
next prev parent reply other threads:[~2018-10-11 19:42 UTC|newest]
Thread overview: 66+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-11 18:43 [PATCH] proc: fix proc-self-map-files selftest for arm rafael.tinoco
2018-10-11 18:43 ` Rafael David Tinoco
2018-10-11 18:43 ` Rafael David Tinoco
2018-10-11 19:42 ` gorcunov [this message]
2018-10-11 19:42 ` Cyrill Gorcunov
2018-10-11 19:42 ` Cyrill Gorcunov
2018-10-11 20:56 ` adobriyan
2018-10-11 20:56 ` Alexey Dobriyan
2018-10-11 20:56 ` Alexey Dobriyan
2018-10-11 21:02 ` gorcunov
2018-10-11 21:02 ` Cyrill Gorcunov
2018-10-11 21:02 ` Cyrill Gorcunov
2018-10-11 21:30 ` adobriyan
2018-10-11 21:30 ` Alexey Dobriyan
2018-10-11 21:30 ` Alexey Dobriyan
2018-10-11 22:00 ` gorcunov
2018-10-11 22:00 ` Cyrill Gorcunov
2018-10-11 22:00 ` Cyrill Gorcunov
2018-10-15 16:55 ` rafael.tinoco
2018-10-15 16:55 ` Rafael David Tinoco
2018-10-15 16:55 ` Rafael David Tinoco
2018-10-15 17:21 ` gorcunov
2018-10-15 17:21 ` Cyrill Gorcunov
2018-10-15 17:21 ` Cyrill Gorcunov
2018-11-08 10:41 ` rafael.tinoco
2018-11-08 10:41 ` Rafael David Tinoco
2018-11-08 10:41 ` Rafael David Tinoco
2018-11-08 11:11 ` gorcunov
2018-11-08 11:11 ` Cyrill Gorcunov
2018-11-08 11:11 ` Cyrill Gorcunov
2018-11-09 11:30 ` [PATCH] proc: fix and merge proc-self-map-file tests rafael.tinoco
2018-11-09 11:30 ` Rafael David Tinoco
2018-11-09 11:30 ` Rafael David Tinoco
2018-11-09 11:41 ` gorcunov
2018-11-09 11:41 ` Cyrill Gorcunov
2018-11-09 11:41 ` Cyrill Gorcunov
2018-11-09 11:45 ` rafael.tinoco
2018-11-09 11:45 ` Rafael David Tinoco
2018-11-09 11:45 ` Rafael David Tinoco
2018-11-09 11:48 ` gorcunov
2018-11-09 11:48 ` Cyrill Gorcunov
2018-11-09 11:48 ` Cyrill Gorcunov
2018-11-09 12:01 ` rafael.tinoco
2018-11-09 12:01 ` Rafael David Tinoco
2018-11-09 12:01 ` Rafael David Tinoco
2018-11-09 18:04 ` gorcunov
2018-11-09 18:04 ` Cyrill Gorcunov
2018-11-09 18:04 ` Cyrill Gorcunov
2018-11-09 18:48 ` rafael.tinoco
2018-11-09 18:48 ` Rafael David Tinoco
2018-11-09 18:48 ` Rafael David Tinoco
2018-11-09 19:39 ` gorcunov
2018-11-09 19:39 ` Cyrill Gorcunov
2018-11-09 19:39 ` Cyrill Gorcunov
2018-11-10 17:47 ` adobriyan
2018-11-10 17:47 ` Alexey Dobriyan
2018-11-10 17:47 ` Alexey Dobriyan
2018-11-10 17:56 ` rafael.tinoco
2018-11-10 17:56 ` Rafael David Tinoco
2018-11-10 17:56 ` Rafael David Tinoco
2018-11-10 18:49 ` adobriyan
2018-11-10 18:49 ` Alexey Dobriyan
2018-11-10 18:49 ` Alexey Dobriyan
2018-11-11 2:50 ` rafael.tinoco
2018-11-11 2:50 ` Rafael David Tinoco
2018-11-11 2:50 ` Rafael David Tinoco
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=20181011194210.GD2401@uranus.lan \
--to=unknown@example.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.