Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755636AbdCKTrS (ORCPT ); Sat, 11 Mar 2017 14:47:18 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:35396 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754218AbdCKTrK (ORCPT ); Sat, 11 Mar 2017 14:47:10 -0500 From: Kyle Huey X-Google-Original-From: Kyle Huey To: "Robert O'Callahan" , Thomas Gleixner , Andy Lutomirski , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Jeff Dike , Richard Weinberger , Alexander Viro , Shuah Khan , Dave Hansen , Borislav Petkov , Peter Zijlstra , Boris Ostrovsky , Len Brown , Dmitry Safonov , "Rafael J. Wysocki" , David Matlack , Nadav Amit , Andi Kleen Cc: linux-kernel@vger.kernel.org, user-mode-linux-devel@lists.sourceforge.net, user-mode-linux-user@lists.sourceforge.net, linux-kselftest@vger.kernel.org, kvm@vger.kernel.org Subject: [PATCH v15 0/9] x86/arch_prctl Add ARCH_[GET|SET]_CPUID for controlling the CPUID instruction Date: Sat, 11 Mar 2017 11:46:53 -0800 Message-Id: <20170311194702.28754-1-khuey@kylehuey.com> X-Mailer: git-send-email 2.11.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 872 Lines: 22 rr (http://rr-project.org/), a userspace record-and-replay reverse- execution debugger, would like to trap and emulate the CPUID instruction. This would allow us to a) mask away certain hardware features that rr does not support (e.g. RDRAND) and b) enable trace portability across machines by providing constant results. Newer Intel CPUs (Ivy Bridge and later) can fault when CPUID is executed at CPL > 0. Expose this capability to userspace as a new pair of arch_prctls, ARCH_GET_CPUID and ARCH_SET_CPUID. Since v14: All: rebased onto x86/process, which contains the switch_to_xtra improvements Patch 4: x86/syscalls/32: Wire up arch_prctl on x86-32 - the new arch_prctl is now syscall number 384, because that was available Patch 5: x86/cpufeature: Detect CPUID faulting support - the newly added probe_xeon_phi_r3mwait is called from init_intel_misc_features