From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N0eS9-000107-Th for qemu-devel@nongnu.org; Wed, 21 Oct 2009 12:54:25 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N0eS4-0000sJ-Iy for qemu-devel@nongnu.org; Wed, 21 Oct 2009 12:54:24 -0400 Received: from [199.232.76.173] (port=44582 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N0eS3-0000rT-Pj for qemu-devel@nongnu.org; Wed, 21 Oct 2009 12:54:19 -0400 Received: from gv-out-0910.google.com ([216.239.58.190]:61400) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N0eS3-0007X6-9z for qemu-devel@nongnu.org; Wed, 21 Oct 2009 12:54:19 -0400 Received: by gv-out-0910.google.com with SMTP id s4so832392gve.36 for ; Wed, 21 Oct 2009 09:54:18 -0700 (PDT) Message-ID: <4ADF3CB5.9090700@codemonkey.ws> Date: Wed, 21 Oct 2009 11:54:13 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 1/9] Export function for VA defined ram allocation References: <1256117106-9475-1-git-send-email-agraf@suse.de> <1256117106-9475-2-git-send-email-agraf@suse.de> <4ADF1AE4.8020004@codemonkey.ws> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: Carsten Otte , qemu-devel Alexander Graf wrote: > > On 21.10.2009, at 16:29, Anthony Liguori wrote: > >> Alexander Graf wrote: >>> S390 requires vmas for guests to be < 256 GB. So we need to directly >>> export >>> mmaps "try to use this vma as start address" feature to not >>> accidently get >>> over that limit. >>> >>> Signed-off-by: Alexander Graf >>> --- >>> cpu-common.h | 1 + >>> exec.c | 15 +++++++++++++-- >>> 2 files changed, 14 insertions(+), 2 deletions(-) >>> >>> diff --git a/cpu-common.h b/cpu-common.h >>> index 6302372..ecaf9e3 100644 >>> --- a/cpu-common.h >>> +++ b/cpu-common.h >>> @@ -30,6 +30,7 @@ static inline void >>> cpu_register_physical_memory(target_phys_addr_t start_addr, >>> ram_addr_t cpu_get_physical_page_desc(target_phys_addr_t addr); >>> ram_addr_t qemu_ram_alloc(ram_addr_t); >>> +ram_addr_t _qemu_ram_alloc(ram_addr_t size, void *map_at); >>> >> >> I don't like this interface very much. Couldn't the fact that we >> need a va starting at 0 for s390 kvm be hidden behind the existing >> qemu_ram_alloc? > > We don't need a va starting at 0. We need a max va ending < 256 GB. > > Carsten did mention in a previous mail that he has getting rid of that > limitation on his todo list, but for now that's what we have. As soon > as the kvm module is updated to support arbitrary addresses we can > just revert this patch and be happy. > > For the time being all we need to check is that nobody else uses > _qemu_ram_alloc, so we really can revert it safely then. Couldn't we just as easily put the check in qemu_ram_alloc under a TARGET_S390 && kvm_enabled()? That's far better than introducing a function who's only name difference is an underscore. Regards, Anthony Liguori > Alex