From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752907AbcIOUnY (ORCPT ); Thu, 15 Sep 2016 16:43:24 -0400 Received: from terminus.zytor.com ([198.137.202.10]:52324 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750794AbcIOUnU (ORCPT ); Thu, 15 Sep 2016 16:43:20 -0400 User-Agent: K-9 Mail for Android In-Reply-To: References: <1473886902-17902-1-git-send-email-khuey@kylehuey.com> <1473886902-17902-3-git-send-email-khuey@kylehuey.com> <57D9C2AC.8050905@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Subject: Re: [PATCH v2 2/3] x86 Test and expose CPUID faulting capabilities in /proc/cpuinfo From: "H. Peter Anvin" Date: Thu, 15 Sep 2016 13:38:00 -0700 To: Andy Lutomirski , Kyle Huey CC: Dave Hansen , "Robert O'Callahan" , Thomas Gleixner , Ingo Molnar , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , Boris Ostrovsky , David Vrabel , Juergen Gross , Borislav Petkov , Andy Lutomirski , Peter Zijlstra , Huang Rui , "Rafael J. Wysocki" , Len Brown , Srinivas Pandruvada , Aravind Gopalakrishnan , Alexander Shishkin , Vladimir Zapolskiy , Kristen Carlson Accardi , "open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , "moderated list:XEN HYPERVISOR INTERFACE" Message-ID: <32FABFC8-D606-4918-AAEF-FAA7982308A1@zytor.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On September 14, 2016 6:17:51 PM PDT, Andy Lutomirski wrote: >On Wed, Sep 14, 2016 at 3:03 PM, Kyle Huey wrote: >> On Wed, Sep 14, 2016 at 2:35 PM, Dave Hansen >> wrote: >>> On 09/14/2016 02:01 PM, Kyle Huey wrote: > >>> Is any of this useful to optimize away at compile-time? We have >config >>> options for when we're running as a guest, and this seems like a >feature >>> that isn't available when running on bare metal. >> >> On the contrary, this is only available when we're on bare metal. >> Neither Xen nor KVM virtualize CPUID faulting (although KVM correctly >> suppresses MSR_PLATFORM_INFO's report of support for it). > >KVM could easily support this. If rr starts using it, I think KVM >*should* add support, possibly even for older CPUs that don't support >the feature in hardware. > >It's too bad that x86 doesn't give us the instruction bytes on a >fault. Otherwise we could lazily switch this feature. > >--Andy You can "always" examine the instruction bytes in memory... have to make sure you properly consider the impact of race conditions though. -- Sent from my Android device with K-9 Mail. Please excuse brevity and formatting.