From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: Single memory slot Date: Fri, 16 Oct 2009 08:43:31 +0900 Message-ID: <4AD7B3A3.7010202@redhat.com> References: <4AD6D037.3060301@redhat.com> <4AD76F1B.3040607@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , kvm-devel To: Anthony Liguori Return-path: Received: from mx1.redhat.com ([209.132.183.28]:17403 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758815AbZJOXoE (ORCPT ); Thu, 15 Oct 2009 19:44:04 -0400 In-Reply-To: <4AD76F1B.3040607@codemonkey.ws> Sender: kvm-owner@vger.kernel.org List-ID: On 10/16/2009 03:51 AM, Anthony Liguori wrote: > Avi Kivity wrote: >> One way to improve the gfn_to_pfn() memslot search is to register >> just one slot. This can only work on 64-bit, since even the smallest >> guests need 4GB of physical address space. Apart from speeding up >> gfn_to_page(), it would also speed up mmio which must iterate over >> all slots, so a lookup cache cannot help. >> >> This would require quite a bunch of changes: >> - modify gfn_to_pfn() to fail gracefully if the page is in the slot >> but unmapped (hole handling) >> - modify qemu to reserve the guest physical address space > > It could potentially speed up qemu quite a lot too as we would return > to a model where host va == fixed address + guest pa. That makes > things like stl_phys/ldl_phys trivial. This doesn't work on 32-bit, and you still need to perform a lookup for mmio. It just shortens the loop. Note qemu can't depend on mmio holes being unmapped (you could trap the SEGV, but that would be unbearably slow). -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.