From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rusty Russell Subject: Re: [PATCH 2/2] Add MSR Bitmap support in VMX Date: Fri, 03 Aug 2007 07:55:36 +1000 Message-ID: <1186091736.6131.149.camel@localhost.localdomain> References: <37E52D09333DE2469A03574C88DBF40F048ED2@pdsmsx414.ccr.corp.intel.com> <46B1D092.7070609@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, "He, Qing" To: Avi Kivity Return-path: In-Reply-To: <46B1D092.7070609-atKUWr5tajBWk0Htik3J/w@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 On Thu, 2007-08-02 at 15:39 +0300, Avi Kivity wrote: > He, Qing wrote: > >> > >> hmm. While there's nothing wrong with the patch, there is a simpler way > >> to do this: > >> > >> static unsigned long vmx_msr_bitmap[PAGE_SIZE / sizeof(unsigned > >> long)] __aligned(PAGE_SIZE); > >> > >> now there's no need to allocate, error-check, free, or kmap the memory. > >> The io bitmaps can receive similar treatment. > >> > > > > Well, though not so important, kmapping do have a tiny advantage, it uses less virtual space if HIGHMEM is used. This makes sense when 1G limited kernel space is used, although it's highly unlikely to be a real problem. > > > > > > Starting a virtual machine consumes about 4MB of low memory for the > shadow mmu (more for the memory map and for various slabs), so 4K is not > an issue. > > However, I do see an issue with my proposal. To get the physical address > of the page, we need to use vmalloc_to_page(). But that won't work if > kvm is built into the kernel (and thus uses large pages for data). > > Rusty, what say you to a 'struct page *module_to_page(void *kaddr)' > which does the right thing? Attached an implementation. Hi Avi, Arch-specific, unfortunately: modules do not need to be allocated with vmalloc (and for small modules probably shouldn't anyway). Luckily vmalloc always page-aligns AFAICT, so you get that. So I think dynamic alloc is easier. Rusty. > > ------------------------------------------------------------------------- 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/