From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sasha Levin Subject: Re: [PATCH] kvm tools: mmap guest kernel instead of reading it into memory Date: Tue, 13 Dec 2011 08:46:10 +0200 Message-ID: <1323758770.3269.14.camel@lappy> References: <1323701258-17443-1-git-send-email-levinsasha928@gmail.com> <4EE64395.7020109@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" 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: Avi Kivity Return-path: Received: from mail-ee0-f46.google.com ([74.125.83.46]:42922 "EHLO mail-ee0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751970Ab1LMGqR (ORCPT ); Tue, 13 Dec 2011 01:46:17 -0500 Received: by eekc4 with SMTP id c4so1959865eek.19 for ; Mon, 12 Dec 2011 22:46:16 -0800 (PST) In-Reply-To: <4EE64395.7020109@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, 2011-12-12 at 20:10 +0200, Avi Kivity wrote: > 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). How exactly would I put it into one slot? -- Sasha.