From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [Patch v5 1/4] Remove SMEP bit from CR4_RESERVED_BITS Date: Mon, 30 May 2011 10:49:13 +0300 Message-ID: <4DE34BF9.20106@redhat.com> References: <5D8008F58939784290FAB48F5497519844E92781DF@shsmsx502.ccr.corp.intel.com> <20110530074033.GB27557@elte.hu> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "Yang, Wei Y" , Pekka Enberg , "kvm@vger.kernel.org" To: Ingo Molnar Return-path: Received: from mx1.redhat.com ([209.132.183.28]:55786 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752731Ab1E3Htb (ORCPT ); Mon, 30 May 2011 03:49:31 -0400 In-Reply-To: <20110530074033.GB27557@elte.hu> Sender: kvm-owner@vger.kernel.org List-ID: On 05/30/2011 10:40 AM, Ingo Molnar wrote: > * Yang, Wei Y wrote: > > > This patch removes SMEP bit from CR4_RESERVED_BITS. > > I'm wondering, what is the best-practice way for tools/kvm/ to set > SMEP for the guest kernel automatically, even if the guest kernel > itsef has not requested SMEP? > > The portion i'm worried about are old KVM versions that have the SMEP > bit in CR4_RESERVED_BITS and reject it. So we cannot just > unilaterally add SMEP to every cr4 write of the guest. tools/kvm doesn't see cr4 writes at all. The only way to do this is in kvm itself. > Is there a way > to query whether the host KVM version supports SMEP setting in cr4? > KVM_GET_SUPPORTED_CPUID (it returns whether both the host cpu and kvm support smep; if one of them doesn't, you'll see smep disabled). -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.