From patchwork Wed Nov 4 19:33:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerhard Wiesinger X-Patchwork-Id: 7552941 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 05BE2BEEA4 for ; Wed, 4 Nov 2015 19:38:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 33D0C2079F for ; Wed, 4 Nov 2015 19:38:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E0A38207A6 for ; Wed, 4 Nov 2015 19:38:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756194AbbKDTic (ORCPT ); Wed, 4 Nov 2015 14:38:32 -0500 Received: from vps01.wiesinger.com ([46.36.37.179]:36084 "EHLO vps01.wiesinger.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755032AbbKDTic (ORCPT ); Wed, 4 Nov 2015 14:38:32 -0500 X-Greylist: delayed 309 seconds by postgrey-1.27 at vger.kernel.org; Wed, 04 Nov 2015 14:38:31 EST Received: from wiesinger.com (wiesinger.com [62.178.19.14]) by vps01.wiesinger.com (Postfix) with ESMTPS id C8F2D9F21A for ; Wed, 4 Nov 2015 20:33:21 +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 tA4JXHRb031571 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Wed, 4 Nov 2015 20:33:18 +0100 From: Gerhard Wiesinger Subject: [PATCH] Fixed KVM problems with old DOS programs. Compatibility can be forced by module parameter. To: kvm@vger.kernel.org Message-ID: <563A5D7D.4080201@wiesinger.com> Date: Wed, 4 Nov 2015 20:33:17 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Gerhard Wiesinger --- arch/x86/kvm/svm.c | 7 +++++++ 1 file changed, 7 insertions(+) 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); 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