From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH v2 12/13] KVM: x86: add SMM to the MMU role, support SMRAM address space Date: Wed, 17 Jun 2015 10:18:23 +0200 Message-ID: <55812D4F.10506@redhat.com> References: <1432746314-50196-1-git-send-email-pbonzini@redhat.com> <1432746314-50196-13-git-send-email-pbonzini@redhat.com> <55766510.7010108@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: rkrcmar@redhat.com, bdas@redhat.com To: Xiao Guangrong , linux-kernel@vger.kernel.org, kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:38763 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752270AbbFQIS1 (ORCPT ); Wed, 17 Jun 2015 04:18:27 -0400 In-Reply-To: <55766510.7010108@linux.intel.com> Sender: kvm-owner@vger.kernel.org List-ID: On 09/06/2015 06:01, Xiao Guangrong wrote: > > > On 05/28/2015 01:05 AM, Paolo Bonzini wrote: >> This is now very simple to do. The only interesting part is a simple >> trick to find the right memslot in gfn_to_rmap, retrieving the address >> space from the spte role word. The same trick is used in the auditing >> code. >> >> The comment on top of union kvm_mmu_page_role has been stale forever, > > Fortunately, we have documented these fields in mmu.txt, please do it for > 'smm' as well. :) Right, done. >> + /* >> + * This is left at the top of the word so that >> + * kvm_memslots_for_spte_role can extract it with a >> + * simple shift. While there is room, give it a whole >> + * byte so it is also faster to load it from memory. >> + */ >> + unsigned smm:8; > > I suspect if we really need this trick, smm is not the hottest filed in > this struct anyway. Note that after these patches it is used by gfn_to_rmap, and hence for example rmap_add. Paolo