From patchwork Mon Aug 18 09:50:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wanpeng Li X-Patchwork-Id: 4734871 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B9FB89F3EE for ; Mon, 18 Aug 2014 09:50:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 06A46200FE for ; Mon, 18 Aug 2014 09:50:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 38E2920131 for ; Mon, 18 Aug 2014 09:50:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753331AbaHRJtj (ORCPT ); Mon, 18 Aug 2014 05:49:39 -0400 Received: from mga02.intel.com ([134.134.136.20]:35940 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751852AbaHRJs7 (ORCPT ); Mon, 18 Aug 2014 05:48:59 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 18 Aug 2014 02:48:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,885,1400050800"; d="scan'208";a="559946320" Received: from unknown (HELO vt-ivt2.tsp.org) ([10.239.48.107]) by orsmga001.jf.intel.com with ESMTP; 18 Aug 2014 02:48:40 -0700 From: Wanpeng Li To: Paolo Bonzini Cc: Gleb Natapov , hpa@zytor.com, x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Wanpeng Li Subject: [PATCH 3/5] KVM: vmx: don't vmx_segment_cache_clear twice in enter_pmode Date: Mon, 18 Aug 2014 17:50:29 +0800 Message-Id: <1408355431-115633-3-git-send-email-wanpeng.li@linux.intel.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1408355431-115633-1-git-send-email-wanpeng.li@linux.intel.com> References: <1408355431-115633-1-git-send-email-wanpeng.li@linux.intel.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 vmx_segment_cache_clear() will be called by vmx_set_segment() which lead to vmx_segment_cache_clear() is called twice in enter_pmode(). This patch remove the duplicate call site. Reviewed-by: Yang Zhang Signed-off-by: Wanpeng Li --- arch/x86/kvm/vmx.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 2963303..c97c44c 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -3183,8 +3183,6 @@ static void enter_pmode(struct kvm_vcpu *vcpu) vmx->rmode.vm86_active = 0; - vmx_segment_cache_clear(vmx); - vmx_set_segment(vcpu, &vmx->rmode.segs[VCPU_SREG_TR], VCPU_SREG_TR); flags = vmcs_readl(GUEST_RFLAGS);