All of lore.kernel.org
 help / color / mirror / Atom feed
* + selftests-proc-proc-empty-vm-handle-cpus-without-protection-keys.patch added to mm-nonmm-unstable branch
@ 2026-11-09 20:08 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-11-09 20:08 UTC (permalink / raw)
  To: mm-commits, swarupkotikalapudi, shuah, kevin.brodsky, clopez,
	adobriyan, lylin1023, akpm

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2963 bytes --]


The patch titled
     Subject: selftests/proc: proc-empty-vm: handle CPUs without protection keys
has been added to the -mm mm-nonmm-unstable branch.  Its filename is
     selftests-proc-proc-empty-vm-handle-cpus-without-protection-keys.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/selftests-proc-proc-empty-vm-handle-cpus-without-protection-keys.patch

This patch will later appear in the mm-nonmm-unstable branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days

------------------------------------------------------
From: Kurt Lin <lylin1023@gmail.com>
Subject: selftests/proc: proc-empty-vm: handle CPUs without protection keys
Date: Mon,  9 Nov 2026 23:19:12 +0800

On x86 CPUs without protection keys, pkey_alloc() fails with ENOSPC,
as documented in pkey_alloc(2). protection_key_support() only expects
ENOSYS or EINVAL, so the test fails on such machines, e.g. an Intel
Core i5-7200U:

  protection_key_support: error: rv -1, errno 28

Treat ENOSPC as "no protection key support" as well.

An AI coding assistant (Claude) was used to analyze the failure and to
draft the fix and this changelog. Tested on v7.4-rc1 on the machine
above; the test now passes.

Link: https://lore.kernel.org/20261109151912.156518-1-lylin1023@gmail.com
Fixes: bf5add391eeb ("proc: test ProtectionKey in proc-empty-vm test")
Signed-off-by: Kurt Lin <lylin1023@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Swarup Laxman Kotiaklapudi <swarupkotikalapudi@gmail.com>
Cc: Carlos López <clopez@suse.de>
Cc: Kevin Brodsky <kevin.brodsky@arm.com>
---

 tools/testing/selftests/proc/proc-empty-vm.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/tools/testing/selftests/proc/proc-empty-vm.c~selftests-proc-proc-empty-vm-handle-cpus-without-protection-keys
+++ a/tools/testing/selftests/proc/proc-empty-vm.c
@@ -78,6 +78,9 @@ static int protection_key_support(void)
 	} else if (rv == -1 && errno == EINVAL) {
 		// ospke=n
 		return 0;
+	} else if (rv == -1 && errno == ENOSPC) {
+		// CPU without protection keys
+		return 0;
 	} else {
 		fprintf(stderr, "%s: error: rv %ld, errno %d\n", __func__, rv, errno);
 		exit(EXIT_FAILURE);
_

Patches currently in -mm which might be from lylin1023@gmail.com are

selftests-proc-proc-empty-vm-handle-cpus-without-protection-keys.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-09 20:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-09 20:08 + selftests-proc-proc-empty-vm-handle-cpus-without-protection-keys.patch added to mm-nonmm-unstable branch Andrew Morton

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.