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 13:59:49 +0300 Message-ID: <46B1B925.1080808@qumranet.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: "Yang, Sheng" Return-path: In-Reply-To: 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 Yang, Sheng wrote: > Add MSR Bitmap support in VMX so that some execution of RDMSR or WRMSR > won't cause a VM exit. > > Signed-off-by: Sheng Yang > Signed-off-by: Qing He > --- > drivers/kvm/vmx.c | 44 +++++++++++++++++++++++++++++++++++++++++++- > drivers/kvm/vmx.h | 3 +++ > 2 files changed, 46 insertions(+), 1 deletions(-) > > diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c > index 3b901fe..bebe0d4 100644 > --- a/drivers/kvm/vmx.c > +++ b/drivers/kvm/vmx.c > @@ -71,6 +71,7 @@ static DEFINE_PER_CPU(struct vmcs *, current_vmcs); > > static struct page *vmx_io_bitmap_a; > static struct page *vmx_io_bitmap_b; > +static struct page *vmx_msr_bitmap; > > 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. -- error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- 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/