Skip to contentSkip to conversation

Support 32bit SVM host

PATCH In review Anthony Liguori 2 participants 3 messages Dec 8, 2006 – Dec 9, 2006 2 messages not in the archive KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Support 32bit SVM host

Howdy,

This is a pretty basic patch to enable KVM on 32bit SVM capable hosts. It introduces a bit of ugliness with #ifdefs and redefining some things that are only present in the 64bit Linux headers.

I've tested it only on an Ubuntu Edgy host (2.6.17) and with a Windows 2000 guest. It boots quite happily though.

Regards,

Anthony Liguori

kernel/Kbuild +1 -2
diff -r c70bb2219917 kernel/Kbuild
@@ -1,6 +1,5 @@ EXTRA_CFLAGS := -I$(src)/include
 EXTRA_CFLAGS := -I$(src)/include
-obj-64-$(CONFIG_X86_64) := kvm-amd.o
-obj-m := kvm.o kvm-intel.o $(obj-64-y)
+obj-m := kvm.o kvm-intel.o kvm-amd.o
 kvm-objs := kvm_main.o mmu.o x86_emulate.o debug.o
 kvm-intel-objs := vmx.o
 kvm-amd-objs := svm.o
kernel/kvm_svm.h +3 -1
diff -r c70bb2219917 kernel/kvm_svm.h
@@ -9,11 +9,13 @@
 #include "kvm.h"
 
 static const u32 host_save_msrs[] = {
+#ifdef __x86_64__
 	MSR_STAR, MSR_LSTAR, MSR_CSTAR, MSR_SYSCALL_MASK, MSR_KERNEL_GS_BASE,
+	MSR_FS_BASE, MSR_GS_BASE,
+#endif
 	MSR_IA32_SYSENTER_CS, MSR_IA32_SYSENTER_ESP, MSR_IA32_SYSENTER_EIP,
 	MSR_IA32_DEBUGCTLMSR, /*MSR_IA32_LASTBRANCHFROMIP,
 	MSR_IA32_LASTBRANCHTOIP, MSR_IA32_LASTINTFROMIP,MSR_IA32_LASTINTTOIP,*/
-	MSR_FS_BASE, MSR_GS_BASE,
 };
 
 #define NR_HOST_SAVE_MSRS (sizeof(host_save_msrs) / sizeof(*host_save_msrs))
kernel/svm.c +81 -28

243 lines not on this page · raw message

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
kvm-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 5 lines · Anthony Liguori

Howdy,

This is a pretty basic patch to enable KVM on 32bit SVM capable hosts. It introduces a bit of ugliness with #ifdefs and redefining some things that are only present in the 64bit Linux headers.

The way to avoid the ugliness is to send a separate patch to Andi that extracts the common definition into a new header file includable from both archs (see [1]).

Quoted 3 lines

I've tested it only on an Ubuntu Edgy host (2.6.17) and with a Windows 2000 guest. It boots quite happily though.

Will merge asap. Thanks for the good work.

[1]
http://kernel.org/git/gitweb.cgi?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=249e83fe839a13b5dc94285daeeaf70f6e54d930

Signature · 8 lines
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

A message that is not in the archive (sent off-list or not yet received): 457A62A3.9000708-atKUWr5tajBWk0Htik3J/[email protected]

#4 lore raw
Quoted 10 lines · Avi Kivity
Quoted 5 lines · Anthony Liguori

Howdy,

This is a pretty basic patch to enable KVM on 32bit SVM capable hosts. It introduces a bit of ugliness with #ifdefs and redefining some things that are only present in the 64bit Linux headers.

The way to avoid the ugliness is to send a separate patch to Andi that extracts the common definition into a new header file includable from both archs (see [1]).

Very nice :-)

Regards,

Anthony Liguori

Quoted 5 lines
Quoted 4 lines

I've tested it only on an Ubuntu Edgy host (2.6.17) and with a Windows 2000 guest. It boots quite happily though.

Quoted 7 lines

Will merge asap. Thanks for the good work.

[1]
http://kernel.org/git/gitweb.cgi?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=249e83fe839a13b5dc94285daeeaf70f6e54d930

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV