linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Muhammad Usama Anjum <Usama.Anjum@collabora.com>
To: Shuah Khan <skhan@linuxfoundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Shuah Khan <shuah@kernel.org>, John Hubbard <jhubbard@nvidia.com>,
	David Hildenbrand <david@redhat.com>
Cc: Usama.Anjum@collabora.com, kernel@collabora.com,
	linux-mm@kvack.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] kselftests: mm: Fix wrong __NR_userfaultfd value
Date: Mon, 16 Sep 2024 11:32:20 +0500	[thread overview]
Message-ID: <3cb9d266-4d4b-4031-8603-da7fd9e3ad47@collabora.com> (raw)
In-Reply-To: <a9ae7dc4-275d-43c3-bf4c-b0090cb6bb12@linuxfoundation.org>

On 9/12/24 8:44 PM, Shuah Khan wrote:
> On 9/12/24 04:31, Muhammad Usama Anjum wrote:
>> The value of __NR_userfaultfd was changed to 282 when
>> asm-generic/unistd.h was included. It makes the test to fail every time
>> as the correct number of this syscall on x86_64 is 323. Fix the header
>> to asm/unistd.h.
>>
> 
> "please elaborate every time" - I just built on my x86_64 and built
> just fine.
The build isn't broken.

> I am not saying this isn't a problem, it is good to
> understand why and how it is failing before making the change.
I mean to say that the test is failing at run time because the correct
userfaultfd syscall isn't being found with __NR_userfaultfd = 282.
_NR_userfaultfd's value depends on the header. When asm-generic/unistd.h
is included, its value (282) is wrong. I've tested on x86_64.

The fix is simple. Add the correct header which has _NR_userfaultfd = 323.

> 
>> Fixes: a5c6bc590094 ("selftests/mm: remove local __NR_* definitions")
>> Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
>> ---
>>   tools/testing/selftests/mm/pagemap_ioctl.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/tools/testing/selftests/mm/pagemap_ioctl.c
>> b/tools/testing/selftests/mm/pagemap_ioctl.c
>> index fc90af2a97b80..bcc73b4e805c6 100644
>> --- a/tools/testing/selftests/mm/pagemap_ioctl.c
>> +++ b/tools/testing/selftests/mm/pagemap_ioctl.c
>> @@ -15,7 +15,7 @@
>>   #include <sys/ioctl.h>
>>   #include <sys/stat.h>
>>   #include <math.h>
>> -#include <asm-generic/unistd.h>
>> +#include <asm/unistd.h>
>>   #include <pthread.h>
>>   #include <sys/resource.h>
>>   #include <assert.h>
> 
> Also please generate a series with these two patches with cover-letter.
> 
> thanks,
> -- Shuah

-- 
BR,
Muhammad Usama Anjum



  reply	other threads:[~2024-09-16  6:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-12 10:31 Muhammad Usama Anjum
2024-09-12 10:31 ` [PATCH 2/2] kselftests: mm: Fail the test if userfaultfd syscall isn't found Muhammad Usama Anjum
2024-09-12 16:10   ` Shuah Khan
2024-09-12 17:28     ` Shuah Khan
2024-09-16  6:33       ` Muhammad Usama Anjum
2024-09-12 15:44 ` [PATCH 1/2] kselftests: mm: Fix wrong __NR_userfaultfd value Shuah Khan
2024-09-16  6:32   ` Muhammad Usama Anjum [this message]
2024-09-17  1:56     ` Shuah Khan
2024-09-18  5:46       ` Muhammad Usama Anjum
2024-09-18  5:46         ` Muhammad Usama Anjum
2024-09-20 14:59         ` Shuah Khan
2024-09-23  5:35           ` Muhammad Usama Anjum
2024-09-23 16:02             ` Shuah Khan
2024-09-24  6:21               ` Muhammad Usama Anjum

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=3cb9d266-4d4b-4031-8603-da7fd9e3ad47@collabora.com \
    --to=usama.anjum@collabora.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=jhubbard@nvidia.com \
    --cc=kernel@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=shuah@kernel.org \
    --cc=skhan@linuxfoundation.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