From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [kvm-ppc-devel] RFC/patch portability: split kvm_vm_ioctl v2 Date: Fri, 26 Oct 2007 14:31:38 +0200 Message-ID: <4721DE2A.5040200@qumranet.com> References: <1192192452.7630.16.camel@cotte.boeblingen.de.ibm.com> <1193327325.8345.9.camel@cotte.boeblingen.de.ibm.com> <1193327326.3284.2.camel@izike-woof.qumranet.com> <1193329322.28279.21.camel@basalt> <472114B6.6080000@qumranet.com> <1193345465.28279.47.camel@basalt> <4721A185.1070808@qumranet.com> <4721A3A3.8020504@de.ibm.com> <4721A82A.2040402@de.ibm.com> <4721B1ED.6040006@qumranet.com> <4721C1DB.3040207@de.ibm.com> <4721C330.3030302@qumranet.com> <4721C47E.30800@de.ibm.com> <4721C53E.1070507@qumranet.com> <4721D344.2020508@de.ibm.com> <4721D3C2.8090407@qumranet.com> <4721DC5D.702@de.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: "kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org" , kvm-ppc-devel , carsteno-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org, Hollis Blanchard , "Zhang, Xiantao" To: carsteno-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org Return-path: In-Reply-To: <4721DC5D.702-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Carsten Otte wrote: > Avi Kivity wrote: > >> Carsten Otte wrote: >> >>> Avi Kivity wrote: >>> >>>> Why aren't memory slots common too? Only their number is different, >>>> while the implementation is the same. >>>> >>> Your approach makes the meaning of memory slot somewhat useless on >>> s390, if that one may be sparse and may be result of different >>> allocations: On x86, there has to be one memory slot per allocation, >>> versus on s390 there has to be exactly one memory slot with multiple >>> allocations behind. >>> >> No, a memory slot can span multiple backing stores. But it must be >> contiguous in both the host userspace and guest physical address spaces. >> > I was not preceise enough: I meant to state that x86 demands one > memory slot per contiguous allocation. But with your "s390 has only > one memory slot" idea, this introduces a severe restriction for us: > our "single memory slot" does not need to be contiguous, neither in > guest physical nor in host userspace. All we need, is a certain > 1:1+offset relationship between guest physical and host user. Page > size, backing, sparse are all variable. > Well, a slot may be sparse (though I don't think that's supported now). To me, a slot is exactly a guest offset, size, and host offset. How the memory is populated (or not) is up to the user. > Izik's idea, at least how I understood him, makes the best of both > worlds: we keep above addressing relationship intact, and have > multiple memory slots for all architectures. > Can you explain the idea again. Izik's not here so I can't ask him. > >>> For userspace that means, with your approach it has to do total >>> different memory setup for different archs _if_ it wants to use >>> multiple allocations and/or sparse: >>> - on x86 it does allocations to random userspace address, and >>> registers each of them as memory slot >>> - on s390 it does allocations to a specific address layout similar to >>> the guest, and registers only one memory slot for the whole thing >>> >>> With Izik's approach however, this is transparent to userspace: it has >>> multiple memory slots, one per allocation. Regardless of the CPU >>> architecture. >>> >> You can do this with the current memory slots as well. Although I'm >> feeling that I misunderstood Izik's idea. I'll go talk to him. >> > No we can't: because current memory slots don't have a permanent > relationship between user and guest physical addresses that we do need > on s390. We cannot guarantee that over multiple slots, and we cannot > keep the guest from addressing memory around the memory slots unless > we refuse to use more than only one slot which has to start at guest > physical zero. > Well, you could allow multiple slots and return -EINVAL if they don't fit the "host = guest + offset formula". I'm not sure how that's different from one big, possibly sparse, slot. But again, I don't think I understood Izik's idea, so I'm not sure what's the alternative. -- error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/