From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] kvm tools: mmap guest kernel instead of reading it into memory Date: Mon, 12 Dec 2011 20:10:29 +0200 Message-ID: <4EE64395.7020109@redhat.com> References: <1323701258-17443-1-git-send-email-levinsasha928@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: penberg@kernel.org, mingo@elte.hu, gorcunov@gmail.com, asias.hejun@gmail.com, kvm@vger.kernel.org, ajsween@sandia.gov To: Sasha Levin Return-path: Received: from mx1.redhat.com ([209.132.183.28]:2343 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751549Ab1LLSKs (ORCPT ); Mon, 12 Dec 2011 13:10:48 -0500 In-Reply-To: <1323701258-17443-1-git-send-email-levinsasha928@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: On 12/12/2011 04:47 PM, Sasha Levin wrote: > This patch mmaps guest kernel into it's own memory slot instead of reading > it into the memory. > > - } else { > - /* First RAM range from zero to the PCI gap: */ > > + /* Mapped kernel */ > + phys_start = BZ_KERNEL_START; > + phys_size = bzl; > + host_mem = kvm->bz_start; > + > + kvm__register_mem(kvm, phys_start, phys_size, host_mem); > + > + /* Rest of the memory */ > + phys_start = BZ_KERNEL_START + bzl; > + phys_size = kvm->ram_size - (BZ_KERNEL_START + bzl); > + host_mem = kvm->ram_start + (BZ_KERNEL_START + bzl); > + > + kvm__register_mem(kvm, phys_start, phys_size, host_mem); > You don't actually need separate slots for this (there is no requirement that a slot == one vma). -- error compiling committee.c: too many arguments to function