From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 0/5] Fix EFER.NX=0 with EPT Date: Fri, 30 Apr 2010 19:36:32 +0300 Message-ID: <4BDB0710.4030908@redhat.com> References: <1272462439-30881-1-git-send-email-avi@redhat.com> <20100428232219.GA30191@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Marcelo Tosatti Return-path: Received: from mx1.redhat.com ([209.132.183.28]:51973 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932925Ab0D3RQk (ORCPT ); Fri, 30 Apr 2010 13:16:40 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o3UGaZWZ018855 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 30 Apr 2010 12:36:35 -0400 In-Reply-To: <20100428232219.GA30191@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: On 04/29/2010 02:22 AM, Marcelo Tosatti wrote: > On Wed, Apr 28, 2010 at 04:47:14PM +0300, Avi Kivity wrote: > >> Currently we run with EFER.NX=1 on the guest even if the guest value is 0. >> This is fine with shadow, since we check bit 63 when instantiating a page >> table, and fault if bit 63 is set while EFER.NX is clear. >> >> This doesn't work with EPT, since we no longer get the change to check guest >> ptes. So we need to run with EFER.NX=0. >> >> This is complicated by the fact that if we switch EFER.NX on the host, we'll >> trap immediately, since some host pages are mapped with the NX bit set. As >> a result, we need to switch the MSR atomically during guest entry and exit. >> >> > Applied, thanks. > > Out of curiosity, did you measure the vmentry/vmexit overhead? > Just did now. nx=0: 3384 nx=1: 2203 Perhaps using the dedicated vmcs field is faster (but since it's optional, we have to support the generic autoload area). -- Do not meddle in the internals of kernels, for they are subtle and quick to panic.