Skip to contentSkip to conversation

Architecture independence layer - v0 - basic mechanism

PATCH In review Christian Ehrhardt 2 participants 2 messages Aug 22, 2007 1 message not in the archive KVM

lore
Share & tools
lore
#0 lore raw

PATCH 2/3 Architecture independence layer - v0 - basic mechanism

[Patch 2/3]
This introduces the Kconfig & Makefile changes as well as creating the still empty body of kvm_x86.*

Related part from the 0/3 mail:
- Since architecture will not change at runtime I do not use a arch_ops structure
- Instead I used a hidden Kconfig value specifying the kvm architecture which then influence the make file to link together the generic and the arch
specific part
to one kvm module
- I split the code into kvm_main.c (generic) and kvm_x86.h/kvm_x86.c (arch portion)

Signature · 10 lines
Grüsse / regards, Christian Ehrhardt

IBM Linux Technology Center, Open Virtualization
+49 7031/16-3385
[email protected]
[email protected]

IBM Deutschland Entwicklung GmbH
Vorsitzender des Aufsichtsrats: Johann Weihen Geschäftsführung: Herbert Kircher Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294
drivers/kvm/Kconfig +26 -4
index 445c6e4..63ce7b0 100644
@@ -3,14 +3,14 @@
 #
 menuconfig VIRTUALIZATION
 	bool "Virtualization"
-	depends on X86
+	depends on X86 || POWERPC
 	default y
 
 if VIRTUALIZATION
 
 config KVM
 	tristate "Kernel-based Virtual Machine (KVM) support"
-	depends on X86 && EXPERIMENTAL
+	depends on EXPERIMENTAL
 	select PREEMPT_NOTIFIERS
 	select ANON_INODES
 	---help---
@@ -27,18 +27,40 @@ config KVM
 
 	  If unsure, say N.
 
+config KVM_X86
+	bool
+
 config KVM_INTEL
 	tristate "KVM for Intel processors support"
-	depends on KVM
+	depends on KVM && X86
+	select KVM_X86
 	---help---
 	  Provides support for KVM on Intel processors equipped with the VT
 	  extensions.
 
 config KVM_AMD
 	tristate "KVM for AMD processors support"
-	depends on KVM
+	depends on KVM && X86
+	select KVM_X86
 	---help---
 	  Provides support for KVM on AMD processors equipped with the AMD-V
 	  (SVM) extensions.
 
+config KVM_EMBEDDED_POWERPC
+	bool
+
+config KVM_POWERPC_440
+	tristate "KVM for embedded PowerPC 440 cores"
+	depends on KVM && POWERPC
+	select KVM_EMBEDDED_POWERPC
+	---help---
+	  Provides support for KVM on embedded PowerPC 440 cores
+
+config KVM_POWERPC_E500
+	tristate "KVM for embedded PowerPC e500 cores"
+	depends on KVM && POWERPC
+	select KVM_EMBEDDED_POWERPC
+	---help---
+	  Provides support for KVM on embedded PowerPC e500 cores
+
 endif # VIRTUALIZATION
drivers/kvm/Makefile +12 -2
index c0a789f..843fe08 100644
@@ -2,9 +2,19 @@
 # Makefile for Kernel-based Virtual Machine module
 #
 
-kvm-objs := kvm_main.o mmu.o x86_emulate.o
-obj-$(CONFIG_KVM) += kvm.o
+kvm-objs := kvm_main.o
+
+ifeq ($(CONFIG_KVM_X86),y)
+kvm-objs += kvm_x86.o mmu.o x86_emulate.o
+
 kvm-intel-objs = vmx.o
 obj-$(CONFIG_KVM_INTEL) += kvm-intel.o
 kvm-amd-objs = svm.o
 obj-$(CONFIG_KVM_AMD) += kvm-amd.o
+endif
+
+ifeq ($(CONFIG_KVM_EMBEDDED_POWERPC),y)
+kvm-objs += kvm-powerpc.o
+endif
+
+obj-$(CONFIG_KVM) += kvm.o
drivers/kvm/kvm_arch.h new file +14 -0
new file mode 100644
index 0000000..6658948
@@ -0,0 +1,14 @@
+#ifndef __KVM_ARCH_H
+#define __KVM_ARCH_H
+
+/*
+ * This work is licensed under the terms of the GNU GPL, version 2.  See
+ * the COPYING file in the top-level directory.
+ *
+ * This is the interface an arch module has to implement because this is what
+ * kvm_main gets linked against depending on arch selection.
+ */
+
+#include <linux/module.h>
+
+#endif
drivers/kvm/kvm_x86.c new file +51 -0

51 lines not on this page · raw message

drivers/kvm/kvm_x86.h new file +9 -0
new file mode 100644
index 0000000..021385e
@@ -0,0 +1,9 @@
+#ifndef __KVM_X86_H
+#define __KVM_X86_H
+
+/*
+ * This work is licensed under the terms of the GNU GPL, version 2.  See
+ * the COPYING file in the top-level directory.
+ */
+
+#endif

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/

_______________________________________________
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): 46CBFE06.7030608-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org

#2 lore raw
Quoted 16 lines · Christian Ehrhardt

[Patch 2/3]
This introduces the Kconfig & Makefile changes as well as creating the still empty body of kvm_x86.*

Related part from the 0/3 mail:
- Since architecture will not change at runtime I do not use a arch_ops structure
- Instead I used a hidden Kconfig value specifying the kvm architecture which then
influence the make file to link together the generic and the arch
specific part
to one kvm module
- I split the code into kvm_main.c (generic) and kvm_x86.h/kvm_x86.c (arch portion)

drivers/kvm/Kconfig config KVM · line 33

Quoted 7 lines
drivers/kvm/Kconfig +3 -0
@@ -27,18 +27,40 @@ config KVM
 
 	  If unsure, say N.
 
+config KVM_X86
+	bool
+
 

As previously mentioned, X86 (and X86_64, X86_32) already cover this.

Signature · 8 lines
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/