From: "Jan Beulich" Subject: Re: x86 emulator and new isa additions Date: Tue, 15 Nov 2011 13:53:16 +0000 Message-ID: <4EC27CDC02000078000611A1@nat28.tlf.novell.com> References: <4EC27134020000780006112C@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org >>> On 15.11.11 at 14:30, Keir Fraser wrote: > On 15/11/2011 13:03, "Jan Beulich" wrote: >=20 >> Hi Keir, >>=20 >> so far the convention seems to be to assume that guest attempts to >> execute instructions not supported by the underlying CPU would never >> make it into the emulator. Is that really correct (in particular in the >> context of real mode emulation, where it's not just single instructions >> that get emulated)? >>=20 >> From earlier work on the emulation code I seem to recall that it's = mainly >> the testing code that didn't like use of cpu_has_xyz in conditionals. I >> would suppose that simply adding respective feature detection (and >> boolean variables) to the testing code should get us around this >> problem. Or would you see any better alternative? >=20 > I'm fine to have further feature checks in the emulator, but I would = like to > keep the emulator core clean. And indeed the emulator probably ought to = act > based on features advertised to the *guest* rather than the *host*? That's a good point. > So, properly, I think the fact we already have a cpuid callback ought to = be > sufficient to implement all the cpu_has functionality that the emulator > could want, perhaps hidden behind some helper/abstraction functions/macro= s. Which may make it necessary to add cpuid callbacks to all emulator users (seems like only hvm currently has one). But it indeed looks like the right route to go, so I'll look into doing so. Jan