From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andi Kleen Subject: Re: [RFC PATCH 3/3] KVM: MMU: Optimize guest page table walk Date: Fri, 29 Apr 2011 18:05:11 +0200 Message-ID: <20110429160511.GC3985@one.firstfloor.org> References: <20110419033220.e527bcae.takuya.yoshikawa@gmail.com> <20110419033814.3cc7ab5e.takuya.yoshikawa@gmail.com> <4DAEA123.3020403@redhat.com> <20110429143808.29c51c6a.takuya.yoshikawa@gmail.com> <20110429065956.GA3985@one.firstfloor.org> <20110429225148.49e6e700.takuya.yoshikawa@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Andi Kleen , Avi Kivity , mtosatti@redhat.com, kvm@vger.kernel.org, yoshikawa.takuya@oss.ntt.co.jp To: Takuya Yoshikawa Return-path: Received: from one.firstfloor.org ([213.235.205.2]:36907 "EHLO one.firstfloor.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756188Ab1D2QFN (ORCPT ); Fri, 29 Apr 2011 12:05:13 -0400 Content-Disposition: inline In-Reply-To: <20110429225148.49e6e700.takuya.yoshikawa@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: > Do you think the following case would not differ so much > from (1' 2') ? > > walk_addr_generic() ---1'' > copy_from_user() ---2'' Yes it should be the same and is cleaner. If you do a make .../foo.i and look at the code coming out of the preprocessor you'll see it expands to a if (!__builtin_constant_p(size)) return copy_user_generic(dst, (__force void *)src, size); switch (size) { case 1:__get_user_asm(*(u8 *)dst, (u8 __user *)src, ret, "b", "b", "=q", 1); return ret; case 2: .. case 4: .. case 8: .. case 10: .. case 16: .. } Ok it looks like the 32bit kernel only handles 1/2/4. Maybe that was the problem if you ran on 32bit. -Andi