From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH unit-tests] Add async page fault test Date: Wed, 09 May 2012 11:52:41 +0300 Message-ID: <4FAA3059.2040105@redhat.com> References: <20120508112446.GB8988@redhat.com> <4FAA2AD7.7050109@redhat.com> <20120509084119.GP15960@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, mtosatti@redhat.com To: Gleb Natapov Return-path: Received: from mx1.redhat.com ([209.132.183.28]:17247 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751830Ab2EIIwo (ORCPT ); Wed, 9 May 2012 04:52:44 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q498qi62032273 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 9 May 2012 04:52:44 -0400 In-Reply-To: <20120509084119.GP15960@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 05/09/2012 11:41 AM, Gleb Natapov wrote: > > > > > void vfree(void *mem) > > > { > > > unsigned long size = ((unsigned long *)mem)[-1]; > > > diff --git a/lib/x86/vm.h b/lib/x86/vm.h > > > index 71ab4a8..ff4842f 100644 > > > --- a/lib/x86/vm.h > > > +++ b/lib/x86/vm.h > > > @@ -22,6 +22,7 @@ void vfree(void *mem); > > > void *vmap(unsigned long long phys, unsigned long size); > > > void *alloc_vpage(void); > > > void *alloc_vpages(ulong nr); > > > +unsigned long virt_to_phys_cr3(void *mem); > > > > uint64_t. > virt_to_phys() also unsigned long. And get_pte() that virt_to_phys_cr3() > uses also. I guess the code is not ready for more then 2^32 memory in > 32bit VM. It's certainly not enterprise quality yet. But let's not add more problems. > > Alterative ways of doing this: > > - file-backed memory using FUSE to control paging > Not sure how that can be done. > > > - add madvise(MADV_DONTNEED) support to testdev, and have the guest > > trigger page-in itself. > MADV_DONTNEED will drop page, not swap it out. Right, but it will be have to be reloaded from disk (it has to be file-backed for this to work). If it's dirty, sync it first. -- error compiling committee.c: too many arguments to function