Re: [PATCH] prctl,x86 Add PR_[GET|SET]_CPUID for controlling the CPUID instruction.

From: Kyle Huey
Date: Tue Sep 13 2016 - 14:42:47 EST


On Mon, Sep 12, 2016 at 7:15 AM, Kyle Huey <me@xxxxxxxxxxxx> wrote:
> On Mon, Sep 12, 2016 at 2:07 AM, Borislav Petkov <bp@xxxxxxx> wrote:
>> On Sun, Sep 11, 2016 at 05:29:23PM -0700, Kyle Huey wrote:
>>> @@ -2162,6 +2168,12 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
>>> case PR_SET_TSC:
>>> error = SET_TSC_CTL(arg2);
>>> break;
>>> + case PR_GET_CPUID:
>>> + error = GET_CPUID_CTL(arg2);
>>> + break;
>>> + case PR_SET_CPUID:
>>> + error = SET_CPUID_CTL(arg2);
>>> + break;
>>> case PR_TASK_PERF_EVENTS_DISABLE:
>>> error = perf_event_task_disable();
>>> break;
>>
>> This whole fun should be in arch_prctl() as it is arch-specific.
>
> Yeah, I was debating about that, and did it this way because of
> PR_SET_TSC. Will fix.

arch_prctl is not yet exposed on 32 bit x86, so we'll have to add that
as well to do this.

- Kyle