From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: Accessing pv_info from userland Date: Sat, 31 Jan 2009 13:36:05 -0600 Message-ID: <4984A825.3020904@codemonkey.ws> References: <893823750901310419q63e9b648u9c959bc2689ef94d@mail.gmail.com> <5d6222a80901310504x76363751p9c28a63a3f01530@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Bryan McLellan , kvm@vger.kernel.org To: Glauber Costa Return-path: Received: from an-out-0708.google.com ([209.85.132.241]:17519 "EHLO an-out-0708.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751508AbZAaTgY (ORCPT ); Sat, 31 Jan 2009 14:36:24 -0500 Received: by an-out-0708.google.com with SMTP id c2so397568anc.1 for ; Sat, 31 Jan 2009 11:36:22 -0800 (PST) In-Reply-To: <5d6222a80901310504x76363751p9c28a63a3f01530@mail.gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: Glauber Costa wrote: > On Sat, Jan 31, 2009 at 10:19 AM, Bryan McLellan wrote: > >> Is there any way to access pv_info from userland? It would be useful >> for determining what type of virtualization the machine was running >> on. >> > > there are usually cpuid functions reserved for that. > > for kvm, you can run function 0x40000000, and if you get > ebx = 0x4b4d564b > ecx = 0x564b4d56 > edx = 0x4d > > you're running KVM. > Since this is a pretty standard mechanism, it may make sense to include this signature in /proc/cpuinfo if someone is up to writing a patch. It could also be useful to expose the PV features mask in cpuinfo too. Regards, Anthony Liguori