lkml.org 
[lkml]   [2008]   [Sep]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: Use CPUID to communicate with the hypervisor.
    On Fri, Sep 26, 2008 at 05:09:00PM -0700, H. Peter Anvin wrote:
    > Alok Kataria wrote:
    >> +{
    >> + if (cpu_has_hypervisor) {
    >> + unsigned int eax, ebx, ecx, edx;
    >> + char hyper_vendor_id[13];
    >> +
    >> + cpuid(HYPERVISOR_INFO_LEAF, &eax, &ebx, &ecx, &edx);
    >> + memcpy(hyper_vendor_id + 0, &ebx, 4);
    >> + memcpy(hyper_vendor_id + 4, &ecx, 4);
    >> + memcpy(hyper_vendor_id + 8, &edx, 4);
    >> + hyper_vendor_id[12] = '\0';
    >> + printk(KERN_INFO "Hypervisor vendor id %s\n", hyper_vendor_id);
    >> + }
    >> +}
    >> +
    >
    > This should be broken out into a separate file in cpu/*, because we
    > *will* need to detect hypervisors by other means.

    Yes. It would be nice to have "Hypervisor vendor id" somewhere in
    /sys or /proc. It seems that userspace is already hungry for that
    information:

    http://article.gmane.org/gmane.linux.utilities.util-linux-ng/1788

    Karel

    --
    Karel Zak <kzak@redhat.com>


    \
     
     \ /
      Last update: 2008-09-29 23:15    [W:3.766 / U:0.264 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site