From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932370AbcILRhj (ORCPT ); Mon, 12 Sep 2016 13:37:39 -0400 Received: from mga06.intel.com ([134.134.136.31]:3372 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751962AbcILRhe (ORCPT ); Mon, 12 Sep 2016 13:37:34 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,323,1470726000"; d="scan'208";a="167307257" From: Andi Kleen To: Kyle Huey Cc: linux-kernel@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH] prctl,x86 Add PR_[GET|SET]_CPUID for controlling the CPUID instruction. References: <1473640169-24145-1-git-send-email-khuey@kylehuey.com> Date: Mon, 12 Sep 2016 10:37:31 -0700 In-Reply-To: <1473640169-24145-1-git-send-email-khuey@kylehuey.com> (Kyle Huey's message of "Sun, 11 Sep 2016 17:29:23 -0700") Message-ID: <87twdl9fz8.fsf@tassilo.jf.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Kyle Huey writes: > 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. > > Intel supports faulting on the CPUID instruction in newer processors. Bit > 31 of MSR_PLATFORM_INFO advertises support for this feature. It is > documented in detail in Section 2.3.2 of > http://www.intel.com/content/dam/www/public/us/en/documents/application-notes/virtualization-technology-flexmigration-application-note.pdf. This will explode when an interrupt handler executes cpuid, won't it? The cpuid char driver does this, other code may too. You probably would need to protect these CPUIDs with an exception handler that temporarily disables this bit and retries. -Andi