diff mbox

[09/18] KVM/MIPS32-VZ: Add support for CONFIG_KVM_MIPS_VZ option

Message ID 1368942460-15577-10-git-send-email-sanjayl@kymasys.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sanjay Lal May 19, 2013, 5:47 a.m. UTC
- Add config option for KVM/MIPS with VZ support.

Signed-off-by: Sanjay Lal <sanjayl@kymasys.com>
---
 arch/mips/kvm/Kconfig  | 14 +++++++++++++-
 arch/mips/kvm/Makefile | 14 +++++++++-----
 2 files changed, 22 insertions(+), 6 deletions(-)
diff mbox

Patch

diff --git a/arch/mips/kvm/Kconfig b/arch/mips/kvm/Kconfig
index 2c15590..963657f 100644
--- a/arch/mips/kvm/Kconfig
+++ b/arch/mips/kvm/Kconfig
@@ -25,9 +25,21 @@  config KVM
 	  Support for hosting Guest kernels.
 	  Currently supported on MIPS32 processors.
 
+config KVM_MIPS_VZ
+	bool "KVM support using the MIPS Virtualization ASE"
+	depends on KVM
+	---help---
+	  Support running unmodified guest kernels in virtual machines using
+	  the MIPS virtualization ASE.  If this option is not selected
+	  then KVM will default to using trap and emulate to virtualize
+	  guests, which will not be as optimal as using the VZ ASE.
+
+	  If unsure, say N.
+
 config KVM_MIPS_DYN_TRANS
 	bool "KVM/MIPS: Dynamic binary translation to reduce traps"
-	depends on KVM
+	depends on KVM && !KVM_MIPS_VZ
+	default y
 	---help---
 	  When running in Trap & Emulate mode patch privileged
 	  instructions to reduce the number of traps.
diff --git a/arch/mips/kvm/Makefile b/arch/mips/kvm/Makefile
index 78d87bb..cc64bb4 100644
--- a/arch/mips/kvm/Makefile
+++ b/arch/mips/kvm/Makefile
@@ -5,9 +5,13 @@  common-objs = $(addprefix ../../../virt/kvm/, kvm_main.o coalesced_mmio.o)
 
 EXTRA_CFLAGS += -Ivirt/kvm -Iarch/mips/kvm
 
-kvm-objs := $(common-objs) kvm_mips.o kvm_mips_emul.o kvm_locore.o \
-	    kvm_mips_int.o kvm_mips_stats.o kvm_mips_commpage.o \
-	    kvm_mips_dyntrans.o kvm_trap_emul.o
+kvm-objs := $(common-objs) kvm_mips.o kvm_mips_emul.o kvm_locore.o kvm_mips_int.o \
+            kvm_mips_stats.o kvm_mips_commpage.o kvm_mips_dyntrans.o
 
-obj-$(CONFIG_KVM)	+= kvm.o
-obj-y			+= kvm_cb.o kvm_tlb.o
+ifdef CONFIG_KVM_MIPS_VZ
+kvm-objs                  += kvm_vz.o
+else
+kvm-objs                  += kvm_trap_emul.o
+endif
+obj-$(CONFIG_KVM)         += kvm.o
+obj-y                     += kvm_tlb.o kvm_cb.o kvm_vz_locore.o