From mboxrd@z Thu Jan 1 00:00:00 1970 From: Patrick Colp Subject: Re: xenpaging crashes xen in is_iomem_page() Date: Mon, 26 Jul 2010 11:23:23 -0400 Message-ID: References: <20100726115837.GA5643@aepfle.de> <20100726140856.GA8399@aepfle.de> <20100726145807.GU13291@whitby.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20100726145807.GU13291@whitby.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Tim Deegan Cc: Olaf Hering , "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On 26 July 2010 10:58, Tim Deegan wrote: > Hi, > > At 15:39 +0100 on 26 Jul (1280158794), Patrick Colp wrote: >> On 26 July 2010 10:08, Olaf Hering wrote: >> > Is there a portable way to check for the EPT flag in xenpaging? >> >> Yeah, this can be added. Probably not a bad idea, really. I actually >> have some code to test if a machine has EPT enabled or not (by >> borrowing some of the Xen start-up code which checks for things like >> EPT) > > Good idea. =C2=A0From inside Xen you should be checking hap_enabled(d) (s= ince > even on an EPT machine the tools can request shadow pagetables for > individual domains). =C2=A0Outside Xen I'm not sure there's a reliable wa= y of > detecting HAP; maybe the xenpaging hypercalls should return an error? Right, checks against hap_enabled make sense too. From outside Xen, I can detect if EPT is enabled for the machine. This doesn't guarantee it's enabled for a given guest nor if it returns "EPT disabled" does it mean the machine doesn't have EPT (it just means that EPT isn't enabled at the time). However, it might be better to just put the checks in Xen and return an error through the domctls if HAP isn't enabled, as you suggest. Patrick