From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH v8 06/15] ARM: KVM: Hypervisor identity mapping Date: Tue, 19 Jun 2012 11:38:18 +0300 Message-ID: <4FE03A7A.1020802@redhat.com> References: <20120615190553.24590.18391.stgit@ubuntu> <20120615190747.24590.35933.stgit@ubuntu> <4FDF2948.20007@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: android-virt@lists.cs.columbia.edu, kvm@vger.kernel.org To: Christoffer Dall Return-path: Received: from mx1.redhat.com ([209.132.183.28]:34588 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754019Ab2FSIi0 (ORCPT ); Tue, 19 Jun 2012 04:38:26 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On 06/18/2012 08:55 PM, Christoffer Dall wrote: > On Mon, Jun 18, 2012 at 9:12 AM, Avi Kivity wrote: >> On 06/15/2012 10:07 PM, Christoffer Dall wrote: >>> Adds support in the identity mapping feature that allows KVM to setup >>> identity mapping for the Hyp mode with the AP[1] bit set as required by >>> the specification and also supports freeing created sub pmd's after >>> finished use. >>> >>> These two functions: >>> - hyp_idmap_add(pgd, addr, end); >>> - hyp_idmap_del(pgd, addr, end); >>> are essentially calls to the same function as the non-hyp versions but >>> with a different argument value. KVM calls these functions to setup >>> and teardown the identity mapping used to initialize the hypervisor. >>> >>> Note, the hyp-version of the _del function actually frees the pmd's >>> pointed to by the pgd as opposed to the non-hyp version which just >>> clears them. >> >> >> I asked previously what happens if two data structures share a page, and >> one of them is removed. Is that handled now? How? >> > > I think you asked previously for the general hyp-mode mappings, not > the identity mappings. For the general hyp-mode mappings we simply > don't unmap the data structures, potentially leaking a few pages for > the page tables themselves. > > This is only for initialization, so there are not really any data > structures mapped, only one/two pages to initialize the hypervisor > mode. > >> Why not just identity map all memory? You can use large pages so it's >> fast and doesn't consume a lot of page table memory. > > That's an option, but it still seems like an awful waste since it's > only used once (unless you unload and re-load the module) and there's > really no problem with data structures here. > > The truth is that this is going to go away, and the code will be put > in a section that's idmapped from kernel start. There's a patch under > way from Marc taking care of this which I assmue we'll merge for v9. Okay, thanks. -- error compiling committee.c: too many arguments to function