From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760011AbcIMSmk (ORCPT ); Tue, 13 Sep 2016 14:42:40 -0400 Received: from mail-vk0-f65.google.com ([209.85.213.65]:36858 "EHLO mail-vk0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756845AbcIMSmg (ORCPT ); Tue, 13 Sep 2016 14:42:36 -0400 MIME-Version: 1.0 In-Reply-To: References: <1473640169-24145-1-git-send-email-khuey@kylehuey.com> <20160912090722.2yal3mucf2x6j7pi@pd.tnic> From: Kyle Huey Date: Tue, 13 Sep 2016 11:42:33 -0700 Message-ID: Subject: Re: [PATCH] prctl,x86 Add PR_[GET|SET]_CPUID for controlling the CPUID instruction. To: Borislav Petkov Cc: "Robert O'Callahan" , linux-api@vger.kernel.org, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , "Peter Zijlstra (Intel)" , "Rafael J. Wysocki" , Len Brown , Srinivas Pandruvada , Huang Rui , Aravind Gopalakrishnan , Alexander Shishkin , Vladimir Zapolskiy , Andy Lutomirski , Juergen Gross , Fenghua Yu , "Luis R. Rodriguez" , Denys Vlasenko , Andrew Morton , Kees Cook , Dmitry Vyukov , Paul Gortmaker , "Michael S. Tsirkin" , Andrey Ryabinin , Jiri Slaby , Michal Hocko , Alex Thorlton , Vlastimil Babka , Mateusz Guzik , Ben Segall , John Stultz , "open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 12, 2016 at 7:15 AM, Kyle Huey wrote: > On Mon, Sep 12, 2016 at 2:07 AM, Borislav Petkov 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