From patchwork Thu May 9 06:45:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takuya Yoshikawa X-Patchwork-Id: 2543331 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 BB4EA3FC5A for ; Thu, 9 May 2013 06:44:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751222Ab3EIGo0 (ORCPT ); Thu, 9 May 2013 02:44:26 -0400 Received: from tama500.ecl.ntt.co.jp ([129.60.39.148]:48278 "EHLO tama500.ecl.ntt.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750704Ab3EIGo0 (ORCPT ); Thu, 9 May 2013 02:44:26 -0400 Received: from mfs5.rdh.ecl.ntt.co.jp (mfs5.rdh.ecl.ntt.co.jp [129.60.39.144]) by tama500.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id r496iLFO011293; Thu, 9 May 2013 15:44:21 +0900 Received: from mfs5.rdh.ecl.ntt.co.jp (localhost.localdomain [127.0.0.1]) by mfs5.rdh.ecl.ntt.co.jp (Postfix) with ESMTP id D388CE0189; Thu, 9 May 2013 15:44:21 +0900 (JST) Received: from imail2.m.ecl.ntt.co.jp (imail2.m.ecl.ntt.co.jp [129.60.5.247]) by mfs5.rdh.ecl.ntt.co.jp (Postfix) with ESMTP id BDDC4E0187; Thu, 9 May 2013 15:44:21 +0900 (JST) Received: from yshpad ([129.60.241.181]) by imail2.m.ecl.ntt.co.jp (8.13.8/8.13.8) with SMTP id r496iCLA029435; Thu, 9 May 2013 15:44:12 +0900 Date: Thu, 9 May 2013 15:45:12 +0900 From: Takuya Yoshikawa To: gleb@redhat.com, pbonzini@redhat.com, mtosatti@redhat.com Cc: kvm@vger.kernel.org Subject: [PATCH 2/3] KVM: MMU: Use kvm_mmu_sync_roots() in kvm_mmu_load() Message-Id: <20130509154512.117fbfd9.yoshikawa_takuya_b1@lab.ntt.co.jp> In-Reply-To: <20130509154350.15b956c4.yoshikawa_takuya_b1@lab.ntt.co.jp> References: <20130509154350.15b956c4.yoshikawa_takuya_b1@lab.ntt.co.jp> X-Mailer: Sylpheed 3.1.0 (GTK+ 2.24.4; x86_64-pc-linux-gnu) Mime-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org No need to open-code this function. Signed-off-by: Takuya Yoshikawa Reviewed-by: Xiao Guangrong --- arch/x86/kvm/mmu.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 08119a8..d01f340 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -3761,9 +3761,7 @@ int kvm_mmu_load(struct kvm_vcpu *vcpu) if (r) goto out; r = mmu_alloc_roots(vcpu); - spin_lock(&vcpu->kvm->mmu_lock); - mmu_sync_roots(vcpu); - spin_unlock(&vcpu->kvm->mmu_lock); + kvm_mmu_sync_roots(vcpu); if (r) goto out; /* set_cr3() should ensure TLB has been flushed */