From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 2/2] Add MSR Bitmap support in VMX Date: Thu, 02 Aug 2007 17:23:18 +0300 Message-ID: <46B1E8D6.6010106@qumranet.com> References: <37E52D09333DE2469A03574C88DBF40F048ED2@pdsmsx414.ccr.corp.intel.com> <46B1D092.7070609@qumranet.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1528037446==" Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: "He, Qing" , Rusty Russell 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 --===============1528037446== Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: 7bit Avi Kivity wrote: > 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). > Because of this issue, I'd like to apply the patch now and remove the allocations if/when the module_to_page() thing hits mainline. However: > static struct kvm_arch_ops vmx_arch_ops = { > .cpu_has_kvm_support = cpu_has_kvm_support, > .disabled_by_bios = vmx_disabled_by_bios, > @@ -2505,6 +2523,28 @@ static int __init vmx_init(void) > if (r) > goto out1; > > + if (cpu_has_vmx_msr_bitmap) { > + vmx_msr_bitmap = alloc_page(GFP_KERNEL | __GFP_HIGHMEM); > + if (!vmx_msr_bitmap) { > + r = -ENOMEM; > + goto out1; > We need to undo kvm_init_arch() here. > + } > + > + printk(KERN_INFO "kvm: Enable MSR bitmap support.\n"); > + > + va = kmap(vmx_msr_bitmap); > kmap_atomic() is preferable. > > +#define cpu_has_vmx_msr_bitmap \ > + (vmcs_config.cpu_based_exec_ctrl & CPU_BASED_USE_MSR_BITMAPS) > + > #endif This needs to be an inline local to vmx.c. Did you see any performance improvements out of this? -- error compiling committee.c: too many arguments to function --===============1528037446== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- 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/ --===============1528037446== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kvm-devel mailing list kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/kvm-devel --===============1528037446==--