From: Tim Deegan Subject: Re: [PATCH 02/11] VMX: implement suppress #VE. Date: Thu, 26 Mar 2015 10:15:16 +0000 Message-ID: <20150326101516.GA6519@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> <20150115162506.GB57240@deinos.phlegethon.org> <54B80B1A.3050707@intel.com> <5512F0A9.20000@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: <5512F0A9.20000@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 At 10:30 -0700 on 25 Mar (1427279417), Ed White wrote: > On 01/15/2015 10:46 AM, Ed White wrote: > > On 01/15/2015 08:25 AM, Tim Deegan wrote: > >> 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. > > I have some time to work on this patch series again, and although I tried > this it doesn't eliminate all the instances of epte being zero with the > possible exception of suppress_ve. I spent some time trying to find all > cases where that happens without success, so I've used Andrew's suggestion > of using a mask. Fair enough. Thanks for trying it. Tim.