From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Lutomirski Subject: Re: [PATCH 2/4] KVM: SVM: use NPT page attributes Date: Thu, 16 Jul 2015 17:35:28 -0700 Message-ID: <55A84DD0.9040008@kernel.org> References: <1436276739-50326-1-git-send-email-pbonzini@redhat.com> <1436276739-50326-3-git-send-email-pbonzini@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: guangrong.xiao@linux.intel.com, jroedel@suse.de, alex.williamson@redhat.com, ogerlitz@mellanox.com, amirv@mellanox.com To: Paolo Bonzini , linux-kernel@vger.kernel.org, kvm@vger.kernel.org Return-path: In-Reply-To: <1436276739-50326-3-git-send-email-pbonzini@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 07/07/2015 06:45 AM, Paolo Bonzini wrote: > Right now, NPT page attributes are not used, and the final page > attribute depends solely on gPAT (which however is not synced > correctly), the guest MTRRs and the guest page attributes. > > However, we can do better by mimicking what is done for VMX. > In the absence of PCI passthrough, the guest PAT can be ignored > and the page attributes can be just WB. If passthrough is being > used, instead, keep respecting the guest PAT, and emulate the guest > MTRRs through the PAT field of the nested page tables. > > The only snag is that WP memory cannot be emulated correctly, > because Linux's default PAT setting only includes the other types. > As of quite recently, Linux understands that the PAT has eight slots, and we can probably give you WP. Do you want it? --Andy