[PATCH v2] selftests/mm: Add configs to fix testcase failure

2025-06-12 Thread Dev Jain
ses: https://lore.kernel.org/all/20250610103729.72440-1-aishwarya@arm.com/ Tested-by: Aishwarya TCV Tested-by : Donet Tom Reviewed-by: Lorenzo Stoakes Signed-off-by: Dev Jain --- v1->v2: - Add CONFIG_UPROBES (Mark Brown) - Add CONFIG_PROFILING (Lorenzo) tools/testing/selftests/mm/config | 3 +++ 1

Re: [PATCH] selftests/mm: Add CONFIG_FTRACE to config

2025-06-11 Thread Dev Jain
On 11/06/25 6:00 pm, Pedro Falcato wrote: On Wed, Jun 11, 2025 at 05:40:11PM +0530, Dev Jain wrote: If CONFIG_UPROBES is not set, a merge subtest fails: Failure log: 7151 12:46:54.627936 # # # RUN merge.handle_uprobe_upon_merged_vma ... 7152 12:46:54.639014 # # f /sys

Re: [PATCH] selftests/mm: Skip uprobe vma merge test if uprobes are not enabled

2025-06-11 Thread Dev Jain
ishwarya Closes: https://lore.kernel.org/linux-mm/20250610103729.72440-1-aishwarya@arm.com/ Signed-off-by: Pedro Falcato --- Reviewed-by: Dev Jain IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended r

Re: [PATCH] selftests/mm: Add CONFIG_FTRACE to config

2025-06-11 Thread Dev Jain
On 11/06/25 6:05 pm, Lorenzo Stoakes wrote: Thanks for this! On Wed, Jun 11, 2025 at 05:40:11PM +0530, Dev Jain wrote: If CONFIG_UPROBES is not set, a merge subtest fails: Failure log: 7151 12:46:54.627936 # # # RUN merge.handle_uprobe_upon_merged_vma ... 7152 12:46

Re: [PATCH] selftests/mm: Add CONFIG_FTRACE to config

2025-06-11 Thread Dev Jain
On 11/06/25 6:09 pm, Mark Brown wrote: On Wed, Jun 11, 2025 at 05:40:11PM +0530, Dev Jain wrote: If CONFIG_UPROBES is not set, a merge subtest fails: ... CONFIG_UPROBES is enabled by CONFIG_UPROBE_EVENTS, which gets enabled by CONFIG_FTRACE. Therefore add this config to selftests/mm

[PATCH] selftests/mm: Add CONFIG_FTRACE to config

2025-06-11 Thread Dev Jain
e kernel build. Fixes: efe99fabeb11b ("selftests/mm: add test about uprobe pte be orphan during vma merge") Reported-by: Aishwarya Closes: https://lore.kernel.org/all/20250610103729.72440-1-aishwarya@arm.com/ Signed-off-by: Dev Jain --- tools/testing/selftests/mm/config | 1 + 1 f

Re: [PATCH] selftests/mm: compaction_test: Support platform with huge mount of memory

2025-04-23 Thread Dev Jain
page number to self-adjustable number according to the real number of free memory. Fixes: bd67d5c15cc19 ("Test compaction of mlocked memory") Signed-off-by: Feng Tang Not sure if fixes tag is needed. Acked-by: Dev Jain --- tools/testing/selftests/mm/compaction_test.c | 19 +++

Re: [PATCH] selftests/mm: Restore default nr_hugepages value during cleanup in hugetlb_reparenting_test.sh

2025-04-15 Thread Dev Jain
On 15/04/25 12:28 pm, Anshuman Khandual wrote: On 4/10/25 15:37, Donet Tom wrote: During cleanup, the value of /proc/sys/vm/nr_hugepages is currently being set to 0. At the end of the test, if all tests pass, the original nr_hugepages value is restored. However, if any test fails, it remain

Re: [PATCH 2/2] kselftest/arm64: mte: Skip the hugetlb tests if MTE not supported on such mappings

2025-02-21 Thread Dev Jain
arm64: add hugetlb mte tests") Cc: Yang Shi Reported-by: Naresh Kamboju Signed-off-by: Catalin Marinas Reviewed-by: Dev Jain

Re: [PATCH v6 1/2] selftests: Rename sigaltstack to generic signal

2024-08-30 Thread Dev Jain
On 8/27/24 17:16, Dev Jain wrote: On 8/27/24 17:14, Shuah Khan wrote: On 8/22/24 06:14, Dev Jain wrote: Rename sigaltstack to generic signal directory, to allow adding more signal tests in the future. Sorry - I think I mentioned I don't like this test renamed. Why are you sending

[PATCH] kselftest/arm64: Fix build warnings for ptrace

2024-08-29 Thread Dev Jain
A "%s" is missing in ksft_exit_fail_msg(); instead, use the newly introduced ksft_exit_fail_perror(). Signed-off-by: Dev Jain --- tools/testing/selftests/arm64/abi/ptrace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/arm64/abi/p

[PATCH] selftests/mm: Relax test to fail after 100 migration failures

2024-08-29 Thread Dev Jain
is still a subjective choice). Note that, this has no effect on the execution time of the test since that is controlled by a timeout. [1] https://lore.kernel.org/all/20240801081657.1386743-1-dev.j...@arm.com/ Signed-off-by: Dev Jain Suggested-by: David Hildenbrand Reviewed-by: Ryan Roberts

Re: [PATCH] selftests/arm64: Fix build warnings for abi

