From patchwork Fri Apr 16 08:21:42 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 93074 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o3G8OO2r020294 for ; Fri, 16 Apr 2010 08:24:25 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756491Ab0DPIYW (ORCPT ); Fri, 16 Apr 2010 04:24:22 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:60787 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1756380Ab0DPIYU (ORCPT ); Fri, 16 Apr 2010 04:24:20 -0400 Received: from tang.cn.fujitsu.com (tang.cn.fujitsu.com [10.167.250.3]) by song.cn.fujitsu.com (Postfix) with ESMTP id D0F65170115; Fri, 16 Apr 2010 16:24:16 +0800 (CST) Received: from fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id o3G8MeW6015232; Fri, 16 Apr 2010 16:22:41 +0800 Received: from [10.167.141.76] (unknown [10.167.141.76]) by fnst.cn.fujitsu.com (Postfix) with ESMTPA id 49C3CDC2B3; Fri, 16 Apr 2010 16:27:10 +0800 (CST) Message-ID: <4BC81E16.7080203@cn.fujitsu.com> Date: Fri, 16 Apr 2010 16:21:42 +0800 From: Wei Yongjun User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100404 Thunderbird/3.0.4 MIME-Version: 1.0 To: kvm@vger.kernel.org, Avi Kivity Subject: [PATCH] KVM: MMU: cleanup for function unaccount_shadowed() Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 16 Apr 2010 08:24:41 +0000 (UTC) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index d217f9c..0494f64 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -430,9 +430,9 @@ static void unaccount_shadowed(struct kvm *kvm, gfn_t gfn) int i; gfn = unalias_gfn(kvm, gfn); + slot = gfn_to_memslot_unaliased(kvm, gfn); for (i = PT_DIRECTORY_LEVEL; i < PT_PAGE_TABLE_LEVEL + KVM_NR_PAGE_SIZES; ++i) { - slot = gfn_to_memslot_unaliased(kvm, gfn); write_count = slot_largepage_idx(gfn, slot, i); *write_count -= 1; WARN_ON(*write_count < 0);