From: Tim Deegan Subject: Re: [PATCH 02/11] VMX: implement suppress #VE. Date: Thu, 15 Jan 2015 17:25:06 +0100 Message-ID: <20150115162506.GB57240@deinos.phlegethon.org> References: <1420838801-11704-1-git-send-email-edmund.h.white@intel.com> <1420838801-11704-3-git-send-email-edmund.h.white@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1420838801-11704-3-git-send-email-edmund.h.white@intel.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ed White Cc: keir@xen.org, ian.jackson@eu.citrix.com, ian.campbell@citrix.com, jbeulich@suse.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Hi, At 13:26 -0800 on 09 Jan (1420806392), Ed White wrote: > static inline bool_t is_epte_valid(ept_entry_t *e) > { > - return (e->epte != 0 && e->sa_p2mt != p2m_invalid); > + return (e->valid != 0 && e->sa_p2mt != p2m_invalid); This test for 0 is just catching uninitialised entries in freshly allocated pages. Rather than changing it to ignore bit 63, this loop... > } > > /* returns : 0 for success, -errno otherwise */ > @@ -194,6 +194,19 @@ static int ept_set_middle_entry(struct p2m_domain *p2m, ept_entry_t *ept_entry) > > ept_entry->r = ept_entry->w = ept_entry->x = 1; > > + /* Disable #VE on all entries */ > + if ( cpu_has_vmx_virt_exceptions ) > + { > + ept_entry_t *table = __map_domain_page(pg); > + > + for ( int i = 0; i < EPT_PAGETABLE_ENTRIES; i++ ) > + table[i].suppress_ve = 1; ...should set the type of the empty entries to p2m_invalid as it goes. > + /* Disable #VE on all entries */ > + if ( cpu_has_vmx_virt_exceptions ) > + { > + ept_entry_t *table = > + map_domain_page(pagetable_get_pfn(p2m_get_pagetable(p2m))); > + > + for ( int i = 0; i < EPT_PAGETABLE_ENTRIES; i++ ) > + table[i].suppress_ve = 1; And the same here. Cheers, Tim.