Conform the layout, informational and status messages to TAP. No
functional change is intended other than the layout of output messages.
Minor cleanups have also been included.
Signed-off-by: Muhammad Usama Anjum
---
tools/testing/selftests/mm/map_populate.c | 37 ++-
1 file
Conform the layout, informational and status messages to TAP. No
functional change is intended other than the layout of output messages.
Signed-off-by: Muhammad Usama Anjum
---
.../testing/selftests/mm/mlock-random-test.c | 136 +++---
1 file changed, 54 insertions(+), 82 deletions
Conform the layout, informational and status messages to TAP. No
functional change is intended other than the layout of output messages.
I've done some cleanups as well.
Signed-off-by: Muhammad Usama Anjum
---
tools/testing/selftests/mm/mlock2-tests.c | 282 +-
tools/te
Conform the layout, informational and status messages to TAP. No
functional change is intended other than the layout of output messages.
Signed-off-by: Muhammad Usama Anjum
---
tools/testing/selftests/mm/mrelease_test.c | 80 +-
1 file changed, 33 insertions(+), 47 deletions
Conform the layout, informational and status messages to TAP. No
functional change is intended other than the layout of output messages.
Signed-off-by: Muhammad Usama Anjum
---
tools/testing/selftests/mm/mremap_dontunmap.c | 32 ---
1 file changed, 20 insertions(+), 12 deletions
Conform the layout, informational and status messages to TAP. No
functional change is intended other than the layout of output messages.
Signed-off-by: Muhammad Usama Anjum
---
.../selftests/mm/split_huge_page_test.c | 161 --
1 file changed, 69 insertions(+), 92 deletions
Conform the layout, informational and status messages to TAP. No
functional change is intended other than the layout of output messages.
Signed-off-by: Muhammad Usama Anjum
---
tools/testing/selftests/mm/khugepaged.c | 3 +-
tools/testing/selftests/mm/thp_settings.c | 123
s may not have 1GB hugepage free. So skip 1GB for testing in
this test instead of failing the entire test.
Signed-off-by: Muhammad Usama Anjum
---
tools/testing/selftests/mm/thuge-gen.c | 147 +
1 file changed, 75 insertions(+), 72 deletions(-)
diff --git a/tools/te
Conform the layout, informational and status messages to TAP. No
functional change is intended other than the layout of output messages.
Signed-off-by: Muhammad Usama Anjum
---
tools/testing/selftests/mm/transhuge-stress.c | 36 +++
tools/testing/selftests/mm/vm_util.c
Conform the layout, informational and status messages to TAP. No
functional change is intended other than the layout of output messages.
Signed-off-by: Muhammad Usama Anjum
---
.../selftests/mm/virtual_address_range.c | 44 +--
1 file changed, 22 insertions(+), 22 deletions
The mmap() respects rlimit only for normal users. This test should be
run as normal user, without root privileges.
Fixes: b6221771d468 ("selftests/mm: run_vmtests: remove sudo and conform to
tap")
Signed-off-by: Muhammad Usama Anjum
---
tools/testing/selftests/mm/on-fault-limit.c | 6
On 2/1/24 5:04 PM, Ryan Roberts wrote:
> On 25/01/2024 15:46, Muhammad Usama Anjum wrote:
>> Remove sudo as some test running environments may not have sudo
>> available. Instead skip the test if root privileges aren't available in
>> the test.
>>
>&g
On 2/1/24 5:11 PM, Ryan Roberts wrote:
> On 25/01/2024 15:46, Muhammad Usama Anjum wrote:
>> Add missing tests to run_vmtests.sh. The mm kselftests are run through
>> run_vmtests.sh. If a test isn't present in this script, it'll not run
>> with run_tests or `mak
Please disregard this patch. I'll send another patch to fix another thing.
On 2/1/24 12:13 PM, Muhammad Usama Anjum wrote:
> The mmap() respects rlimit only for normal users. This test should be
> run as normal user, without root privileges.
>
> Fixes: b6221771d468 ("sel
1d468 ("selftests/mm: run_vmtests: remove sudo and conform to
tap")
Signed-off-by: Muhammad Usama Anjum
---
Please fold this patch in the Fixes patch if needed.
---
tools/testing/selftests/mm/on-fault-limit.c | 6 +++---
tools/testing/selftests/mm/run_vmtests.sh | 7 ++-
2 files change
Use correct -d flag as mentioned in comments for destructive tests.
Rename variable and update comment for some clarification.
Fixes: cc7b9955344c ("selftests/mm: run_vmtests.sh: add missing tests")
Signed-off-by: Muhammad Usama Anjum
---
Please fold this patch in the Fixes patch
Changes since v1:
- Rebased the series on top of next-20240202
Muhammad Usama Anjum (12):
selftests/mm: map_fixed_noreplace: conform test to TAP format output
selftests/mm: map_hugetlb: conform test to TAP format output
selftests/mm: map_populate: conform test to TAP format output
Conform the layout, informational and status messages to TAP. No
functional change is intended other than the layout of output messages.
While at it, convert commenting style from // to /**/.
Signed-off-by: Muhammad Usama Anjum
---
.../selftests/mm/map_fixed_noreplace.c| 96
Conform the layout, informational and status messages to TAP. No
functional change is intended other than the layout of output messages.
Signed-off-by: Muhammad Usama Anjum
---
tools/testing/selftests/mm/map_hugetlb.c | 42 +++-
1 file changed, 20 insertions(+), 22 deletions
Conform the layout, informational and status messages to TAP. No
functional change is intended other than the layout of output messages.
Minor cleanups have also been included.
Signed-off-by: Muhammad Usama Anjum
---
tools/testing/selftests/mm/map_populate.c | 37 ++-
1 file
Conform the layout, informational and status messages to TAP. No
functional change is intended other than the layout of output messages.
Signed-off-by: Muhammad Usama Anjum
---
.../testing/selftests/mm/mlock-random-test.c | 136 +++---
1 file changed, 54 insertions(+), 82 deletions
Conform the layout, informational and status messages to TAP. No
functional change is intended other than the layout of output messages.
I've done some cleanups as well.
Signed-off-by: Muhammad Usama Anjum
---
tools/testing/selftests/mm/mlock2-tests.c | 282 +-
tools/te
Conform the layout, informational and status messages to TAP. No
functional change is intended other than the layout of output messages.
Signed-off-by: Muhammad Usama Anjum
---
tools/testing/selftests/mm/mrelease_test.c | 80 +-
1 file changed, 33 insertions(+), 47 deletions
Conform the layout, informational and status messages to TAP. No
functional change is intended other than the layout of output messages.
Signed-off-by: Muhammad Usama Anjum
---
tools/testing/selftests/mm/mremap_dontunmap.c | 32 ---
1 file changed, 20 insertions(+), 12 deletions
Conform the layout, informational and status messages to TAP. No
functional change is intended other than the layout of output messages.
Signed-off-by: Muhammad Usama Anjum
---
.../selftests/mm/split_huge_page_test.c | 161 --
1 file changed, 69 insertions(+), 92 deletions
Conform the layout, informational and status messages to TAP. No
functional change is intended other than the layout of output messages.
Signed-off-by: Muhammad Usama Anjum
---
tools/testing/selftests/mm/khugepaged.c | 3 +-
tools/testing/selftests/mm/thp_settings.c | 123
s may not have 1GB hugepage free. So skip 1GB for testing in
this test instead of failing the entire test.
Signed-off-by: Muhammad Usama Anjum
---
tools/testing/selftests/mm/thuge-gen.c | 147 +
1 file changed, 75 insertions(+), 72 deletions(-)
diff --git a/tools/te
Conform the layout, informational and status messages to TAP. No
functional change is intended other than the layout of output messages.
Signed-off-by: Muhammad Usama Anjum
---
tools/testing/selftests/mm/transhuge-stress.c | 36 +++
tools/testing/selftests/mm/vm_util.c
Conform the layout, informational and status messages to TAP. No
functional change is intended other than the layout of output messages.
Signed-off-by: Muhammad Usama Anjum
---
.../selftests/mm/virtual_address_range.c | 44 +--
1 file changed, 22 insertions(+), 22 deletions
On 2/14/24 10:19 PM, Ryan Roberts wrote:
> On 02/02/2024 11:31, Muhammad Usama Anjum wrote:
>> Conform the layout, informational and status messages to TAP. No
>> functional change is intended other than the layout of output messages.
>>
>> Signed-off-by: Muhammad Us
records out
32768 bytes (33 kB, 32 KiB) copied, 0.000856684 s, 38.2 MB/s
dd: failed to open '/dev/full': Operation not permitted
dd: failed to open '/dev/random': Operation not permitted
#365 test_dev_cgroup:OK
Summary: 1/0 PASSED, 0 SKIPPED, 0 FAILED
Signed-of
Thank you for review. I'll fix.
On 2/16/24 10:25 PM, Daniel Borkmann wrote:
> Hi Muhammad,
>
> Small nit, pls use $subj: [PATCH bpf-next]
Sure, I'll update.
>
> On 2/15/24 1:01 PM, Muhammad Usama Anjum wrote:
>> Move test_dev_cgroup to prog_tests to be
AILED
Signed-off-by: Muhammad Usama Anjum
---
I've tested the patch with vmtest.sh on bpf-next/for-next and linux
next. It is passing on both. Not sure why it was failed on BPFCI.
Test run with vmtest.h:
sudo LDLIBS=-static PKG_CONFIG='pkg-config --static' ./vmtest.sh ./test_progs
-t de
On 2/21/24 2:22 PM, Muhammad Usama Anjum wrote:
> Move test_dev_cgroup.c to prog_tests/dev_cgroup.c to be able to run it
> with test_progs. Replace dev_cgroup.bpf.o with skel header file,
> dev_cgroup.skel.h and load program from it accourdingly.
>
> ./test_progs -t test_dev_c
defconfig), CONFIG_IOMMUFD_TEST doesn't get enabled.
Fixes: 57f0988706fe ("iommufd: Add a selftest")
Signed-off-by: Muhammad Usama Anjum
---
tools/testing/selftests/iommu/config | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/iomm
Conform the layout, informational and status messages to TAP. No
functional change is intended other than the layout of output messages.
Signed-off-by: Muhammad Usama Anjum
---
.../selftests/dmabuf-heaps/dmabuf-heap.c | 194 +++---
1 file changed, 77 insertions(+), 117
The config fragment enlists all the config options needed for the test.
This config is merged into the kernel's config on which this test is
run.
Signed-off-by: Muhammad Usama Anjum
---
tools/testing/selftests/dmabuf-heaps/config | 4
1 file changed, 4 insertions(+)
create mode 1
On 2/27/24 6:52 AM, T.J. Mercier wrote:
> On Sun, Feb 25, 2024 at 11:59 PM Muhammad Usama Anjum
> wrote:
>>
>> Conform the layout, informational and status messages to TAP. No
>> functional change is intended other than the layout of output messages.
>>
>>
Conform the layout, informational and status messages to TAP. No
functional change is intended other than the layout of output messages.
Signed-off-by: Muhammad Usama Anjum
---
Changes since v1:
- Update some more error handling code
---
.../selftests/dmabuf-heaps/dmabuf-heap.c | 217
The config fragment enlists all the config options needed for the test.
This config is merged into the kernel's config on which this test is
run.
Reviewed-by: T.J. Mercier
Signed-off-by: Muhammad Usama Anjum
---
Changes since v1:
- Add reviewed-by tag
---
tools/testing/selftests/dmabuf-
On 2/27/24 10:18 PM, T.J. Mercier wrote:
> On Tue, Feb 27, 2024 at 4:21 AM Muhammad Usama Anjum
> wrote:
>>
>> Conform the layout, informational and status messages to TAP. No
>> functional change is intended other than the layout of output messages.
>>
>>
On 2/21/24 7:06 PM, Muhammad Usama Anjum wrote:
> On 2/21/24 2:22 PM, Muhammad Usama Anjum wrote:
>> Move test_dev_cgroup.c to prog_tests/dev_cgroup.c to be able to run it
>> with test_progs. Replace dev_cgroup.bpf.o with skel header file,
>> dev_cgroup.skel.h and load program
On 2/28/24 11:51 PM, T.J. Mercier wrote:
> On Tue, Feb 27, 2024 at 4:21 AM Muhammad Usama Anjum
> wrote:
>
> ..
>
>> +static int numer_of_heaps(void)
>> +{
>> + DIR *d = opendir(DEVPATH);
>> + struct dirent *dir;
>> + int heaps
On 2/28/24 11:47 PM, T.J. Mercier wrote:
> On Wed, Feb 28, 2024 at 3:46 AM Muhammad Usama Anjum
> wrote:
>>
>> On 2/27/24 10:18 PM, T.J. Mercier wrote:
>>> On Tue, Feb 27, 2024 at 4:21 AM Muhammad Usama Anjum
>>> wrote:
>>>>
>>>> Conf
Conform the layout, informational and status messages to TAP. No
functional change is intended other than the layout of output messages.
Signed-off-by: Muhammad Usama Anjum
---
Changes since v2:
- Minor improvements in test_alloc_zeroed() results
Changes since v1:
- Update some more error
The config fragment enlists all the config options needed for the test.
This config is merged into the kernel's config on which this test is
run.
Reviewed-by: T.J. Mercier
Signed-off-by: Muhammad Usama Anjum
---
Changes since v1:
- Add reviewed-by tag
---
tools/testing/selftests/dmabuf-
On 2/29/24 10:37 PM, T.J. Mercier wrote:
> On Thu, Feb 29, 2024 at 1:21 AM Muhammad Usama Anjum
> wrote:
>>
>> Conform the layout, informational and status messages to TAP. No
>> functional change is intended other than the layout of output messages.
>>
>>
Conform the layout, informational and status messages to TAP. No
functional change is intended other than the layout of output messages.
Signed-off-by: Muhammad Usama Anjum
---
Chanages since v3:
- abort test-case instead of exiting if heap/mem allocation fails
- Correct test_alloc_zeroed() test
The config fragment enlists all the config options needed for the test.
This config is merged into the kernel's config on which this test is
run.
Reviewed-by: T.J. Mercier
Signed-off-by: Muhammad Usama Anjum
---
Changes since v1:
- Add reviewed-by tag
---
tools/testing/selftests/dmabuf-
On 2/29/24 10:36 PM, T.J. Mercier wrote:
> On Thu, Feb 29, 2024 at 1:14 AM Muhammad Usama Anjum
> wrote:
>>
>> On 2/28/24 11:47 PM, T.J. Mercier wrote:
>>> On Wed, Feb 28, 2024 at 3:46 AM Muhammad Usama Anjum
>>> wrote:
>>>>
>>>> O
quot; ]; then
> printf "Not enough huge pages available (%d < %d)\n" \
> "$freepgs" "$needpgs"
> - exit 1
> fi
> else
> echo "no hugetlbfs support in kernel?"
--
BR,
Muhammad Usama Anjum
The following line is missing from the test's execution. Add it to make
it fully TAP conformant:
# Totals: pass:27 fail:0 xfail:0 xpass:0 skip:0 error:0
Signed-off-by: Muhammad Usama Anjum
---
tools/testing/selftests/exec/binfmt_script.py | 10 +-
1 file changed, 9 insertions(
Conform the layout, informational and status messages to TAP. No
functional change is intended other than the layout of output messages.
Signed-off-by: Muhammad Usama Anjum
---
tools/testing/selftests/exec/load_address.c | 34 +
1 file changed, 15 insertions(+), 19 deletions
Conform the layout, informational and status messages to TAP. No
functional change is intended other than the layout of output messages.
While at it, do minor cleanups like move the declarations of the variables
on top of the function.
Signed-off-by: Muhammad Usama Anjum
---
.../testing
On 3/5/24 12:08 AM, Nico Pache wrote:
> On Fri, Mar 1, 2024 at 2:35 AM Muhammad Usama Anjum
> wrote:
>>
>> On 3/1/24 12:33 PM, Nico Pache wrote:
>>> On systems that have large core counts and large page sizes, but limited
>>> memory, the userfaultfd te
Conform the layout, informational and status messages to TAP. No
functional change is intended other than the layout of output messages.
Reviewed-by: T.J. Mercier
Signed-off-by: Muhammad Usama Anjum
---
Changes since v4:
- close fds correctly with code changes added in v3
Chanages since v3
The config fragment enlists all the config options needed for the test.
This config is merged into the kernel's config on which this test is
run.
Reviewed-by: T.J. Mercier
Signed-off-by: Muhammad Usama Anjum
---
Changes since v1:
- Add reviewed-by tag
---
tools/testing/selftests/dmabuf-
On 3/5/24 1:58 AM, Kees Cook wrote:
> On Mon, Mar 04, 2024 at 08:59:24PM +0500, Muhammad Usama Anjum wrote:
>> Conform the layout, informational and status messages to TAP. No
>> functional change is intended other than the layout of output messages.
>>
>> Signed-o
..
# child 3493092 exited with 1 not 99 nor 99
not ok 49 Check success of execveat(6,
'home/usama/repos/ker...', 0)...
# Invoke copy of 'script' via filename of length 4094:
ok 50 Check success of execveat(21, '', 4096)...
# execveat() failed, rc=-1 errno=2 (No such file or directory)
not ok 51 Check success of execveat(6,
'home/usama/repos/ker...', 0)...
# child 3493094 exited with 1 not 127 nor 126
not ok 51 Check success of execveat(6,
'home/usama/repos/ker...', 0)...
2 tests failed
# Totals: pass:49 fail:2 xfail:0 xpass:0 skip:0 error:0
--
BR,
Muhammad Usama Anjum
On 3/6/24 2:00 AM, Kees Cook wrote:
> On Tue, Mar 05, 2024 at 07:20:27PM +0500, Muhammad Usama Anjum wrote:
>> Hello,
>>
>> I've been running execveat (execveat.c) locally on v6.1 and next-20240228.
>> It has flaky test case. There are some test cases which fail c
Conform the layout, informational and status messages to TAP. No
functional change is intended other than the layout of output messages.
Signed-off-by: Muhammad Usama Anjum
---
tools/testing/selftests/x86/vdso_restorer.c | 29 +
1 file changed, 12 insertions(+), 17 deletions
cpuid: invalid tile data size/offset: 0/0
ok 42 selftests: x86: amx_64 # SKIP
# timeout set to 45
# selftests: x86: lam_64
# # Unsupported LAM feature!
ok 43 selftests: x86: lam_64 # SKIP
...
Signed-off-by: Muhammad Usama Anjum
---
I'm not sure if xstate values should be correct on a
On 3/9/24 6:06 AM, Chang S. Bae wrote:
> On 3/7/2024 10:37 AM, Muhammad Usama Anjum wrote:
>>
>> diff --git a/tools/testing/selftests/x86/amx.c
>> b/tools/testing/selftests/x86/amx.c
>> index d884fd69dd510..5d1ca0bbaaae7 100644
>> --- a/tools/testing/selftests
On 3/8/24 1:39 AM, Kees Cook wrote:
> On Thu, Mar 07, 2024 at 02:22:27PM +0500, Muhammad Usama Anjum wrote:
>> I've tested this patch. Still getting same failures.
>
> Okay, thanks for testing!
>
> What environment are you testing under? It would seem like some unexpec
Soft reminder!
On 3/4/24 8:59 PM, Muhammad Usama Anjum wrote:
> The following line is missing from the test's execution. Add it to make
> it fully TAP conformant:
> # Totals: pass:27 fail:0 xfail:0 xpass:0 skip:0 error:0
>
> Signed-off-by: Muhammad Usama Anjum
> ---
>
On 3/11/24 10:39 PM, Chang S. Bae wrote:
> On 3/11/2024 10:02 AM, Muhammad Usama Anjum wrote:
>> On 3/9/24 6:06 AM, Chang S. Bae wrote:
>>> On 3/7/2024 10:37 AM, Muhammad Usama Anjum wrote:
>>>
>>>> -static void check_cpuid_xtiledata(void)
>
Hi Chang,
On 3/12/24 9:07 PM, Chang S. Bae wrote:
> On 3/12/2024 2:26 AM, Muhammad Usama Anjum wrote:
>>
>> How can we check if AMX is available or not?
>
> After a successful check_cpuid_xsave(), examining CPUID(eax=0xd, ecx=0)
> EDX: EAX, which reports the suppor
On 3/13/24 7:58 PM, Joey Gouly wrote:
> Hi Muhammad,
>
> On Thu, Jan 25, 2024 at 08:46:07PM +0500, Muhammad Usama Anjum wrote:
>> Save and restore nr_hugepages before changing it during the test. A test
>> should not change system wide settings.
>>
>> Fixes: 5
On 3/14/24 10:00 AM, Dev Jain wrote:
>
> On 2/2/24 17:01, Muhammad Usama Anjum wrote:
>> Conform the layout, informational and status messages to TAP. No
>> functional change is intended other than the layout of output messages.
>>
>> Signed-off-by: Muhammad Usama An
On 3/14/24 8:05 AM, Kees Cook wrote:
> On Mon, Mar 11, 2024 at 10:08:36PM +0500, Muhammad Usama Anjum wrote:
>> On 3/8/24 1:39 AM, Kees Cook wrote:
>>> On Thu, Mar 07, 2024 at 02:22:27PM +0500, Muhammad Usama Anjum wrote:
>>>> I've tested this patch. Still
; Cc: Mark Brown
> Cc: Muhammad Usama Anjum
> Cc: linux...@kvack.org
> Cc: linux-kselftest@vger.kernel.org
Reviewed-by: Muhammad Usama Anjum
> ---
> tools/testing/selftests/exec/execveat.c | 12 +++-
> 1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --
ts/mm: protection_keys: save/restore nr_hugepages
settings")
Tested-by: Joey Gouly
Signed-off-by: Muhammad Usama Anjum
---
tools/testing/selftests/mm/protection_keys.c | 6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/mm/protection_keys.c
b/too
Conform the layout, informational and status messages to TAP. No
functional change is intended other than the layout of output messages.
Without using TAP messages, the passed/failed/skip test names cannot be
found.
Signed-off-by: Muhammad Usama Anjum
---
tools/testing/selftests/x86
Conform the layout, informational and status messages to TAP. No
functional change is intended other than the layout of output messages.
Signed-off-by: Muhammad Usama Anjum
---
.../testing/selftests/x86/test_mremap_vdso.c | 43 +--
1 file changed, 21 insertions(+), 22 deletions
cpuid: invalid tile data size/offset: 0/0
ok 42 selftests: x86: amx_64 # SKIP
# timeout set to 45
# selftests: x86: lam_64
# # Unsupported LAM feature!
ok 43 selftests: x86: lam_64 # SKIP
...
Cc: Chang S. Bae
Acked-by: Kirill A. Shutemov
Reviewed-by: Binbin Wu
Signed-off-by: Muhammad
, do some formatting changes.
>
> Signed-off-by: Dev Jain
Reviewed-by: Muhammad Usama Anjum
> ---
> tools/testing/selftests/mm/virtual_address_range.c | 12 +---
> 1 file changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/tools/testing/selftests/mm/virt
Soft reminder
On 3/5/24 11:08 AM, Muhammad Usama Anjum wrote:
> Conform the layout, informational and status messages to TAP. No
> functional change is intended other than the layout of output messages.
>
> Reviewed-by: T.J. Mercier
> Signed-off-by: Muhammad Usama Anjum
> -
Soft Reminder
On 3/14/24 3:32 PM, Muhammad Usama Anjum wrote:
> Conform the layout, informational and status messages to TAP. No
> functional change is intended other than the layout of output messages.
> Without using TAP messages, the passed/failed/skip test names cannot be
> found.
Add FAULT_INJECTION_DEBUG_FS and FAILSLAB configurations which are
needed by iommufd_fail_nth test.
Signed-off-by: Muhammad Usama Anjum
---
While building and running these tests on x86, defconfig had these
configs enabled. But ARM64's defconfig doesn't enable these configs.
Hence
On 3/25/24 2:00 PM, Muhammad Usama Anjum wrote:
> Add FAULT_INJECTION_DEBUG_FS and FAILSLAB configurations which are
> needed by iommufd_fail_nth test.
>
> Signed-off-by: Muhammad Usama Anjum
> ---
> While building and running these tests on x86, defconfig had these
> confi
Soft reminder
On 3/7/24 11:37 PM, Muhammad Usama Anjum wrote:
> Conform the layout, informational and status messages to TAP. No
> functional change is intended other than the layout of output messages.
>
> Signed-off-by: Muhammad Usama Anjum
> ---
> tools/testing/selftests/x
ut that
test_util.h includes kselftest.h.
>
> Signed-off-by: Thomas Huth
Reviewed-by: Muhammad Usama Anjum
> ---
> NB: This patch does not use the interface from kselftest_harness.h
> since it is not very suitable for the for-loop in this patch.
>
> tools
64:
# Totals: pass:166 fail:14 xfail:0 xpass:0 skip:0 error:0
The log files are attached.
On 3/25/24 2:00 PM, Muhammad Usama Anjum wrote:
> Add FAULT_INJECTION_DEBUG_FS and FAILSLAB configurations which are
> needed by iommufd_fail_nth test.
>
> Signed-off-by: Muhammad Usama Anjum
> --
On 3/26/24 8:03 PM, Jason Gunthorpe wrote:
> On Tue, Mar 26, 2024 at 06:09:34PM +0500, Muhammad Usama Anjum wrote:
>> Even after applying this config patch and following snippet (which doesn't
>> terminate the program if mmap doesn't allocate exactly as the hint), I&
pport is present or not. In the
kernels where amx isn't present, arch_prctl returns -EINVAL. Hence it is
backward compatible.
Reviewed-by: Chang S. Bae
Acked-by: Kirill A. Shutemov
Reviewed-by: Binbin Wu
Signed-off-by: Muhammad Usama Anjum
---
Changes since v2:
- Update the changelog
Cha
Hi Shuah,
Thanks for reviewing.
On 3/27/24 2:05 AM, Shuah Khan wrote:
> On 3/4/24 23:08, Muhammad Usama Anjum wrote:
>> Conform the layout, informational and status messages to TAP. No
>> functional change is intended other than the layout of output messages.
>>
>>
Conform the layout, informational and status messages to TAP. No
functional change is intended other than the layout of output messages.
Improve the TAP messages as well.
Reviewed-by: T.J. Mercier
Signed-off-by: Muhammad Usama Anjum
---
Changes since v5:
- Make the TAP messages more by adding
On 3/27/24 1:00 AM, Shuah Khan wrote:
> On 3/14/24 04:32, Muhammad Usama Anjum wrote:
>> Conform the layout, informational and status messages to TAP. No
>> functional change is intended other than the layout of output messages.
>> Without using TAP messages, the passed/f
On 3/27/24 11:09 PM, Joao Martins wrote:
> On 27/03/2024 17:49, Muhammad Usama Anjum wrote:
>> On 3/27/24 7:59 PM, Joao Martins wrote:
>>> On 27/03/2024 11:49, Jason Gunthorpe wrote:
>>>> On Wed, Mar 27, 2024 at 03:14:25PM +0500, Muhammad Usama Anjum wrote:
&
this patch, we are just moving functions around
without any changes.
With and without this patch, the output of this patch is same.
Signed-off-by: Muhammad Usama Anjum
---
tools/testing/selftests/x86/test_vsyscall.c | 176 +---
1 file changed, 83 insertions(+), 93 deletions
ff-by: Muhammad Usama Anjum
---
tools/testing/selftests/x86/test_vsyscall.c | 356 +---
1 file changed, 168 insertions(+), 188 deletions(-)
diff --git a/tools/testing/selftests/x86/test_vsyscall.c
b/tools/testing/selftests/x86/test_vsyscall.c
index c78b0648aa524..d4c8e8d79d389 1
Conform the layout, informational and status messages to TAP. No
functional change is intended other than the layout of output messages.
Signed-off-by: Muhammad Usama Anjum
---
.../testing/selftests/x86/test_mremap_vdso.c | 43 +--
1 file changed, 21 insertions(+), 22 deletions
On 3/27/24 11:20 PM, Jason Gunthorpe wrote:
> On Wed, Mar 27, 2024 at 06:09:37PM +, Joao Martins wrote:
>> On 27/03/2024 17:49, Muhammad Usama Anjum wrote:
>>> On 3/27/24 7:59 PM, Joao Martins wrote:
>>>> On 27/03/2024 11:49, Jason Gunthorpe wrote:
>>&g
> with a cross-compiler. So it's just tested on x86 64-bit so far.
>
> [1]
> https://lore.kernel.org/all/783a4178-1dec-4e30-989a-5174b8176...@redhat.com/
> [2]
> https://lore.kernel.org/lkml/20231103121652.ga6...@noisy.programming.kicks-ass.net/
>
> Cc: David Hilden
u think this Fixes tag is needed? This refers to a patch which is
just moving code. It doesn't seem to have any thing related to strings.h.
Other than that, LGTM
Reviewed-by: Muhammad Usama Anjum
> Signed-off-by: Edward Liaw
> ---
> tools/testing/selftests/mm/vm_util.h | 2 +-
gt; which should have been:
>
> # Success
> ok 1 selftests: net: reuseaddr_conflict
>
> Fixes: 422d8dc6fd3a ("selftest: add a reuseaddr test")
> Signed-off-by: Jakub Kicinski
Reviewed-by: Muhammad Usama Anjum
> ---
> Low risk and seems worth backporting to stab
erval_all_nodes(PAGETYPE_FILE, 0);
> +
> + if (!values_close(ws_size_test - ws_size_ref, TEST_SIZE, 10)) {
> + fprintf(stderr,
> + "file working set size difference too large:
> actual=%ld, expected=%ld\n",
> + ws_size_test - ws_size_ref, TEST_SIZE);
> + goto cleanup;
> + }
> + }
> + ret = KSFT_PASS;
> +
> +cleanup:
> + if (pid > 0)
> + kill(pid, SIGKILL);
> + cleanup_file_workingset();
> + return ret;
> +}
> +
> +static int test_anon(void)
> +{
> + ssize_t ws_size_ref, ws_size_test;
> + pid_t pid = 0;
> + int ret = KSFT_FAIL, i;
> +
> + ws_size_ref = read_interval_all_nodes(PAGETYPE_ANON, 0);
> + if (ws_size_ref < 0)
> + goto cleanup;
> +
> + pid = clone_and_run(alloc_anon_workingset, (void *)TEST_SIZE);
> + if (pid < 0)
> + goto cleanup;
> +
> + sleep_ms(REFRESH_INTERVAL);
> + read_interval_all_nodes(PAGETYPE_ANON, 0);
> +
> + for (i = 0; i < 5; ++i) {
> + sleep_ms(REFRESH_INTERVAL);
> + ws_size_test = read_interval_all_nodes(PAGETYPE_ANON, 0);
> + if (ws_size_test < 0)
> + goto cleanup;
> +
> + if (!values_close(ws_size_test - ws_size_ref, TEST_SIZE, 10)) {
> + fprintf(stderr,
> + "anon working set size difference too large:
> actual=%ld, expected=%ld\n",
> + ws_size_test - ws_size_ref, TEST_SIZE);
> + /* goto cleanup; */
> + }
> + }
> + ret = KSFT_PASS;
> +
> +cleanup:
> + if (pid > 0)
> + kill(pid, SIGKILL);
> + return ret;
> +}
> +
> +
> +#define T(x) { x, #x }
> +struct workingset_test {
> + int (*fn)(void);
> + const char *name;
> +} tests[] = {
> + T(test_anon),
> + T(test_file),
> +};
> +#undef T
> +
> +int main(int argc, char **argv)
> +{
> + int ret = EXIT_SUCCESS, i, err;
> +
> + for (i = 0; i < ARRAY_SIZE(tests); i++) {
> + err = run_test(tests[i].fn);
> + switch (err) {
> + case KSFT_PASS:
> + ksft_test_result_pass("%s\n", tests[i].name);
> + break;
> + case KSFT_SKIP:
> + ksft_test_result_skip("%s\n", tests[i].name);
> + break;
> + default:
> + ret = EXIT_FAILURE;
> + ksft_test_result_fail("%s with error %d\n",
> + tests[i].name, err);
> + break;
> + }
> + }
> + return ret;
> +}
--
BR,
Muhammad Usama Anjum
ouldn't go beyond here */
> + }
> + /* send SIGUSR1 to child */
> + kill(pid, SIGUSR1);
> + wait(&child_status);
> +
> +out:
> + if (my_syscall5(__NR_prctl, PR_SET_SHADOW_STACK_STATUS, 0, 0, 0, 0)) {
> + printf("shadow stack disable prctl failed\n");
> + return false;
> + }
> +
> + return (WIFEXITED(child_status) &&
> + WEXITSTATUS(child_status) == 11);
> +}
> +
> +int execute_shadow_stack_tests(void)
> +{
> + int ret = 0;
> + unsigned long test_count = 0;
> + unsigned long shstk_status = 0;
> +
> + printf("Executing RISC-V shadow stack self tests\n");
> +
> + ret = my_syscall5(__NR_prctl, PR_GET_SHADOW_STACK_STATUS,
> &shstk_status, 0, 0, 0);
> +
> + if (ret != 0)
> + ksft_exit_skip("Get shadow stack status failed with %d\n", ret);
> +
> + /*
> + * If we are here that means get shadow stack status succeeded and
> + * thus shadow stack support is baked in the kernel.
> + */
> + while (test_count < ARRAY_SIZE(shstk_tests)) {
> + ksft_test_result((*shstk_tests[test_count].t_func)(test_count,
> NULL),
> + shstk_tests[test_count].name);
> + test_count++;
> + }
> +
> + return 0;
> +}
> +
> +#pragma GCC pop_options
> diff --git a/tools/testing/selftests/riscv/cfi/shadowstack.h
> b/tools/testing/selftests/riscv/cfi/shadowstack.h
> new file mode 100644
> index ..92cb0752238d
> --- /dev/null
> +++ b/tools/testing/selftests/riscv/cfi/shadowstack.h
> @@ -0,0 +1,39 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +
> +#ifndef SELFTEST_SHADOWSTACK_TEST_H
> +#define SELFTEST_SHADOWSTACK_TEST_H
> +#include
> +#include
> +
> +/*
> + * a cfi test returns true for success or false for fail
> + * takes a number for test number to index into array and void pointer.
> + */
> +typedef bool (*shstk_test_func)(unsigned long test_num, void *);
> +
> +struct shadow_stack_tests {
> + char *name;
> + shstk_test_func t_func;
> +};
> +
> +bool enable_disable_check(unsigned long test_num, void *ctx);
> +bool shadow_stack_fork_test(unsigned long test_num, void *ctx);
> +bool shadow_stack_map_test(unsigned long test_num, void *ctx);
> +bool shadow_stack_protection_test(unsigned long test_num, void *ctx);
> +bool shadow_stack_gup_tests(unsigned long test_num, void *ctx);
> +bool shadow_stack_signal_test(unsigned long test_num, void *ctx);
> +
> +static struct shadow_stack_tests shstk_tests[] = {
> + { "enable disable\n", enable_disable_check },
> + { "shstk fork test\n", shadow_stack_fork_test },
> + { "map shadow stack syscall\n", shadow_stack_map_test },
> + { "shadow stack gup tests\n", shadow_stack_gup_tests },
> + { "shadow stack signal tests\n", shadow_stack_signal_test},
> + { "memory protections of shadow stack memory\n",
> shadow_stack_protection_test }
> +};
> +
> +#define RISCV_SHADOW_STACK_TESTS ARRAY_SIZE(shstk_tests)
> +
> +int execute_shadow_stack_tests(void);
> +
> +#endif
--
BR,
Muhammad Usama Anjum
ompleted by the created thread.
> Used synchronization to ensure that created thread's start function has
> started before invoking fork.
>
> Signed-off-by: Lokesh Gidra
> [edliaw: Refactored to use atomic_bool]
> Signed-off-by: Edward Liaw
Reviewed-by: Muhammad Usama Anjum
+ ret = post_sem(sem, &count);
> + EXPECT_EQ(-1, ret);
> + EXPECT_EQ(EOVERFLOW, errno);
> + check_sem_state(sem, 0, 2);
> +
> + count = 2;
> + ret = post_sem(sem, &count);
> + EXPECT_EQ(0, ret);
> + EXPECT_EQ(0, count);
> + check_sem_state(sem, 2, 2);
> +
> + ret = wait_any(fd, 1, &sem, 123, &index);
> + EXPECT_EQ(0, ret);
> + ret = wait_any(fd, 1, &sem, 123, &index);
> + EXPECT_EQ(0, ret);
> +
> + count = 1;
> + ret = post_sem(sem, &count);
> + EXPECT_EQ(0, ret);
> + EXPECT_EQ(0, count);
> + check_sem_state(sem, 1, 2);
> +
> + count = ~0u;
> + ret = post_sem(sem, &count);
> + EXPECT_EQ(-1, ret);
> + EXPECT_EQ(EOVERFLOW, errno);
> + check_sem_state(sem, 1, 2);
> +
> + close(sem);
> +
> + close(fd);
> +}
> +
> +TEST_HARNESS_MAIN
--
BR,
Muhammad Usama Anjum
101 - 200 of 481 matches
Mail list logo