From patchwork Sat Apr 27 03:13:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Guangrong X-Patchwork-Id: 2496481 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 328F4DFE75 for ; Sat, 27 Apr 2013 03:15:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757041Ab3D0DOG (ORCPT ); Fri, 26 Apr 2013 23:14:06 -0400 Received: from e28smtp02.in.ibm.com ([122.248.162.2]:32933 "EHLO e28smtp02.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756155Ab3D0DNh (ORCPT ); Fri, 26 Apr 2013 23:13:37 -0400 Received: from /spool/local by e28smtp02.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 27 Apr 2013 08:37:53 +0530 Received: from d28dlp03.in.ibm.com (9.184.220.128) by e28smtp02.in.ibm.com (192.168.1.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sat, 27 Apr 2013 08:37:50 +0530 Received: from d28relay04.in.ibm.com (d28relay04.in.ibm.com [9.184.220.61]) by d28dlp03.in.ibm.com (Postfix) with ESMTP id 4BB91125804E; Sat, 27 Apr 2013 08:45:09 +0530 (IST) Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay04.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r3R3DQYj58130532; Sat, 27 Apr 2013 08:43:26 +0530 Received: from d28av01.in.ibm.com (loopback [127.0.0.1]) by d28av01.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r3R3DUtR010948; Sat, 27 Apr 2013 03:13:30 GMT Received: from localhost (dhcp-9-111-29-234.cn.ibm.com [9.111.29.234]) by d28av01.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id r3R3DTXr010932; Sat, 27 Apr 2013 03:13:30 GMT From: Xiao Guangrong To: mtosatti@redhat.com Cc: gleb@redhat.com, avi.kivity@gmail.com, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Xiao Guangrong Subject: [PATCH v4 5/6] KVM: x86: use the fast way to invalid all pages Date: Sat, 27 Apr 2013 11:13:21 +0800 Message-Id: <1367032402-13729-6-git-send-email-xiaoguangrong@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.7.6 In-Reply-To: <1367032402-13729-1-git-send-email-xiaoguangrong@linux.vnet.ibm.com> References: <1367032402-13729-1-git-send-email-xiaoguangrong@linux.vnet.ibm.com> X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13042703-5816-0000-0000-000007BA66C6 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Replace kvm_mmu_zap_all by kvm_mmu_invalid_all_pages except on the path of mmu_notifier->release() which will be fixed in the later patch Signed-off-by: Xiao Guangrong --- arch/x86/kvm/x86.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 8e4494c..809a053 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -5483,7 +5483,7 @@ static int emulator_fix_hypercall(struct x86_emulate_ctxt *ctxt) * to ensure that the updated hypercall appears atomically across all * VCPUs. */ - kvm_mmu_zap_all(vcpu->kvm); + kvm_mmu_invalid_memslot_pages(vcpu->kvm, NULL); kvm_x86_ops->patch_hypercall(vcpu, instruction); @@ -7093,7 +7093,7 @@ void kvm_arch_flush_shadow_all(struct kvm *kvm) void kvm_arch_flush_shadow_memslot(struct kvm *kvm, struct kvm_memory_slot *slot) { - kvm_arch_flush_shadow_all(kvm); + kvm_mmu_invalid_memslot_pages(kvm, slot); } int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu)