From: Tim Deegan Subject: Re: [PATCH 7/8] x86/EPT: split super pages upon mismatching memory types Date: Thu, 27 Mar 2014 16:04:37 +0100 Message-ID: <20140327150437.GI91759@deinos.phlegethon.org> References: <5332FF1902000078000027A2@nat28.tlf.novell.com> <5333022A02000078000027FB@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WTBrJ-0002yI-2I for xen-devel@lists.xenproject.org; Thu, 27 Mar 2014 15:04:45 +0000 Content-Disposition: inline In-Reply-To: <5333022A02000078000027FB@nat28.tlf.novell.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: Jan Beulich Cc: Kevin Tian , Keir Fraser , Eddie Dong , Jun Nakajima , Yang Z Zhang , xen-devel List-Id: xen-devel@lists.xenproject.org At 15:36 +0000 on 26 Mar (1395844618), Jan Beulich wrote: > ... between constituent pages. To indicate such, the page order is > being passed down to the vMTRR routines, with a negative return value > (possible only on order-non-zero pages) indicating such collisions. > > Some code redundancy reduction is being done to ept_set_entry() along > the way, allowing the new handling to be centralized to a single place > there. > > In order to keep ept_set_entry() fast and simple, the actual splitting > is being deferred to the EPT_MISCONFIG VM exit handler. You expect that to be rare, right? We're not going to incur a lot of extra pagefaults? > Signed-off-by: Jan Beulich > --- > One open question is whether it is okay for memory allocation (for an > intermediate page table) failure to be fatal to the domain. If it > isn't, then deferring the splitting work from ept_set_entry() to > ept_handle_misconfig() is not an option. But even with that eliminated > there's then still potential for ept_handle_misconfig() needing to > split pages, and it would then need to be determined how to gracefully > handle that. Hmmm, true. Since we can't tell in advance how much memory will be needed, it's not possible to detect all the errors up front. And I can't think of a nice way to fail later on that doesn't go back to having large loops over many gfns. So I think we have to live with it. Reviewed-by: Tim Deegan Cheers, Tim.