Re: [PATCH 4/6] s390: add system call to run tasks with modified branch prediction

From: Paolo Bonzini
Date: Wed Jan 17 2018 - 06:50:33 EST


On 17/01/2018 12:14, Christian Borntraeger wrote:
>
>
> On 01/17/2018 11:03 AM, Florian Weimer wrote:
>> On 01/17/2018 10:48 AM, Martin Schwidefsky wrote:
>>> ÂÂÂÂÂÂÂÂ rc = syscall(__NR_s390_modify_bp);
>>> ÂÂÂÂÂÂÂÂ if (rc) {
>>> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ perror("s390_modify_bp");
>>> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ exit(EXIT_FAILURE);
>>> ÂÂÂÂÂÂÂÂ }
>>
>> Isn't this traditionally done through personality or prctl?
>
> I think we want this per thread (and not per process). So I assume personality
> will not work out. Can a prctl be done per thread?

Yes, prctls can be either per-process (e.g. PR_SET_CHILD_SUBREAPER or
PR_SET_DUMPABLE) or per-thread (e.g. PR_SET_NAME or PR_SET_SECCOMP).

Paolo