Skip to contentSkip to conversation

how to check for already existing hypervisor?

DISCUSSION [email protected] 2 participants 2 messages Jun 21, 2012 – Jun 25, 2012

lore
Share & tools
lore
#0 lore raw

Hi guys,

let me shortly introduce myself. I'm a student and recently work on my bachelor thesis. My goal is to write a little hypervisor. I'm not quite sure if this is the right mailing list, but i guess you'll gonna tell me.
i have two quick questions:

1. before i can use the vmxon instruction i do have to set vmxe flag in cr4 register. but what if some hypervisor is already running? is there a way to check if one is running??

2. before i set the vmxe bit in cr4, i check if it is already enabled. i do this while my module gets loaded. but i observed a strange thing. sometimes the vmxe bit seems to be set while the other time it isn't. do you have any explanation for that behaviour? do i have to check if the bit is set before actually setting it? I've looked at a few hypervisor projects and it seems that no one does it. my primary thought was, if the bit is set a hypervisor is running, but i don't think that's true anymore. so do i need the check?

greetings

#1 lore raw
Quoted 8 lines · At 02:44 +0200 on 21 Jun (1340246688), [email protected] wrote:

Hi guys,

let me shortly introduce myself. I'm a student and recently work on my bachelor thesis. My goal is to write a little hypervisor. I'm not quite sure if this is the right mailing list, but i guess you'll gonna tell me.
i have two quick questions:

1. before i can use the vmxon instruction i do have to set vmxe flag in cr4 register. but what if some hypervisor is already running? is there a way to check if one is running??

A lot of hypervisors report their presence in CPUID leaves - have a look at xen-detect in the tools/ directory for how to spot Xen.

Tim.