linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/6] x86/arch_prctl Add ARCH_[GET|SET]_CPUID for controlling the CPUID instruction
@ 2016-09-19  4:17 Kyle Huey
       [not found] ` <20160919041718.4608-1-khuey-OhBmq/TcCDJWk0Htik3J/w@public.gmane.org>
  2016-09-19  4:17 ` [PATCH v4 5/6] x86/cpufeature Detect CPUID faulting support Kyle Huey
  0 siblings, 2 replies; 8+ messages in thread
From: Kyle Huey @ 2016-09-19  4:17 UTC (permalink / raw)
  To: Robert O'Callahan, Thomas Gleixner, Ingo Molnar,
	H . Peter Anvin, x86-DgEjT+Ai2ygdnm+yROfE0A, Jeff Dike,
	Richard Weinberger, Andy Lutomirski, Borislav Petkov,
	Dmitry Safonov, Dave Hansen, Peter Zijlstra, Boris Ostrovsky,
	Alexander Viro, Shuah Khan, Len Brown, Rafael J . Wysocki,
	Srinivas Pandruvada
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	user-mode-linux-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	user-mode-linux-user-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	linux-kselftest-u79uwXL29TY76Z2rM5mHXA,
	linux-api-u79uwXL29TY76Z2rM5mHXA

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, with two values, ARCH_CPUID_ENABLE and
ARCH_CPUID_SIGSEGV.

The following changes have been made since v3:

Patch 1 was split into patches 1-4, patches 2 and 3 became patches 5 and 6, respectively.

Patch 1:
- Use SYSCALL_DEFINE in UML.

Patch 2:
- More descriptive commit message.

Patch 3:
- More decriptive commit message.
- Name the common arch_prctl function do_arch_prctl instead of
  do_arch_prctl_common

Patch 4:
- Move the 32-bit syscall entry point to process_32.c, place the compat
  entry point in process_64.c

Patch 5 (previously Patch 2):
- More descriptive commit message.
- Prefix the #define for the cpuid faulting bit with PLATINFO
- supports_cpuid_faulting returns bool
- Rearrange supports_cpuid_faulting to avoid linebreaks

Patch 6 (previously Patch 3):
- ARCH_GET_CPUID now takes 0 for the second argument, and returns the
  result directly.
- arch_post_exec is now a #define, called from setup_new_exec
- The test now uses errx
- The test now checks that ARCH_GET_CPUID returns ARCH_CPUID_SIGSEGV after
  fork()

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-09-19 14:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-19  4:17 [PATCH v4 0/6] x86/arch_prctl Add ARCH_[GET|SET]_CPUID for controlling the CPUID instruction Kyle Huey
     [not found] ` <20160919041718.4608-1-khuey-OhBmq/TcCDJWk0Htik3J/w@public.gmane.org>
2016-09-19  4:17   ` [PATCH v4 1/6] x86/arch_prctl/64 Use SYSCALL_DEFINE2 to define sys_arch_prctl Kyle Huey
     [not found]     ` <20160919041718.4608-2-khuey-OhBmq/TcCDJWk0Htik3J/w@public.gmane.org>
2016-09-19 14:05       ` kbuild test robot
2016-09-19  4:17   ` [PATCH v4 2/6] x86/arch_prctl/64 Rename do_arch_prctl to do_arch_prctl_64 Kyle Huey
2016-09-19  4:17   ` [PATCH v4 3/6] x86/arch_prctl Add a new do_arch_prctl Kyle Huey
2016-09-19  4:17   ` [PATCH v4 4/6] x86/syscalls/32 Wire up arch_prctl on x86-32 Kyle Huey
2016-09-19  4:17   ` [PATCH v4 6/6] x86/arch_prctl Add ARCH_[GET|SET]_CPUID Kyle Huey
2016-09-19  4:17 ` [PATCH v4 5/6] x86/cpufeature Detect CPUID faulting support Kyle Huey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).