[PATCH] linux: Add mseal syscall support

Adhemerval Zanella Netto adhemerval.zanella@linaro.org
Mon Oct 13 20:53:04 GMT 2025



On 13/10/25 17:48, Adhemerval Zanella Netto wrote:
> 
> 
> On 10/10/25 16:41, Collin Funk wrote:
>> Adhemerval Zanella <adhemerval.zanella@linaro.org> writes:
>>
>>> +      if (errno == ENOSYS)
>>> +        FAIL_UNSUPPORTED
>>> +          ("kernel does not support memory protection keys");
>>> +      if (errno == EINVAL)
>>> +        FAIL_UNSUPPORTED
>>> +          ("CPU does not support memory protection keys: %m");
>>
>> Do any other syscalls fail with different errno's depending on if the
>> kernel or the CPU do not support them? I feel like it is better to use
>> ENOSYS in both cases, but maybe I am missing something.
> 
> I am trying to recall why I had to add this on previous version, I had the
> impression that was because on 32-bit kernels the syscall might return it
> but double checking it does return ENOSYS in this case as well.
> 
> I will remove this check.

This comes from sysdeps/unix/sysv/linux/tst-pkey.c, where pkey_alloc is supported
by the hardware does not support protection keys.  So the check seems fine indeed.

And I do not recall any other syscall with this constraint on top of my mind.

> 
>>
>> Also, for formatting long lines like this I think the following looks
>> better:
>>
>>       FAIL_UNSUPPORTED ("CPU does not support "
>>                         "memory protection keys: %m");
>>
>> Collin
> 
> Ack, I will double check the size.

Hum this does seem to fit in 78-colmun, doesn't it?


More information about the Libc-alpha mailing list