Skip to contentSkip to conversation

KVM on VMI

PATCH In review Alexander Graf 2 participants 2 messages Jul 9, 2008 – Jul 10, 2008 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KVM on VMI

Hi,

I more or less accidently stumbled across a problem when compiling KVM on the VMI-enabled kernel. Even though that's pretty much useless right now, I think there might be a day, VMware will emulate VM extensions, in VMs, so we should probably not keep KVM from running under VMI.

The problem is that usually load_ldt is #defined, while in VMI it's a static void function. This clashes with the way KVM detects if load_ldt is defined already. To circumvent this, I just extended the check so we're not redefining load_ldt when VMI is activated.

include/asm-x86/kvm_host.h +1 -1
@@ -597,7 +597,7 @@
 	asm("mov %0, %%gs" : : "rm"(sel));
 }
 
-#ifndef load_ldt
+#if !(defined(load_ldt) || defined(CONFIG_X86_VMI))
 static inline void load_ldt(u16 sel)
 {
 	asm("lldt %0" : : "rm"(sel));
#1 lore raw
Quoted 6 lines · Alexander Graf

Hi,

I more or less accidently stumbled across a problem when compiling KVM on the VMI-enabled kernel. Even though that's pretty much useless right now, I think there might be a day, VMware will emulate VM extensions, in VMs, so we should probably not keep KVM from running under VMI.

The problem is that usually load_ldt is #defined, while in VMI it's a static void function. This clashes with the way KVM detects if load_ldt is defined already. To circumvent this, I just extended the check so we're not redefining load_ldt when VMI is activated.

I fixed this in another way, by renaming prefixing load_ldt (and a bunch of other functions) with kvm_.

Signature · 1 line
error compiling committee.c: too many arguments to function