From: Christian Ehrhardt <ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
To: "kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org"
<kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
Subject: [PATCH 2/3] Architecture independence layer - v0 - basic mechanism
Date: Wed, 22 Aug 2007 11:12:38 +0200 [thread overview]
Message-ID: <46CBFE06.7030608@linux.vnet.ibm.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 953 bytes --]
[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)
--
Grüsse / regards,
Christian Ehrhardt
IBM Linux Technology Center, Open Virtualization
+49 7031/16-3385
Ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org
Ehrhardt-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org
IBM Deutschland Entwicklung GmbH
Vorsitzender des Aufsichtsrats: Johann Weihen
Geschäftsführung: Herbert Kircher
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294
[-- Attachment #2: basic_mechanism --]
[-- Type: text/plain, Size: 4436 bytes --]
diff --git a/drivers/kvm/Kconfig b/drivers/kvm/Kconfig
index 445c6e4..63ce7b0 100644
--- a/drivers/kvm/Kconfig
+++ b/drivers/kvm/Kconfig
@@ -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
diff --git a/drivers/kvm/Makefile b/drivers/kvm/Makefile
index c0a789f..843fe08 100644
--- a/drivers/kvm/Makefile
+++ b/drivers/kvm/Makefile
@@ -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
diff --git a/drivers/kvm/kvm_arch.h b/drivers/kvm/kvm_arch.h
new file mode 100644
index 0000000..6658948
--- /dev/null
+++ b/drivers/kvm/kvm_arch.h
@@ -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
diff --git a/drivers/kvm/kvm_x86.c b/drivers/kvm/kvm_x86.c
new file mode 100644
index 0000000..585f277
--- /dev/null
+++ b/drivers/kvm/kvm_x86.c
@@ -0,0 +1,51 @@
+/*
+ * Kernel-based Virtual Machine driver for Linux
+ *
+ * This module enables machines with Intel VT-x extensions to run virtual
+ * machines without emulation or binary translation.
+ *
+ * Copyright (C) 2006 Qumranet, Inc.
+ *
+ * Authors:
+ * Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
+ * Yaniv Kamay <yaniv-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2. See
+ * the COPYING file in the top-level directory.
+ *
+ */
+
+#include "kvm.h"
+#include "kvm_arch.h"
+#include "kvm_x86.h"
+#include "x86_emulate.h"
+#include "segment_descriptor.h"
+
+#include <linux/kvm.h>
+#include <linux/module.h>
+#include <linux/errno.h>
+#include <linux/percpu.h>
+#include <linux/gfp.h>
+#include <linux/mm.h>
+#include <linux/vmalloc.h>
+#include <linux/reboot.h>
+#include <linux/debugfs.h>
+#include <linux/highmem.h>
+#include <linux/file.h>
+#include <linux/miscdevice.h>
+#include <linux/sysdev.h>
+#include <linux/cpu.h>
+#include <linux/sched.h>
+#include <linux/cpumask.h>
+#include <linux/smp.h>
+#include <linux/anon_inodes.h>
+
+#include <asm/processor.h>
+#include <asm/msr.h>
+#include <asm/io.h>
+#include <asm/uaccess.h>
+#include <asm/desc.h>
+
+MODULE_AUTHOR("Qumranet");
+MODULE_LICENSE("GPL");
+
diff --git a/drivers/kvm/kvm_x86.h b/drivers/kvm/kvm_x86.h
new file mode 100644
index 0000000..021385e
--- /dev/null
+++ b/drivers/kvm/kvm_x86.h
@@ -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
[-- Attachment #3: Type: text/plain, Size: 315 bytes --]
-------------------------------------------------------------------------
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/
[-- Attachment #4: Type: text/plain, Size: 186 bytes --]
_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/kvm-devel
next reply other threads:[~2007-08-22 9:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-22 9:12 Christian Ehrhardt [this message]
[not found] ` <46CBFE06.7030608-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2007-08-22 10:14 ` [PATCH 2/3] Architecture independence layer - v0 - basic mechanism Avi Kivity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46CBFE06.7030608@linux.vnet.ibm.com \
--to=ehrhardt-23vcf4htsmix0ybbhkvfkdbpr1lh4cv8@public.gmane.org \
--cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox