lkml.org 
[lkml]   [2013]   [Jan]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRE: [PATCH 2/3] X86: Add a check to catch Xen emulation of Hyper-V
>>> On 31.01.13 at 16:53, KY Srinivasan <kys@microsoft.com> wrote:
> Are there any published standards in terms of how the CPUID space should be
> populated in the range from 0x40000000 to 0x40010000. Specifically, unless

I recall having seen this range being marked as reserved for
hypervisor use somewhere, but I don't remember where that was.

> the standard mandates that all ranges unused by a given hypervisor would
> return a known value, how can this code be used to detect the presence of an
> unknown hypervisor. Hyper-V is going to return the Hyper-V string at
> 0x40000000. So, I was planning to scan starting at 0x40000100. Clearly, I can
> check for a specific hypervisor that I know causes a problem for Hyper-V (as I
> have currently done by checking for Xen). How can I check for the presence of
> yet to be created Hypervisors that may emulate Hyper-V by scanning the CPUID
> space. I am almost tempted to say that Xen is the special case and the patch
> I have submitted addresses that. If a new (or existing hypervisor) plans to
> do what Xen is doing, perhaps we can dissuade them from doing that or we can
> fix that within the general framework we have here.

I'd simply preset ECX, EDX, and EBX to zero, and check whether
they change on any EAX input divisible by 256, skipping the one
range you know Hyper-V sits in.

Jan



\
 
 \ /
  Last update: 2013-01-31 18:21    [W:0.248 / U:0.420 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site