From mboxrd@z Thu Jan 1 00:00:00 1970 From: "H. Peter Anvin" Subject: Re: [PATCH 4/4] x86: properly handle kvm emulation of hyperv Date: Tue, 23 Jul 2013 11:45:51 -0700 Message-ID: <51EECF5F.8000901@zytor.com> References: <1374572465-15278-1-git-send-email-jasowang@redhat.com> <1374572465-15278-4-git-send-email-jasowang@redhat.com> <51EE97BD.4050402@zytor.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Jason Wang , "tglx@linutronix.de" , "mingo@redhat.com" , "x86@kernel.org" , "gleb@redhat.com" , "pbonzini@redhat.com" , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" To: KY Srinivasan Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 07/23/2013 10:45 AM, KY Srinivasan wrote: >> >> One strategy would be to pick the *last* one in the CPUID list, sinc= e >> the ones before it are logically the one(s) being emulated... >=20 > Is it always possible to guarantee this ordering. As a hypothetical, = what if hypervisor A > emulates Hypervisor B and Hypervisor B emulates Hypervisor A. In this= case we cannot > have any "order" based detection that can yield "correct" detection. = I define "correctness" > as follows: >=20 > If a guest can run on both the hypervisors, the guest should detect t= he true native > Hypervisor.=20 >=20 My point was that most hypervisors tend to put the native signature at the end of the list starting at 0x40000000, just to deal with na=EFve guests which only look at 0x40000000 and not beyond. So a natural convention would be to "use the last entry in the list you know how to handle." -hpa