2024-08-28 Thread Dev Jain
On 8/28/24 16:31, Mark Brown wrote: On Tue, Aug 27, 2024 at 01:33:47PM +0100, Will Deacon wrote: On Tue, Aug 27, 2024 at 10:48:51AM +0530, Dev Jain wrote: A "%s" is missing in ksft_exit_fail_msg(); instead, use the newly introduced ksft_exit_fail_perror(). Also, uint64_t corr

Re: [PATCH] selftests/arm64: Fix build warnings for abi

2024-08-28 Thread Dev Jain
On 8/28/24 16:10, Mark Brown wrote: On Tue, Aug 27, 2024 at 10:48:51AM +0530, Dev Jain wrote: - ksft_exit_fail_msg("PTRACE_TRACEME", strerror(errno)); + ksft_exit_fail_perror("PTRACE_TRACEME"); if (raise(SIGSTOP)) - ksft_

Re: [PATCH] selftests/arm64: Fix build warnings for abi

2024-08-27 Thread Dev Jain
On 8/27/24 18:03, Will Deacon wrote: On Tue, Aug 27, 2024 at 10:48:51AM +0530, Dev Jain wrote: A "%s" is missing in ksft_exit_fail_msg(); instead, use the newly introduced ksft_exit_fail_perror(). Also, uint64_t corresponds to unsigned 64-bit integer, so use %lx instead of %llx. Wh

Re: [PATCH v6 1/2] selftests: Rename sigaltstack to generic signal

2024-08-27 Thread Dev Jain
On 8/27/24 17:14, Shuah Khan wrote: On 8/22/24 06:14, Dev Jain wrote: Rename sigaltstack to generic signal directory, to allow adding more signal tests in the future. Sorry - I think I mentioned I don't like this test renamed. Why are you sending this rename still included in the

Re: [PATCH v5 1/2] selftests: Rename sigaltstack to generic signal

2024-08-27 Thread Dev Jain
On 8/27/24 17:08, Shuah Khan wrote: On 8/22/24 05:10, Dev Jain wrote: On 8/22/24 08:33, Shuah Khan wrote: On 8/21/24 00:15, Dev Jain wrote: Rename sigaltstack to signal, and rename the existing test to sigaltstack.c. Can you elaborate on the benefits if renaming the test? Also you have

[PATCH] selftests/arm64: Fix build warnings for abi

2024-08-26 Thread Dev Jain
A "%s" is missing in ksft_exit_fail_msg(); instead, use the newly introduced ksft_exit_fail_perror(). Also, uint64_t corresponds to unsigned 64-bit integer, so use %lx instead of %llx. Signed-off-by: Dev Jain --- The changes in ptrace.c were earlier a part of the follow

Re: [PATCH v2] selftests:mm: Fix mmap() error paths to check for MAP_FAILED

2024-08-22 Thread Dev Jain
On 8/22/24 17:30, Yang Ruibin wrote: To correctly detect whether mmap is successful, must use if (map_ptr == MAP_FAILED)to avoid incorrectly handling a valid mapping.Fix mmap() error paths to check for MAP_FAILED. Shouldn't you have written "avoid processing the return value from a failed mm

[PATCH v6 2/2] selftests: Add a test mangling with uc_sigmask

2024-08-22 Thread Dev Jain
signal, delivered signal, and ucontext. The ucontext is mangled with, by adding a signal mask to it; on return from the handler, the thread must block the corresponding signal. In the test description, I have also described signal delivery and blockage, for ease of understanding what the test does

[PATCH v6 1/2] selftests: Rename sigaltstack to generic signal

2024-08-22 Thread Dev Jain
Rename sigaltstack to generic signal directory, to allow adding more signal tests in the future. Signed-off-by: Dev Jain Reviewed-by: Mark Brown --- tools/testing/selftests/Makefile| 2 +- tools/testing/selftests/{sigaltstack => signal}/.gitignore

[PATCH v6 0/2] Add test to distinguish between thread's signal mask and ucontext_t

2024-08-22 Thread Dev Jain
functions/syscalls - Mention tests in Makefile and .gitignore in alphabetical order v1: - https://lore.kernel.org/all/20240607122319.768640-1-dev.j...@arm.com/ Dev Jain (2): selftests: Rename sigaltstack to generic signal selftests: Add a test mangling with uc_sigmask tools/testing/selfte

Re: [PATCH v6 1/2] selftests: Rename sigaltstack to generic signal

2024-08-22 Thread Dev Jain
On 8/22/24 17:39, Dev Jain wrote: Rename sigaltstack to signal, and rename the existing test to sigaltstack.c. Sorry, hastily copied the commit message from the previous iteration :) will send again, kindly ignore this. Signed-off-by: Dev Jain Reviewed-by: Mark Brown --- tools

[PATCH v6 2/2] selftests: Add a test mangling with uc_sigmask

2024-08-22 Thread Dev Jain
signal, delivered signal, and ucontext. The ucontext is mangled with, by adding a signal mask to it; on return from the handler, the thread must block the corresponding signal. In the test description, I have also described signal delivery and blockage, for ease of understanding what the test does

[PATCH v6 1/2] selftests: Rename sigaltstack to generic signal

2024-08-22 Thread Dev Jain
Rename sigaltstack to signal, and rename the existing test to sigaltstack.c. Signed-off-by: Dev Jain Reviewed-by: Mark Brown --- tools/testing/selftests/Makefile| 2 +- tools/testing/selftests/{sigaltstack => signal}/.gitignore | 0 tools/testing/selfte

