From patchwork Sun May 19 05:47:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sanjay Lal X-Patchwork-Id: 2589881 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id C15013FDBC for ; Sun, 19 May 2013 05:48:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752790Ab3ESFsl (ORCPT ); Sun, 19 May 2013 01:48:41 -0400 Received: from kymasys.com ([64.62.140.43]:58892 "HELO kymasys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752534Ab3ESFsk (ORCPT ); Sun, 19 May 2013 01:48:40 -0400 Received: from agni.kymasys.com ([75.40.23.192]) by kymasys.com for ; Sat, 18 May 2013 22:48:39 -0700 Received: by agni.kymasys.com (Postfix, from userid 500) id 3B9CA630061; Sat, 18 May 2013 22:47:43 -0700 (PDT) From: Sanjay Lal To: kvm@vger.kernel.org Cc: linux-mips@linux-mips.org, Ralf Baechle , Gleb Natapov , Marcelo Tosatti , Sanjay Lal Subject: [PATCH 09/18] KVM/MIPS32-VZ: Add support for CONFIG_KVM_MIPS_VZ option Date: Sat, 18 May 2013 22:47:31 -0700 Message-Id: <1368942460-15577-10-git-send-email-sanjayl@kymasys.com> X-Mailer: git-send-email 1.7.11.3 In-Reply-To: <1368942460-15577-1-git-send-email-sanjayl@kymasys.com> References: <1368942460-15577-1-git-send-email-sanjayl@kymasys.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org - Add config option for KVM/MIPS with VZ support. Signed-off-by: Sanjay Lal --- arch/mips/kvm/Kconfig | 14 +++++++++++++- arch/mips/kvm/Makefile | 14 +++++++++----- 2 files changed, 22 insertions(+), 6 deletions(-) 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