From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [RFC PATCH 3/3] KVM: MMU: Optimize guest page table walk Date: Sun, 01 May 2011 16:32:55 +0300 Message-ID: <4DBD6107.4050603@redhat.com> 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> <20110429160511.GC3985@one.firstfloor.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Takuya Yoshikawa , mtosatti@redhat.com, kvm@vger.kernel.org, yoshikawa.takuya@oss.ntt.co.jp To: Andi Kleen Return-path: Received: from mx1.redhat.com ([209.132.183.28]:34213 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755145Ab1EANdH (ORCPT ); Sun, 1 May 2011 09:33:07 -0400 In-Reply-To: <20110429160511.GC3985@one.firstfloor.org> Sender: kvm-owner@vger.kernel.org List-ID: On 04/29/2011 07:05 PM, Andi Kleen wrote: > > 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. I'm happy with a slower copy_from_user() for that particular case. -- error compiling committee.c: too many arguments to function