[PATCH v6 0/2] Add test to distinguish between thread's signal mask and ucontext_t

2024-08-22 Thread Dev Jain
functions/syscalls - Mention tests in Makefile and .gitignore in alphabetical order v1: - https://lore.kernel.org/all/20240607122319.768640-1-dev.j...@arm.com/ Dev Jain (2): selftests: Rename sigaltstack to generic signal selftests: Add a test mangling with uc_sigmask tools/testing/selfte

Re: [PATCH v5 1/2] selftests: Rename sigaltstack to generic signal

2024-08-22 Thread Dev Jain
On 8/22/24 08:33, Shuah Khan wrote: On 8/21/24 00:15, Dev Jain wrote: Rename sigaltstack to signal, and rename the existing test to sigaltstack.c. Can you elaborate on the benefits if renaming the test? Also you have such a good information in the cover-letter for this patch - it would be

[PATCH v5 2/2] selftests: Add a test mangling with uc_sigmask

2024-08-20 Thread Dev Jain
blockage, for ease of understanding what the test does. Signed-off-by: Dev Jain Reviewed-by: Mark Brown --- tools/testing/selftests/signal/.gitignore | 1 + tools/testing/selftests/signal/Makefile | 3 +- .../selftests/signal/mangle_uc_sigmask.c | 184 ++ 3 files

[PATCH v5 1/2] selftests: Rename sigaltstack to generic signal

2024-08-20 Thread Dev Jain
Rename sigaltstack to signal, and rename the existing test to sigaltstack.c. Signed-off-by: Dev Jain Reviewed-by: Mark Brown --- tools/testing/selftests/Makefile| 2 +- tools/testing/selftests/{sigaltstack => signal}/.gitignore | 2 +- tools/test

[PATCH v5 0/2] Add test to distinguish between thread's signal mask and ucontext_t

2024-08-20 Thread Dev Jain
ot be queued - Remove unneeded , - Give a detailed test description in the comments; also describe the exact meaning of delivered and blocked - Handle errors for all libc functions/syscalls - Mention tests in Makefile and .gitignore in alphabetical order v1: - https://lore.kernel.org/all/2024

Re: [PATCH 1/2] mm: Retry migration earlier upon refcount mismatch

2024-08-20 Thread Dev Jain
On 8/19/24 12:28, Huang, Ying wrote: Dev Jain writes: On 8/13/24 12:52, Dev Jain wrote: On 8/13/24 10:30, Dev Jain wrote: On 8/12/24 17:38, Dev Jain wrote: On 8/12/24 13:01, Huang, Ying wrote: Dev Jain writes: On 8/12/24 11:45, Huang, Ying wrote: Dev Jain writes: On 8/12/24 11:04

Re: [PATCH 1/2] mm: Retry migration earlier upon refcount mismatch

2024-08-16 Thread Dev Jain
On 8/13/24 12:52, Dev Jain wrote: On 8/13/24 10:30, Dev Jain wrote: On 8/12/24 17:38, Dev Jain wrote: On 8/12/24 13:01, Huang, Ying wrote: Dev Jain writes: On 8/12/24 11:45, Huang, Ying wrote: Dev Jain writes: On 8/12/24 11:04, Huang, Ying wrote: Hi, Dev, Dev Jain writes: As

Re: [PATCH 1/2] mm: Retry migration earlier upon refcount mismatch

2024-08-13 Thread Dev Jain
On 8/13/24 10:30, Dev Jain wrote: On 8/12/24 17:38, Dev Jain wrote: On 8/12/24 13:01, Huang, Ying wrote: Dev Jain writes: On 8/12/24 11:45, Huang, Ying wrote: Dev Jain writes: On 8/12/24 11:04, Huang, Ying wrote: Hi, Dev, Dev Jain writes: As already being done in __migrate_folio

Re: [PATCH 1/2] mm: Retry migration earlier upon refcount mismatch

2024-08-12 Thread Dev Jain
On 8/12/24 17:38, Dev Jain wrote: On 8/12/24 13:01, Huang, Ying wrote: Dev Jain writes: On 8/12/24 11:45, Huang, Ying wrote: Dev Jain writes: On 8/12/24 11:04, Huang, Ying wrote: Hi, Dev, Dev Jain writes: As already being done in __migrate_folio(), wherein we backoff if the folio

Re: [PATCH 1/2] mm: Retry migration earlier upon refcount mismatch

2024-08-12 Thread Dev Jain
On 8/12/24 13:01, Huang, Ying wrote: Dev Jain writes: On 8/12/24 11:45, Huang, Ying wrote: Dev Jain writes: On 8/12/24 11:04, Huang, Ying wrote: Hi, Dev, Dev Jain writes: As already being done in __migrate_folio(), wherein we backoff if the folio refcount is wrong, make this check

Re: [PATCH 1/2] mm: Retry migration earlier upon refcount mismatch

2024-08-11 Thread Dev Jain
On 8/12/24 11:45, Huang, Ying wrote: Dev Jain writes: On 8/12/24 11:04, Huang, Ying wrote: Hi, Dev, Dev Jain writes: As already being done in __migrate_folio(), wherein we backoff if the folio refcount is wrong, make this check during the unmapping phase, upon the failure of which, the

Re: [PATCH 1/2] mm: Retry migration earlier upon refcount mismatch

