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/ _______________________________________________ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel