Skip to contentSkip to conversation

selftests/mm: remove the local PKEY_UNRESTRICTED fallback

PATCH Superseded Hemanth Selam 3 participants 11 messages Aug 18 – Aug 25

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests/mm: remove the local PKEY_UNRESTRICTED fallback

pkey-helpers.h defines PKEY_UNRESTRICTED itself when the macro is not already known, a stopgap from when the generic definition was still under review. It has been merged since, commit 6d61527d931b ("mm/pkey:
Add PKEY_UNRESTRICTED macro"), and pkey-helpers.h already includes <linux/mman.h>, so the guard is never taken. Honour the FIXME and drop it.

The mm selftests build against the headers of the kernel source, see Documentation/dev-tools/kselftest.rst. Building them without "make headers", against system headers predating the macro, now fails to compile instead of quietly falling back.

No functional change intended.

---
 tools/testing/selftests/mm/pkey-helpers.h | 7 -------
 1 file changed, 7 deletions(-)
tools/testing/selftests/mm/pkey-helpers.h +0 -7
index 2c377f4e9df1..626c2e1655dc 100644
@@ -112,13 +112,6 @@ void record_pkey_malloc(void *ptr, long size, int prot);
 #define PKEY_MASK	(PKEY_DISABLE_ACCESS | PKEY_DISABLE_WRITE)
 #endif
 
-/*
- * FIXME: Remove once the generic PKEY_UNRESTRICTED definition is merged.
- */
-#ifndef PKEY_UNRESTRICTED
-#define PKEY_UNRESTRICTED 0x0
-#endif
-
 #ifndef set_pkey_bits
 static inline u64 set_pkey_bits(u64 reg, int pkey, u64 flags)
 {
Signature · 1 line
2.43.7
#1 lore raw
Quoted 27 lines · Hemanth Selam

pkey-helpers.h defines PKEY_UNRESTRICTED itself when the macro is not already known, a stopgap from when the generic definition was still under review. It has been merged since, commit 6d61527d931b ("mm/pkey:
Add PKEY_UNRESTRICTED macro"), and pkey-helpers.h already includes <linux/mman.h>, so the guard is never taken. Honour the FIXME and drop it.

The mm selftests build against the headers of the kernel source, see Documentation/dev-tools/kselftest.rst. Building them without "make headers", against system headers predating the macro, now fails to compile instead of quietly falling back.

No functional change intended.

---
 tools/testing/selftests/mm/pkey-helpers.h | 7 -------
 1 file changed, 7 deletions(-)
tools/testing/selftests/mm/pkey-helpers.h +0 -0
index 2c377f4e9df1..626c2e1655dc 100644
@@ -112,13 +112,6 @@ void record_pkey_malloc(void *ptr, long size, int prot);
 #define PKEY_MASK	(PKEY_DISABLE_ACCESS | PKEY_DISABLE_WRITE)
 #endif
 

tools/testing/selftests/mm/pkey-helpers.h void record_pkey_malloc(void *ptr, long size, int prot); · line 117

Quoted 10 lines
tools/testing/selftests/mm/pkey-helpers.h +0 -7
-/*
- * FIXME: Remove once the generic PKEY_UNRESTRICTED definition is merged.
- */
-#ifndef PKEY_UNRESTRICTED
-#define PKEY_UNRESTRICTED 0x0
-#endif
-
 #ifndef set_pkey_bits
 static inline u64 set_pkey_bits(u64 reg, int pkey, u64 flags)
 {

tools/include/uapi/asm-generic/mman-common.h:#define PKEY_UNRESTRICTED 0x0

So that looks good.

But we seem to have the same ifdef also in
tools/testing/selftests/powerpc/include/pkeys.h.

So likely that should be removed as well (after making sure that it compiles?)

Signature · 3 lines
Cheers,

David
#2 lore raw
Quoted 10 lines · David Hildenbrand (Arm)
Quoted 9 lines · Hemanth Selam

pkey-helpers.h defines PKEY_UNRESTRICTED itself when the macro is not already known, a stopgap from when the generic definition was still under review. It has been merged since, commit 6d61527d931b ("mm/pkey:
Add PKEY_UNRESTRICTED macro"), and pkey-helpers.h already includes <linux/mman.h>, so the guard is never taken. Honour the FIXME and drop it.

The mm selftests build against the headers of the kernel source, see Documentation/dev-tools/kselftest.rst. Building them without "make

This is incorrect. We explicitly do not have this requirement in mm selftests, and they're often built without having to do this step and tooling has been provided _explicitly_ to allow for that, which is why this kind of thing exists right now.

Quoted 31 lines
Quoted 18 lines

headers", against system headers predating the macro, now fails to compile instead of quietly falling back.

No functional change intended.

---
 tools/testing/selftests/mm/pkey-helpers.h | 7 -------
 1 file changed, 7 deletions(-)
tools/testing/selftests/mm/pkey-helpers.h +0 -0
index 2c377f4e9df1..626c2e1655dc 100644
@@ -112,13 +112,6 @@ void record_pkey_malloc(void *ptr, long size, int prot);
 #define PKEY_MASK	(PKEY_DISABLE_ACCESS | PKEY_DISABLE_WRITE)
 #endif
 

tools/testing/selftests/mm/pkey-helpers.h void record_pkey_malloc(void *ptr, long size, int prot); · line 117

Quoted 10 lines
tools/testing/selftests/mm/pkey-helpers.h +0 -7
-/*
- * FIXME: Remove once the generic PKEY_UNRESTRICTED definition is merged.
- */
-#ifndef PKEY_UNRESTRICTED
-#define PKEY_UNRESTRICTED 0x0
-#endif
-
 #ifndef set_pkey_bits
 static inline u64 set_pkey_bits(u64 reg, int pkey, u64 flags)
 {

tools/include/uapi/asm-generic/mman-common.h:#define PKEY_UNRESTRICTED 0x0

Quoted 6 lines

So that looks good.

But we seem to have the same ifdef also in
tools/testing/selftests/powerpc/include/pkeys.h.

So likely that should be removed as well (after making sure that it compiles?)

It will break people right now :) it might compile on one system but not another.

There's been a bunch of discussion on this, often quite painful. See [0] and surrounding thread for some history on this...

IOW - this isn't really costing us much so I'd prefer we kept this kind of thing.

Quoted 5 lines

--
Cheers,

David

--
Cheers, Lorenzo

[0]:https://lore.kernel.org/all/[email protected]/

#3 lore raw
Quoted 50 lines · Lorenzo Stoakes (ARM)
Quoted 10 lines · David Hildenbrand (Arm)
Quoted 9 lines · Hemanth Selam

pkey-helpers.h defines PKEY_UNRESTRICTED itself when the macro is not already known, a stopgap from when the generic definition was still under review. It has been merged since, commit 6d61527d931b ("mm/pkey:
Add PKEY_UNRESTRICTED macro"), and pkey-helpers.h already includes <linux/mman.h>, so the guard is never taken. Honour the FIXME and drop it.

The mm selftests build against the headers of the kernel source, see Documentation/dev-tools/kselftest.rst. Building them without "make

This is incorrect. We explicitly do not have this requirement in mm selftests, and they're often built without having to do this step and tooling has been provided _explicitly_ to allow for that, which is why this kind of thing exists right now.

Quoted 33 lines
Quoted 18 lines

headers", against system headers predating the macro, now fails to compile instead of quietly falling back.

No functional change intended.

---
 tools/testing/selftests/mm/pkey-helpers.h | 7 -------
 1 file changed, 7 deletions(-)
tools/testing/selftests/mm/pkey-helpers.h +0 -0
index 2c377f4e9df1..626c2e1655dc 100644
@@ -112,13 +112,6 @@ void record_pkey_malloc(void *ptr, long size, int prot);
 #define PKEY_MASK	(PKEY_DISABLE_ACCESS | PKEY_DISABLE_WRITE)
 #endif
 

tools/testing/selftests/mm/pkey-helpers.h void record_pkey_malloc(void *ptr, long size, int prot); · line 117

Quoted 10 lines
tools/testing/selftests/mm/pkey-helpers.h +0 -7
-/*
- * FIXME: Remove once the generic PKEY_UNRESTRICTED definition is merged.
- */
-#ifndef PKEY_UNRESTRICTED
-#define PKEY_UNRESTRICTED 0x0
-#endif
-
 #ifndef set_pkey_bits
 static inline u64 set_pkey_bits(u64 reg, int pkey, u64 flags)
 {

tools/include/uapi/asm-generic/mman-common.h:#define PKEY_UNRESTRICTED 0x0

So that looks good.

Quoted 7 lines
Quoted 4 lines

But we seem to have the same ifdef also in
tools/testing/selftests/powerpc/include/pkeys.h.

So likely that should be removed as well (after making sure that it compiles?)

It will break people right now :) it might compile on one system but not another.

I thought once we have stuff in tools/include/uapi/asm-generic/ headers that it should work?

The dependency on "make headers" was the problematic bit IIUC.

But this stuff is always confusing me ...

Signature · 3 lines
Cheers,

David
#4 lore raw
Quoted 59 lines · David Hildenbrand (Arm)
Quoted 50 lines · Lorenzo Stoakes (ARM)
Quoted 10 lines · David Hildenbrand (Arm)
Quoted 9 lines · Hemanth Selam

pkey-helpers.h defines PKEY_UNRESTRICTED itself when the macro is not already known, a stopgap from when the generic definition was still under review. It has been merged since, commit 6d61527d931b ("mm/pkey:
Add PKEY_UNRESTRICTED macro"), and pkey-helpers.h already includes <linux/mman.h>, so the guard is never taken. Honour the FIXME and drop it.

The mm selftests build against the headers of the kernel source, see Documentation/dev-tools/kselftest.rst. Building them without "make

This is incorrect. We explicitly do not have this requirement in mm selftests, and they're often built without having to do this step and tooling has been provided _explicitly_ to allow for that, which is why this kind of thing exists right now.

Quoted 33 lines
Quoted 18 lines

headers", against system headers predating the macro, now fails to compile instead of quietly falling back.

No functional change intended.

---
 tools/testing/selftests/mm/pkey-helpers.h | 7 -------
 1 file changed, 7 deletions(-)
tools/testing/selftests/mm/pkey-helpers.h +0 -0
index 2c377f4e9df1..626c2e1655dc 100644
@@ -112,13 +112,6 @@ void record_pkey_malloc(void *ptr, long size, int prot);
 #define PKEY_MASK	(PKEY_DISABLE_ACCESS | PKEY_DISABLE_WRITE)
 #endif
 

tools/testing/selftests/mm/pkey-helpers.h void record_pkey_malloc(void *ptr, long size, int prot); · line 117

Quoted 10 lines
tools/testing/selftests/mm/pkey-helpers.h +0 -7
-/*
- * FIXME: Remove once the generic PKEY_UNRESTRICTED definition is merged.
- */
-#ifndef PKEY_UNRESTRICTED
-#define PKEY_UNRESTRICTED 0x0
-#endif
-
 #ifndef set_pkey_bits
 static inline u64 set_pkey_bits(u64 reg, int pkey, u64 flags)
 {

tools/include/uapi/asm-generic/mman-common.h:#define PKEY_UNRESTRICTED 0x0

So that looks good.

Quoted 7 lines
Quoted 4 lines

But we seem to have the same ifdef also in
tools/testing/selftests/powerpc/include/pkeys.h.

So likely that should be removed as well (after making sure that it compiles?)

It will break people right now :) it might compile on one system but not another.

Quoted 6 lines

I thought once we have stuff in tools/include/uapi/asm-generic/ headers that it should work?

The dependency on "make headers" was the problematic bit IIUC.

But this stuff is always confusing me ...

Yeah I did go check over there :) but for a lot of stuff we don't have that and it's not really the right place (that's more providing userland stubs, etc.)

Yeah it's confusing and a pain and sometimes we break these things but in general I don't think the #ifndef/#define's are too problematic to keep.

But it might be worth checking in this case to see whether the problem here is in fact that we need PKEY_UNRESTRICTED defined over there?

Hemanth - could you check please?

Quoted 5 lines

--
Cheers,

David

--
Cheers, Lorenzo

#5 lore raw
Quoted 4 lines · Lorenzo Stoakes (ARM)

But it might be worth checking in this case to see whether the problem here is in fact that we need PKEY_UNRESTRICTED defined over there?

Hemanth - could you check please?

Checked. It is already defined over there:

tools/include/uapi/asm-generic/mman-common.h:88:#define PKEY_UNRESTRICTED 0x0

and it does reach the mm selftests without "make headers", through TOOLS_INCLUDES. The path is not obvious, so for the record:

pkey-helpers.h

    -> <linux/mman.h>           tools/include/uapi/linux/mman.h
      -> <asm/mman.h>           /usr/include/asm/mman.h
                                (tools/include/uapi/asm/mman.h does not exist)
        -> <asm-generic/mman.h> tools/include/uapi/asm-generic/mman.h
                                (-isystem puts it ahead of the system one)
          -> <asm-generic/mman-common-tools.h>
            -> <asm-generic/mman-common.h>	PKEY_UNRESTRICTED

I built the pkey tests with KHDR_INCLUDES pointing at an empty directory, that is, as if "make headers" had never run. They build, and cpp -dD says:

defined in: tools/include/uapi/asm-generic/mman-common.h

Pointing TOOLS_INCLUDES at an empty directory as well is what breaks it:

pkey-helpers.h:188:30: error: 'PKEY_UNRESTRICTED' undeclared

So that is where the definition comes from, and dropping the local #ifndef does not depend on "make headers" being run.

The one thing worth being aware of is that the redirection into tools/include/uapi only happens because the system <asm/mman.h> includes <asm-generic/mman.h>.

I had a look at the history you pointed at, thanks, that was the part I had wrong. If I read it right this is exactly the mechanism from commit e076eaca5906 ("selftests: break the dependency upon local header files"), which added TOOLS_INCLUDES to the mm selftests so they build without "make headers". So for this particular macro the value comes from the in-tree snapshot rather than from whatever the build host has installed, which is why it does not vary per system here.

That said, if you would still rather keep the #ifndef as a matter of course, I have no objection to dropping the patch, the guard costs nothing. I mainly wanted to answer the question with something measured rather than assumed.

Quoted 4 lines

This is incorrect. We explicitly do not have this requirement in mm selftests, and they're often built without having to do this step and tooling has been provided _explicitly_ to allow for that, which is why this kind of thing exists right now.

You are right, the commit message was wrong on that point. v2 drops that paragraph and describes the above instead.

On the powerpc header David mentioned, I would rather leave tools/testing/selftests/powerpc/include/pkeys.h alone. It is not the same construct: it is an unconditional

  #undef PKEY_UNRESTRICTED
  #define PKEY_UNRESTRICTED	0x0

next to other powerpc specific overrides such as PKEY_DISABLE_EXECUTE 0x4, and that header only includes <sys/mman.h>, never <linux/mman.h>. A probe including just <sys/mman.h> does not find PKEY_UNRESTRICTED, with or without TOOLS_INCLUDES, so the definition there is load bearing and removing it would break the build.

Thanks,
Hemanth

#6 lore raw
Quoted 47 lines · Hemanth Selam
Quoted 4 lines · Lorenzo Stoakes (ARM)

But it might be worth checking in this case to see whether the problem here is in fact that we need PKEY_UNRESTRICTED defined over there?

Hemanth - could you check please?

Checked. It is already defined over there:

tools/include/uapi/asm-generic/mman-common.h:88:#define PKEY_UNRESTRICTED 0x0

and it does reach the mm selftests without "make headers", through TOOLS_INCLUDES. The path is not obvious, so for the record:

pkey-helpers.h

    -> <linux/mman.h>           tools/include/uapi/linux/mman.h
      -> <asm/mman.h>           /usr/include/asm/mman.h
                                (tools/include/uapi/asm/mman.h does not exist)
        -> <asm-generic/mman.h> tools/include/uapi/asm-generic/mman.h
                                (-isystem puts it ahead of the system one)
          -> <asm-generic/mman-common-tools.h>
            -> <asm-generic/mman-common.h>	PKEY_UNRESTRICTED

I built the pkey tests with KHDR_INCLUDES pointing at an empty directory, that is, as if "make headers" had never run. They build, and cpp -dD says:

defined in: tools/include/uapi/asm-generic/mman-common.h

Pointing TOOLS_INCLUDES at an empty directory as well is what breaks it:

pkey-helpers.h:188:30: error: 'PKEY_UNRESTRICTED' undeclared

So that is where the definition comes from, and dropping the local #ifndef does not depend on "make headers" being run.

The one thing worth being aware of is that the redirection into tools/include/uapi only happens because the system <asm/mman.h> includes <asm-generic/mman.h>.

I had a look at the history you pointed at, thanks, that was the part I had wrong. If I read it right this is exactly the mechanism from commit e076eaca5906 ("selftests: break the dependency upon local header files"), which added TOOLS_INCLUDES to the mm selftests so they build without "make headers". So for this particular macro the value comes from the in-tree snapshot rather than from whatever the build host has installed, which is why it does not vary per system here.

Quoted 4 lines

That said, if you would still rather keep the #ifndef as a matter of course, I have no objection to dropping the patch, the guard costs nothing. I mainly wanted to answer the question with something measured rather than assumed.

Thanks, all I care about is if they build so fine to remove then.

Quoted 13 lines
Quoted 5 lines

This is incorrect. We explicitly do not have this requirement in mm selftests, and they're often built without having to do this step and tooling has been provided _explicitly_ to allow for that, which is why this kind of thing exists right now.

You are right, the commit message was wrong on that point. v2 drops that paragraph and describes the above instead.

On the powerpc header David mentioned, I would rather leave tools/testing/selftests/powerpc/include/pkeys.h alone. It is not the same construct: it is an unconditional

Quoted 8 lines
  #undef PKEY_UNRESTRICTED
  #define PKEY_UNRESTRICTED	0x0

next to other powerpc specific overrides such as PKEY_DISABLE_EXECUTE 0x4, and that header only includes <sys/mman.h>, never <linux/mman.h>. A probe including just <sys/mman.h> does not find PKEY_UNRESTRICTED, with or without TOOLS_INCLUDES, so the definition there is load bearing and removing it would break the build.

Load-bearing :)) Where have I heard that phrasing before...

Quoted 3 lines

Thanks,
Hemanth

--
Cheers, Lorenzo

#7 lore raw

PATCH v2 1/1 selftests/mm: remove the local PKEY_UNRESTRICTED fallback

In reply to Hemanth Selam

pkey-helpers.h defines PKEY_UNRESTRICTED itself when the macro is not already known, a stopgap from when the generic definition was still under review. It has been merged since, commit 6d61527d931b ("mm/pkey:
Add PKEY_UNRESTRICTED macro"), so the guard is never taken and the FIXME can be honoured.

The definition comes from tools/include/uapi/asm-generic/mman-common.h via TOOLS_INCLUDES, which commit e076eaca5906 ("selftests: break the dependency upon local header files") added so that the mm selftests build without "make headers". It is reached through the <asm-generic/mman.h> that the system <asm/mman.h> includes. Building the pkey tests with KHDR_INCLUDES pointing at an empty directory confirms that; emptying TOOLS_INCLUDES as well is what makes the macro go missing.

No functional change intended.

---
Changes in v2:
- Drop the incorrect claim that the mm selftests are built against the headers of the kernel source and would fail without "make headers". They are not, as Lorenzo pointed out; describe where the definition really comes from instead.
- Leave tools/testing/selftests/powerpc/include/pkeys.h alone, as discussed with David on v1. Unlike the mm one it is an unconditional #undef/#define next to other powerpc specific overrides, and that header only includes <sys/mman.h>, which does not provide PKEY_UNRESTRICTED with or without TOOLS_INCLUDES, so its definition is load bearing.

The full include path, for reference:

pkey-helpers.h

    -> <linux/mman.h>           tools/include/uapi/linux/mman.h
      -> <asm/mman.h>           /usr/include/asm/mman.h
                                (tools/include/uapi/asm/mman.h does not exist)
        -> <asm-generic/mman.h> tools/include/uapi/asm-generic/mman.h
          -> <asm-generic/mman-common-tools.h>
            -> <asm-generic/mman-common.h>      PKEY_UNRESTRICTED

With KHDR_INCLUDES pointing at an empty directory the tests still build, and cpp -dD reports the macro coming from tools/include/uapi/asm-generic/mman-common.h. Emptying TOOLS_INCLUDES as well gives:

pkey-helpers.h:188:30: error: 'PKEY_UNRESTRICTED' undeclared

pkey_sighandler_tests and mseal_test are byte identical before and after; protection_keys differs only in the __LINE__ values that pkey-helpers.h embeds into its debug output.

v1: https://lore.kernel.org/all/[email protected]/

 tools/testing/selftests/mm/pkey-helpers.h | 7 -------
 1 file changed, 7 deletions(-)
tools/testing/selftests/mm/pkey-helpers.h +0 -7
index 2c377f4e9df1..626c2e1655dc 100644
@@ -112,13 +112,6 @@ void record_pkey_malloc(void *ptr, long size, int prot);
 #define PKEY_MASK	(PKEY_DISABLE_ACCESS | PKEY_DISABLE_WRITE)
 #endif
 
-/*
- * FIXME: Remove once the generic PKEY_UNRESTRICTED definition is merged.
- */
-#ifndef PKEY_UNRESTRICTED
-#define PKEY_UNRESTRICTED 0x0
-#endif
-
 #ifndef set_pkey_bits
 static inline u64 set_pkey_bits(u64 reg, int pkey, u64 flags)
 {
Signature · 1 line
2.43.7
maintainer Acked-by on v2 1/1
#8 lore raw
Quoted 15 lines · Hemanth Selam

pkey-helpers.h defines PKEY_UNRESTRICTED itself when the macro is not already known, a stopgap from when the generic definition was still under review. It has been merged since, commit 6d61527d931b ("mm/pkey:
Add PKEY_UNRESTRICTED macro"), so the guard is never taken and the FIXME can be honoured.

The definition comes from tools/include/uapi/asm-generic/mman-common.h via TOOLS_INCLUDES, which commit e076eaca5906 ("selftests: break the dependency upon local header files") added so that the mm selftests build without "make headers". It is reached through the <asm-generic/mman.h> that the system <asm/mman.h> includes. Building the pkey tests with KHDR_INCLUDES pointing at an empty directory confirms that; emptying TOOLS_INCLUDES as well is what makes the macro go missing.

Quoted 3 lines

No functional change intended.

Hi,

please prefer not sending new revisions in reply to old revisions the next time.

[...]

Quoted 11 lines
 tools/testing/selftests/mm/pkey-helpers.h | 7 -------
 1 file changed, 7 deletions(-)
tools/testing/selftests/mm/pkey-helpers.h +0 -0
index 2c377f4e9df1..626c2e1655dc 100644
@@ -112,13 +112,6 @@ void record_pkey_malloc(void *ptr, long size, int prot);
 #define PKEY_MASK	(PKEY_DISABLE_ACCESS | PKEY_DISABLE_WRITE)
 #endif
 

tools/testing/selftests/mm/pkey-helpers.h void record_pkey_malloc(void *ptr, long size, int prot); · line 117

Quoted 10 lines
tools/testing/selftests/mm/pkey-helpers.h +0 -7
-/*
- * FIXME: Remove once the generic PKEY_UNRESTRICTED definition is merged.
- */
-#ifndef PKEY_UNRESTRICTED
-#define PKEY_UNRESTRICTED 0x0
-#endif
-
 #ifndef set_pkey_bits
 static inline u64 set_pkey_bits(u64 reg, int pkey, u64 flags)
 {

Hoping this indeed compiles ;)

Signature · 3 lines
Cheers,

David
reviewer Acked-by
#9 lore raw
Quoted 16 lines · David Hildenbrand (Arm)
Quoted 15 lines · Hemanth Selam

pkey-helpers.h defines PKEY_UNRESTRICTED itself when the macro is not already known, a stopgap from when the generic definition was still under review. It has been merged since, commit 6d61527d931b ("mm/pkey:
Add PKEY_UNRESTRICTED macro"), so the guard is never taken and the FIXME can be honoured.

The definition comes from tools/include/uapi/asm-generic/mman-common.h via TOOLS_INCLUDES, which commit e076eaca5906 ("selftests: break the dependency upon local header files") added so that the mm selftests build without "make headers". It is reached through the <asm-generic/mman.h> that the system <asm/mman.h> includes. Building the pkey tests with KHDR_INCLUDES pointing at an empty directory confirms that; emptying TOOLS_INCLUDES as well is what makes the macro go missing.

Quoted 3 lines
Quoted 3 lines

No functional change intended.

Since you said load-bearing in the last email - I do have to ask if AI was involved with this.

If so please adhere to kernel guidelines:

https://docs.kernel.org/process/coding-assistants.html
https://docs.kernel.org/process/generated-content.html

I.e. add an Assisted-by tag.

Anyway given your explanation in the other sub-thread seems ok so:

Quoted 4 lines

Hi,

please prefer not sending new revisions in reply to old revisions the next time.

Yup. Please send respins as an entirely separate main not in-reply to anything, thanks!

Also add a revision history under the --- with links to prior revisions, and if >1 patch send a cover letter that has the revisions and all patch emails are in-reply-to.

Quoted 27 lines

[...]

Quoted 11 lines
 tools/testing/selftests/mm/pkey-helpers.h | 7 -------
 1 file changed, 7 deletions(-)
tools/testing/selftests/mm/pkey-helpers.h +0 -0
index 2c377f4e9df1..626c2e1655dc 100644
@@ -112,13 +112,6 @@ void record_pkey_malloc(void *ptr, long size, int prot);
 #define PKEY_MASK	(PKEY_DISABLE_ACCESS | PKEY_DISABLE_WRITE)
 #endif
 

tools/testing/selftests/mm/pkey-helpers.h void record_pkey_malloc(void *ptr, long size, int prot); · line 117

Quoted 10 lines
tools/testing/selftests/mm/pkey-helpers.h +0 -7
-/*
- * FIXME: Remove once the generic PKEY_UNRESTRICTED definition is merged.
- */
-#ifndef PKEY_UNRESTRICTED
-#define PKEY_UNRESTRICTED 0x0
-#endif
-
 #ifndef set_pkey_bits
 static inline u64 set_pkey_bits(u64 reg, int pkey, u64 flags)
 {

Hoping this indeed compiles ;)

Quoted 6 lines

--
Cheers,

David

--
Cheers, Lorenzo

#10 lore raw
Quoted 9 lines · Lorenzo Stoakes (ARM)

Since you said load-bearing in the last email - I do have to ask if AI was involved with this.

If so please adhere to kernel guidelines:

https://docs.kernel.org/process/coding-assistants.html
https://docs.kernel.org/process/generated-content.html

I.e. add an Assisted-by tag.

Yes, it was. I used an AI assistant while tracing the include path and preparing the patch. The builds and the cpp output I quoted are ones I ran and checked myself, and the Signed-off-by is mine, but I should have tagged the assistance from the start. Sorry for that, and thanks for asking directly.

The respin will carry

Assisted-by Cursor:claude-opus-5

I will send it as a new mail rather than in reply to this thread, as you and David asked.

Thanks for the Acked-by.

Hemanth