2024-08-11 Thread Dev Jain
On 8/12/24 11:50, Huang, Ying wrote: Dev Jain writes: On 8/12/24 11:04, Huang, Ying wrote: Hi, Dev, Dev Jain writes: As already being done in __migrate_folio(), wherein we backoff if the folio refcount is wrong, make this check during the unmapping phase, upon the failure of which, the

Re: [PATCH 2/2] selftests/mm: Do not fail test for a single migration failure

2024-08-11 Thread Dev Jain
On 8/9/24 22:43, Shuah Khan wrote: On 8/9/24 04:31, Dev Jain wrote: Do not fail the test for just a single instance of migration failure, since migration is a best-effort service. The cover letter says: "Given that migration is a best-effort service, it is wrong to fail the test for j

Re: [PATCH 1/2] mm: Retry migration earlier upon refcount mismatch

2024-08-11 Thread Dev Jain
On 8/12/24 11:04, Huang, Ying wrote: Hi, Dev, Dev Jain writes: As already being done in __migrate_folio(), wherein we backoff if the folio refcount is wrong, make this check during the unmapping phase, upon the failure of which, the original state of the PTEs will be restored and the folio

Re: [PATCH 1/2] mm: Retry migration earlier upon refcount mismatch

2024-08-11 Thread Dev Jain
On 8/12/24 11:04, Huang, Ying wrote: Hi, Dev, Dev Jain writes: As already being done in __migrate_folio(), wherein we backoff if the folio refcount is wrong, make this check during the unmapping phase, upon the failure of which, the original state of the PTEs will be restored and the folio

Re: [PATCH 1/2] mm: Retry migration earlier upon refcount mismatch

2024-08-11 Thread Dev Jain
On 8/11/24 14:38, David Hildenbrand wrote: On 11.08.24 08:06, Dev Jain wrote: On 8/11/24 00:22, David Hildenbrand wrote: On 10.08.24 20:42, Dev Jain wrote: On 8/9/24 19:17, David Hildenbrand wrote: On 09.08.24 12:31, Dev Jain wrote: As already being done in __migrate_folio(), wherein we

Re: [PATCH 1/2] mm: Retry migration earlier upon refcount mismatch

2024-08-10 Thread Dev Jain
On 8/11/24 00:22, David Hildenbrand wrote: On 10.08.24 20:42, Dev Jain wrote: On 8/9/24 19:17, David Hildenbrand wrote: On 09.08.24 12:31, Dev Jain wrote: As already being done in __migrate_folio(), wherein we backoff if the folio refcount is wrong, make this check during the unmapping

Re: [PATCH 1/2] mm: Retry migration earlier upon refcount mismatch

2024-08-10 Thread Dev Jain
On 8/9/24 19:17, David Hildenbrand wrote: On 09.08.24 12:31, Dev Jain wrote: As already being done in __migrate_folio(), wherein we backoff if the folio refcount is wrong, make this check during the unmapping phase, upon the failure of which, the original state of the PTEs will be restored

[PATCH 2/2] selftests/mm: Do not fail test for a single migration failure

2024-08-09 Thread Dev Jain
Do not fail the test for just a single instance of migration failure, since migration is a best-effort service. Signed-off-by: Dev Jain Suggested-by: David Hildenbrand Reviewed-by: Ryan Roberts Tested-by: Ryan Roberts --- tools/testing/selftests/mm/migration.c | 17 +++-- 1 file

[PATCH 1/2] mm: Retry migration earlier upon refcount mismatch

2024-08-09 Thread Dev Jain
will make progress and migration will be retried. Signed-off-by: Dev Jain --- mm/migrate.c | 9 + 1 file changed, 9 insertions(+) diff --git a/mm/migrate.c b/mm/migrate.c index e7296c0fb5d5..477acf996951 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -1250,6 +1250,15 @@ static int

[PATCH 0/2] Improve migration by backing off earlier

2024-08-09 Thread Dev Jain
is still a subjective choice). [1] https://lore.kernel.org/all/20240801081657.1386743-1-dev.j...@arm.com/ Dev Jain (2): mm: Retry migration earlier upon refcount mismatch selftests/mm: Do not fail test for a single migration failure mm/migrate.c | 9 + tools

Re: [PATCH v4 2/2] selftests: Add a test mangling with uc_sigmask

