Re: [PATCH] KVM: MMU: cleanup for function unaccount_shadowed()

2010-04-21 Thread Avi Kivity
On 04/16/2010 11:21 AM, Wei Yongjun wrote:
 Since gfn is not changed in the for loop, we do not need to call
 gfn_to_memslot_unaliased() under the loop, and it is safe to move
 it out.
   

Applied, thanks.

-- 
error compiling committee.c: too many arguments to function

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] KVM: MMU: cleanup for function unaccount_shadowed()

2010-04-16 Thread Wei Yongjun
Since gfn is not changed in the for loop, we do not need to call
gfn_to_memslot_unaliased() under the loop, and it is safe to move
it out.

Signed-off-by: Wei Yongjun yj...@cn.fujitsu.com
---
 arch/x86/kvm/mmu.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

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);
-- 
1.7.0


--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html