From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50750) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtbAf-0007hB-75 for qemu-devel@nongnu.org; Tue, 03 Nov 2015 07:58:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZtbAc-0001ns-0b for qemu-devel@nongnu.org; Tue, 03 Nov 2015 07:58:41 -0500 Received: from vps01.wiesinger.com ([46.36.37.179]:44674) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtbAb-0001XE-Qx for qemu-devel@nongnu.org; Tue, 03 Nov 2015 07:58:37 -0500 Received: from wiesinger.com (wiesinger.com [62.178.19.14]) by vps01.wiesinger.com (Postfix) with ESMTPS id B8F099F22A for ; Tue, 3 Nov 2015 13:57:32 +0100 (CET) Received: from [192.168.0.14] ([192.168.0.14]) (authenticated bits=0) by wiesinger.com (8.15.2/8.15.2) with ESMTPSA id tA3CvUbT017028 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 3 Nov 2015 13:57:30 +0100 From: Gerhard Wiesinger Message-ID: <5638AF3A.1030300@wiesinger.com> Date: Tue, 3 Nov 2015 13:57:30 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] Fixed KVM problems with old DOS programs. Compatibility can be forced by module parameter. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Signed-off-by: Gerhard Wiesinger --- arch/x86/kvm/svm.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 2f9ed1f..e0b00fc 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -198,6 +198,10 @@ static bool npt_enabled; static int npt = true; module_param(npt, int, S_IRUGO); +/* allow backward compatibility with e.g. old DOS application */ +static int npt_task_switch_emulation = true; +module_param(npt_task_switch_emulation, int, S_IRUGO); + /* allow nested virtualization in KVM/SVM */ static int nested = true; module_param(nested, int, S_IRUGO); @@ -1177,6 +1181,9 @@ static void init_vmcb(struct vcpu_svm *svm, bool init_event) if (npt_enabled) { /* Setup VMCB for Nested Paging */ control->nested_ctl = 1; + if (!npt_task_switch_emulation) { + clr_intercept(svm, INTERCEPT_TASK_SWITCH); + } clr_intercept(svm, INTERCEPT_INVLPG); clr_exception_intercept(svm, PF_VECTOR); clr_cr_intercept(svm, INTERCEPT_CR3_READ); -- 2.4.3