2024-07-22 Thread Dev Jain
On 7/22/24 20:28, Shuah Khan wrote: On 7/15/24 05:49, Dev Jain wrote: On 6/30/24 20:48, Oleg Nesterov wrote: I see nothing wrong, but perhaps this test can be simplified? Feel free to ignore. Say, On 06/27, Dev Jain wrote: +void handler_usr(int signo, siginfo_t *info, void *uc

[PATCH v2] selftests/mm: Skip test for non-LPA2 and non-LVA systems

2024-07-17 Thread Dev Jain
ith ifdeffery to prevent compiler warning on other arches Signed-off-by: Dev Jain Reviewed-by: Ryan Roberts --- The patch applies on linux-next. tools/testing/selftests/mm/va_high_addr_switch.c | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tools/testing/selfte

Re: [PATCH] selftests/mm: Skip test for non-LPA2 and non-LVA systems

2024-07-17 Thread Dev Jain
On 7/17/24 17:27, Ryan Roberts wrote: On 17/07/2024 12:10, Dev Jain wrote: Post my improvement of the test: https://lore.kernel.org/all/20240522070435.773918-3-dev.j...@arm.com/ The test begins to fail on 4k and 16k pages, on non-LPA2 systems. To reduce noise in the CI systems, let us skip

[PATCH] selftests/mm: Skip test for non-LPA2 and non-LVA systems

2024-07-17 Thread Dev Jain
Post my improvement of the test: https://lore.kernel.org/all/20240522070435.773918-3-dev.j...@arm.com/ The test begins to fail on 4k and 16k pages, on non-LPA2 systems. To reduce noise in the CI systems, let us skip the test when higher address space is not implemented. Signed-off-by: Dev Jain

Re: [PATCH v4 0/2] Add test to distinguish between thread's signal mask and ucontext_t

2024-07-16 Thread Dev Jain
On 6/27/24 09:22, Dev Jain wrote: This patch series is motivated by the following observation: Raise a signal, jump to signal handler. The ucontext_t structure dumped by kernel to userspace has a uc_sigmask field having the mask of blocked signals. If you run a fresh minimalistic program

Re: [PATCH] kselftest: missing arg in ptrace.c

2024-07-15 Thread Dev Jain
On 7/13/24 04:47, Remington Brasga wrote: The string passed to ksft_test_result_skip is missing the `type_name` Signed-off-by: Remington Brasga --- clang-tidy reported clang-diagnostic-format-insufficient-args warning on this line, so I am fixing it. tools/testing/selftests/arm64/abi/ptrac

Re: [PATCH] kselftest: missing arg in ptrace.c

2024-07-15 Thread Dev Jain
On 7/13/24 04:47, Remington Brasga wrote: The string passed to ksft_test_result_skip is missing the `type_name` Signed-off-by: Remington Brasga Reviewed-by: Dev Jain

Re: [PATCH v4 2/2] selftests: Add a test mangling with uc_sigmask

2024-07-15 Thread Dev Jain
On 6/30/24 20:48, Oleg Nesterov wrote: I see nothing wrong, but perhaps this test can be simplified? Feel free to ignore. Say, On 06/27, Dev Jain wrote: +void handler_usr(int signo, siginfo_t *info, void *uc) +{ + int ret; + + /* +* Break out of infinite recursion caused

[PATCH v4 2/2] selftests: Add a test mangling with uc_sigmask

2024-06-26 Thread Dev Jain
blockage, for ease of understanding what the test does. Signed-off-by: Dev Jain --- tools/testing/selftests/signal/.gitignore | 1 + tools/testing/selftests/signal/Makefile | 3 +- .../selftests/signal/mangle_uc_sigmask.c | 186 ++ 3 files changed, 189 insertions

[PATCH v4 1/2] selftests: Rename sigaltstack to generic signal

2024-06-26 Thread Dev Jain
Rename sigaltstack to signal, and rename the existing test to sigaltstack.c. Signed-off-by: Dev Jain Reviewed-by: Mark Brown --- tools/testing/selftests/Makefile| 2 +- tools/testing/selftests/{sigaltstack => signal}/.gitignore | 2 +- tools/test

[PATCH v4 0/2] Add test to distinguish between thread's signal mask and ucontext_t

2024-06-26 Thread Dev Jain
test description in the comments; also describe the exact meaning of delivered and blocked - Handle errors for all libc functions/syscalls - Mention tests in Makefile and .gitignore in alphabetical order v1: - https://lore.kernel.org/all/20240607122319.768640-1-dev.j...@arm.com/ Dev Jain

Re: [PATCH v3 2/2] selftests: Add a test mangling with uc_sigmask

2024-06-26 Thread Dev Jain
On 6/26/24 17:24, Oleg Nesterov wrote: On 06/26, Dev Jain wrote: +int main(int argc, char *argv[]) +{ + struct sigaction act, act2; + sigset_t *set, *oldset; ... + set = malloc(sizeof(sigset_t *)); + if (!set) + ksft_exit_fail_perror("m

[PATCH v3 2/2] selftests: Add a test mangling with uc_sigmask

2024-06-25 Thread Dev Jain
blockage, for ease of understanding what the test does. Signed-off-by: Dev Jain --- tools/testing/selftests/signal/.gitignore | 1 + tools/testing/selftests/signal/Makefile | 3 +- .../selftests/signal/mangle_uc_sigmask.c | 194 ++ 3 files changed, 197 insertions

[PATCH v3 1/2] selftests: Rename sigaltstack to generic signal

2024-06-25 Thread Dev Jain
Rename sigaltstack to signal, and rename the existing test to sigaltstack.c. Signed-off-by: Dev Jain Reviewed-by: Mark Brown --- tools/testing/selftests/Makefile| 2 +- tools/testing/selftests/{sigaltstack => signal}/.gitignore | 2 +- tools/test

[PATCH v3 0/2] Add test to distinguish between thread's signal mask and ucontext_t

2024-06-25 Thread Dev Jain
g of delivered and blocked - Handle errors for all libc functions/syscalls - Mention tests in Makefile and .gitignore in alphabetical order v1: - https://lore.kernel.org/all/20240607122319.768640-1-dev.j...@arm.com/ Dev Jain (2): selftests: Rename sigaltstack to generic signal selftests: Ad

[PATCH v3 9/9] selftests: Add build infrastructure along with README

2024-06-25 Thread Dev Jain
. Signed-off-by: Dev Jain --- v2->v3: - Add abi Makefile and .gitignore - Remove config file v1->v2: - Add config file tools/testing/selftests/Makefile | 1 + tools/testing/selftests/arm/Makefile | 56 +++ tools/testing/selftests/arm/

[PATCH v3 8/9] selftests/arm: Add ptrace_64 test

2024-06-25 Thread Dev Jain
For a 64-bit parent debugging a 32-bit child, add tests for reading the TLS registers, and mangling with the mode bits in CPSR. Signed-off-by: Dev Jain --- tools/testing/selftests/arm/abi/ptrace_64.c | 91 +++ .../selftests/arm/abi/trivial_32bit_program.c | 14 +++ 2 files

[PATCH v3 7/9] selftests/arm: Add ptrace test

2024-06-25 Thread Dev Jain
For a 32-bit parent debugging a 32-bit child, add tests for reading the TLS registers, and mangling with the mode bits in CPSR. Signed-off-by: Dev Jain --- tools/testing/selftests/arm/abi/ptrace.c | 82 tools/testing/selftests/arm/abi/ptrace.h | 57 2

[PATCH v3 6/9] selftests/arm64: Split ptrace, use ifdeffery

2024-06-25 Thread Dev Jain
Split some of the common code to be used by selftests/arm, into ptrace.h. Signed-off-by: Dev Jain --- tools/testing/selftests/arm64/abi/ptrace.c | 121 ++ tools/testing/selftests/arm64/abi/ptrace.h | 135 + 2 files changed, 145 insertions(+), 111 deletions

[PATCH v3 5/9] selftests/arm64: Fix build warnings for ptrace

2024-06-25 Thread Dev Jain
ne. Fixes: ecaf4d3f734f ("kselftest/arm64: Add test coverage for NT_ARM_TLS") Fixes: cb5aa6379438 ("kselftest/arm64: Add a smoke test for ptracing hardware break/watch points") Signed-off-by: Dev Jain --- tools/testing/selftests/arm64/abi/ptrace.c | 6 +++--- 1 file changed

[PATCH v3 4/9] selftests/arm: Add signal tests

2024-06-25 Thread Dev Jain
illegal attempt and the testcases are expected to terminate via SEGV. Signed-off-by: Dev Jain --- .../testcases/mangle_cpsr_invalid_aif_bits.c | 33 +++ .../mangle_cpsr_invalid_compat_toggle.c | 29 2 files changed, 62 insertions(+) create mode 100644

[PATCH v3 3/9] selftests: arm, arm64: Use ifdeffery to pull signal infrastructure

2024-06-25 Thread Dev Jain
Use ifdeffery to guard code chunks meant specifically for arm64, in preparation for putting signal tests in selftests/arm. Signed-off-by: Dev Jain --- .../selftests/arm/signal/test_signals.c | 2 + .../selftests/arm/signal/test_signals.h | 2 + .../selftests/arm/signal

[PATCH v3 2/9] selftests/arm: Add elf test

2024-06-25 Thread Dev Jain
This patch introduces an ELF parsing test. A basic sanity check is required to ensure that we are actually testing a 32-bit build. Signed-off-by: Dev Jain --- v2->v3: - Introduce two more testcases tools/testing/selftests/arm/elf/parse_elf.c | 77 + 1 file changed,

[PATCH v3 1/9] selftests/arm: Add mm test

2024-06-25 Thread Dev Jain
/proc/self/maps. Signed-off-by: Dev Jain --- v2->v3: - Split into multiple testcases tools/testing/selftests/arm/mm/compat_va.c | 89 ++ 1 file changed, 89 insertions(+) create mode 100644 tools/testing/selftests/arm/mm/compat_va.c diff --git a/tools/testing/selftests/

[PATCH v3 0/9] A new selftests/ directory for arm compatibility testing

2024-06-25 Thread Dev Jain
d warnings in selftests/arm64 (can be applied independent of this series) v1->v2: - Formatting changes - Add .gitignore files and config file v1: - https://lore.kernel.org/all/20240405084410.256788-1-dev.j...@arm.com/ Dev Jain (9): selftests/arm: Add mm test selftests/arm: Add elf test

Re: [PATCH v2 2/2] selftests: Add a test mangling with uc_sigmask

2024-06-12 Thread Dev Jain
On 6/12/24 18:46, Mark Brown wrote: On Wed, Jun 12, 2024 at 10:14:01AM +0530, Dev Jain wrote: On 6/11/24 16:55, Mark Brown wrote: On Tue, Jun 11, 2024 at 01:26:50PM +0530, Dev Jain wrote: + * A signal is said to be delivered, when the program takes action on the + * signal: such action may

Re: [PATCH 1/2] selftests: kvm: remove print_skip()

2024-06-12 Thread Dev Jain
On 6/12/24 16:14, Muhammad Usama Anjum wrote: diff --git a/tools/testing/selftests/kvm/x86_64/hyperv_cpuid.c b/tools/testing/selftests/kvm/x86_64/hyperv_cpuid.c index 4f5881d4ef66d..695c45635d257 100644 --- a/tools/testing/selftests/kvm/x86_64/hyperv_cpuid.c +++ b/tools/testing/selftests/kvm

Re: [PATCH v2 2/2] selftests: Add a test mangling with uc_sigmask

2024-06-11 Thread Dev Jain
On 6/11/24 16:55, Mark Brown wrote: On Tue, Jun 11, 2024 at 01:26:50PM +0530, Dev Jain wrote: + * A signal is said to be delivered, when the program takes action on the + * signal: such action may involve termination of the process, ignoring the + * signal, terminating with core dump

Re: [PATCH v2 1/2] selftests: Rename sigaltstack to generic signal

2024-06-11 Thread Dev Jain
On 6/11/24 16:24, Mark Brown wrote: On Tue, Jun 11, 2024 at 01:26:49PM +0530, Dev Jain wrote: Rename sigaltstack to signal, and rename the existing test to sigaltstack.c. Signed-off-by: Dev Jain --- If people review patches and give a tag for them you should carry the tag forward to avoid

[PATCH v2 2/2] selftests: Add a test mangling with uc_sigmask

2024-06-11 Thread Dev Jain
a signal to be delivered or blocked, for ease of clarity. Signed-off-by: Dev Jain --- tools/testing/selftests/signal/.gitignore | 1 + tools/testing/selftests/signal/Makefile | 3 +- .../selftests/signal/mangle_uc_sigmask.c | 194 ++ 3 files changed, 197

[PATCH v2 1/2] selftests: Rename sigaltstack to generic signal

2024-06-11 Thread Dev Jain
Rename sigaltstack to signal, and rename the existing test to sigaltstack.c. Signed-off-by: Dev Jain --- tools/testing/selftests/Makefile| 2 +- tools/testing/selftests/{sigaltstack => signal}/.gitignore | 2 +- tools/testing/selftests/{sigaltstack =>

[PATCH v2 0/2] Add test to distinguish between thread's signal mask and ucontext_t

2024-06-11 Thread Dev Jain
ive a detailed test description in the comments; also describe the exact meaning of delivered and blocked - Handle errors for all libc functions/syscalls - Mention tests in Makefile and .gitignore in alphabetical order Dev Jain (2): selftests: Rename sigaltstack to generic signal s

Re: [PATCH v2 0/2] Add test to distinguish between thread's signal mask and ucontext_t

2024-06-11 Thread Dev Jain
Sorry, please ignore this email thread; I am sending another one. On 6/11/24 13:13, Dev Jain wrote: This patch series is motivated by the following observation: Raise a signal, jump to signal handler. The ucontext_t structure dumped by kernel to userspace has a uc_sigmask field having the mask

[PATCH v2 2/2] selftests: Add a test mangling with uc_sigmask

2024-06-11 Thread Dev Jain
a signal to be delivered or blocked, for ease of clarity. Signed-off-by: Dev Jain --- tools/testing/selftests/signal/.gitignore | 1 + tools/testing/selftests/signal/Makefile | 3 +- .../selftests/signal/mangle_uc_sigmask.c | 194 ++ 3 files changed, 197

[PATCH v2 1/2] selftests: Rename sigaltstack to generic signal

2024-06-11 Thread Dev Jain
Rename sigaltstack to signal, and rename the existing test to sigaltstack.c. Signed-off-by: Dev Jain --- tools/testing/selftests/Makefile| 2 +- tools/testing/selftests/{sigaltstack => signal}/.gitignore | 2 +- tools/testing/selftests/{sigaltstack =>

[PATCH v2 0/2] Add test to distinguish between thread's signal mask and ucontext_t

2024-06-11 Thread Dev Jain
; also describe the exact meaning of delivered and blocked - Handle errors for all libc functions/syscalls - Mention tests in Makefile and .gitignore in alphabetical order Dev Jain (2): selftests: Rename sigaltstack to generic signal selftests: Add a test mangling with uc_sigmask tools/te

Re: [PATCH 2/2] selftests: Add a test mangling with uc_sigmask

2024-06-07 Thread Dev Jain
On 6/7/24 19:12, Mark Brown wrote: On Fri, Jun 07, 2024 at 06:53:27PM +0530, Dev Jain wrote: On 6/7/24 18:42, Mark Brown wrote: On Fri, Jun 07, 2024 at 05:53:19PM +0530, Dev Jain wrote: + * Test describing a clear distinction between signal states - delivered and + * blocked, and their

Re: [PATCH 2/2] selftests: Add a test mangling with uc_sigmask

2024-06-07 Thread Dev Jain
On 6/7/24 18:42, Mark Brown wrote: On Fri, Jun 07, 2024 at 05:53:19PM +0530, Dev Jain wrote: This test asserts the relation between blocked signal, delivered signal, and ucontext. The ucontext is mangled with, by adding a signal mask to it; on return from the handler, the thread must block

[PATCH 2/2] selftests: Add a test mangling with uc_sigmask

2024-06-07 Thread Dev Jain
This test asserts the relation between blocked signal, delivered signal, and ucontext. The ucontext is mangled with, by adding a signal mask to it; on return from the handler, the thread must block the corresponding signal. Signed-off-by: Dev Jain --- tools/testing/selftests/signal/.gitignore

[PATCH 1/2] selftests: Rename sigaltstack to generic signal

2024-06-07 Thread Dev Jain
Rename sigaltstack to signal, and rename the existing test to sigaltstack.c. Signed-off-by: Dev Jain --- tools/testing/selftests/Makefile| 2 +- tools/testing/selftests/{sigaltstack => signal}/.gitignore | 2 +- tools/testing/selftests/{sigaltstack =>

[PATCH 0/2] Add test to distinguish between thread's signal mask and ucontext_t

2024-06-07 Thread Dev Jain
signals blocked using sigaction() remain blocked only till the execution of the handler, and not in the context present before jumping to the handler (but nothing can be confirmed from the man-pages), the series introduces a test for mangling with uc_sigmask. I will send a separate series to fix the

Re: [PATCH] selftests: arm64: Fix redundancy of a testcase

2024-06-05 Thread Dev Jain
On 6/5/24 17:30, Mark Brown wrote: On Wed, Jun 05, 2024 at 05:24:48PM +0530, Dev Jain wrote: Currently, we are writing the same value as we read, into the TLS register; hence, we cannot confirm updation of the register, making the testcase "verify_tpidr_one" redundant. Fix this; w

[PATCH] selftests: arm64: Fix redundancy of a testcase

2024-06-05 Thread Dev Jain
Currently, we are writing the same value as we read, into the TLS register; hence, we cannot confirm updation of the register, making the testcase "verify_tpidr_one" redundant. Fix this; while at it, do a style change. Signed-off-by: Dev Jain --- tools/testing/selftests/arm64/abi/pt

[PATCH 1/2] selftests/mm: va_high_addr_switch: Reduce test noise

2024-05-22 Thread Dev Jain
When invoking the binary with "--run-hugetlb" flag, the testcases involving the base page are anyways going to be run. Therefore, remove duplication by invoking the binary only once. Signed-off-by: Dev Jain --- tools/testing/selftests/mm/va_high_addr_switch.sh | 4 1 file

[PATCH 2/2] selftests/mm: va_high_addr_switch: Dynamically initialize testcases to enable LPA2 testing

2024-05-22 Thread Dev Jain
populating the array as a stack variable, and filling in the page size and hugepage size at runtime. Suggested-by: Andrew Morton Signed-off-by: Dev Jain --- .../selftests/mm/va_high_addr_switch.c| 454 +- 1 file changed, 232 insertions(+), 222 deletions(-) diff --git a/tools

[PATCH 0/2] Restructure va_high_addr_switch

2024-05-22 Thread Dev Jain
granules on higher addresses; we restructure the test to support the same. In addition, we avoid invocation of the binary twice, in the shell script, to reduce test noise. Dev Jain (2): selftests/mm: va_high_addr_switch: Reduce test noise selftests/mm: va_high_addr_switch: Dynamically

Re: [PATCH] selftests/mm: va_high_addr_switch: Do not skip test and give warning message post FEAT_LPA2

2024-05-21 Thread Dev Jain
On 5/20/24 05:18, Andrew Morton wrote: On Thu, 16 May 2024 09:26:33 +0530 Dev Jain wrote: Post FEAT_LPA2, Aarch64 extends the 4KB and 16KB translation granule to large virtual addresses. Currently, the test is being skipped for said granule sizes, because the page sizes have been statically

[PATCH v2 3/3] selftests/mm: compaction_test: Fix bogus test success and reduce probability of OOM-killer invocation

2024-05-21 Thread Dev Jain
he test succeeding always. Q.E.D Changes in v2: - Handle unsigned long number of hugepages v1: - https://lore.kernel.org/all/20240515093633.54814-3-dev.j...@arm.com/ NOTE: This patch depends on the previous one. Fixes: bd67d5c15cc1 ("Test compaction of mlocked memory") Cc: sta...@vger.k

[PATCH v2 2/3] selftests/mm: compaction_test: Fix incorrect write of zero to nr_hugepages

2024-05-21 Thread Dev Jain
Currently, the test tries to set nr_hugepages to zero, but that is not actually done because the file offset is not reset after read(). Fix that using lseek(). Fixes: bd67d5c15cc1 ("Test compaction of mlocked memory") Cc: sta...@vger.kernel.org Signed-off-by: Dev Jain --- too

[PATCH v2 1/3] selftests/mm: compaction_test: Fix bogus test success on Aarch64

2024-05-21 Thread Dev Jain
: bd67d5c15cc1 ("Test compaction of mlocked memory") Cc: sta...@vger.kernel.org Signed-off-by: Dev Jain --- tools/testing/selftests/mm/compaction_test.c | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/tools/testing/selftests/mm/compaction_test.c b/too

[PATCH v2 0/3] Fixes for compaction_test

2024-05-21 Thread Dev Jain
- Combine the first patch (previously standalone) with this series Link to v1: https://lore.kernel.org/all/20240513082842.4117782-1-dev.j...@arm.com/ https://lore.kernel.org/all/20240515093633.54814-1-dev.j...@arm.com/ Dev Jain (3): selftests/mm: compaction_test: Fix bogus test success on Aarch64

Re: [PATCH 2/2] selftests/mm: compaction_test: Fix trivial test success and reduce probability of OOM-killer invocation

2024-05-19 Thread Dev Jain
On 5/20/24 05:33, Andrew Morton wrote: On Wed, 15 May 2024 15:06:33 +0530 Dev Jain wrote: Reset nr_hugepages to zero before the start of the test. If a non-zero number of hugepages is already set before the start of the test, the following problems arise: - The probability of the test

Re: [PATCH 1/2] selftests/mm: compaction_test: Fix incorrect write of zero to nr_hugepages

2024-05-19 Thread Dev Jain
On 5/20/24 05:30, Andrew Morton wrote: On Wed, 15 May 2024 15:06:32 +0530 Dev Jain wrote: nr_hugepages is not set to zero because the file offset has not been reset after read(). Fix that using lseek(). Please fully describe the runtime effects of this bug. This is not a "bug&qu

[PATCH] selftests/mm: va_high_addr_switch: Do not skip test and give warning message post FEAT_LPA2

2024-05-15 Thread Dev Jain
testcases. Instead, don't skip the test, and encourage the user to manually change the macros. Signed-off-by: Dev Jain --- .../testing/selftests/mm/va_high_addr_switch.c | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftes

  1   2   >