public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vmx: enable io bitmaps to avoid IO port 0x80 VMEXITs
@ 2007-04-29  5:33 He, Qing
       [not found] ` <37E52D09333DE2469A03574C88DBF40F048D9E-wq7ZOvIWXbM/UvCtAeCM4rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: He, Qing @ 2007-04-29  5:33 UTC (permalink / raw)
  To: kvm-devel

[-- Attachment #1: Type: text/plain, Size: 2616 bytes --]

This patch enables IO bitmaps control on vmx and unmask the 0x80 port to
avoid VMEXITs caused by accessing port 0x80. 0x80 is used as delays (see
include/asm/io.h), and handling VMEXITs on its access is unnecessary but
slows things down. This patch improves kernel build test at around
3%~5%.
	Because every VM uses the same io bitmap, it is shared between
all VMs rather than a per-VM data structure.

Signed-off-by: Qing He <qing.he-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>


diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index 1d2b41b..a91d71f 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -33,6 +33,8 @@ MODULE_LICENSE("GPL");
 static DEFINE_PER_CPU(struct vmcs *, vmxarea);
 static DEFINE_PER_CPU(struct vmcs *, current_vmcs);
 
+static char *vmx_io_bitmap;
+
 #ifdef CONFIG_X86_64
 #define HOST_IS_64 1
 #else
@@ -1127,8 +1129,8 @@ static int vmx_vcpu_setup(struct kvm_vcpu *vcpu)
 	vmcs_write32(GUEST_PENDING_DBG_EXCEPTIONS, 0);
 
 	/* I/O */
-	vmcs_write64(IO_BITMAP_A, 0);
-	vmcs_write64(IO_BITMAP_B, 0);
+	vmcs_write64(IO_BITMAP_A, (unsigned long) __pa(vmx_io_bitmap));
+	vmcs_write64(IO_BITMAP_B, (unsigned long) __pa(vmx_io_bitmap +
PAGE_SIZE));
 
 	guest_write_tsc(0);
 
@@ -1148,7 +1150,7 @@ static int vmx_vcpu_setup(struct kvm_vcpu *vcpu)
 			       CPU_BASED_HLT_EXITING         /* 20.6.2
*/
 			       | CPU_BASED_CR8_LOAD_EXITING    /* 20.6.2
*/
 			       | CPU_BASED_CR8_STORE_EXITING   /* 20.6.2
*/
-			       | CPU_BASED_UNCOND_IO_EXITING   /* 20.6.2
*/
+			       | CPU_BASED_ACTIVATE_IO_BITMAP  /* 20.6.2
*/
 			       | CPU_BASED_MOV_DR_EXITING
 			       | CPU_BASED_USE_TSC_OFFSETING   /* 21.3
*/
 			);
@@ -2190,11 +2192,39 @@ static struct kvm_arch_ops vmx_arch_ops = {
 
 static int __init vmx_init(void)
 {
-	return kvm_init_arch(&vmx_arch_ops, THIS_MODULE);
+	int r;
+
+	vmx_io_bitmap = (char *) __get_free_pages(GFP_KERNEL, 1);
+	if (!vmx_io_bitmap) {
+		printk(KERN_ERR "kvm: vmx_io_bitmap allocation
failed.\n");
+		r = -ENOMEM;
+		goto out;
+	}
+
+	/*
+	 * Allow direct access to the PC debug port (it is often used
for I/O
+	 * delays, but the vmexits simply slow things down).
+	 */
+	memset(vmx_io_bitmap, ~0, 2 * PAGE_SIZE);
+	clear_bit(0x80, vmx_io_bitmap);
+
+	r = kvm_init_arch(&vmx_arch_ops, THIS_MODULE);
+	if (r) {
+		goto out1;
+	}
+
+	return 0;
+
+out1:
+	free_pages((unsigned long) vmx_io_bitmap, 1);
+out:
+	return r;
 }
 
 static void __exit vmx_exit(void)
 {
+	if (vmx_io_bitmap)
+		free_pages((unsigned long) vmx_io_bitmap, 1);
 	kvm_exit_arch();
 }


[-- Attachment #2: kvm-vmx-io-bitmaps-0x80.patch --]
[-- Type: application/octet-stream, Size: 2045 bytes --]

diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index 1d2b41b..a91d71f 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -33,6 +33,8 @@ MODULE_LICENSE("GPL");
 static DEFINE_PER_CPU(struct vmcs *, vmxarea);
 static DEFINE_PER_CPU(struct vmcs *, current_vmcs);
 
+static char *vmx_io_bitmap;
+
 #ifdef CONFIG_X86_64
 #define HOST_IS_64 1
 #else
@@ -1127,8 +1129,8 @@ static int vmx_vcpu_setup(struct kvm_vcpu *vcpu)
 	vmcs_write32(GUEST_PENDING_DBG_EXCEPTIONS, 0);
 
 	/* I/O */
-	vmcs_write64(IO_BITMAP_A, 0);
-	vmcs_write64(IO_BITMAP_B, 0);
+	vmcs_write64(IO_BITMAP_A, (unsigned long) __pa(vmx_io_bitmap));
+	vmcs_write64(IO_BITMAP_B, (unsigned long) __pa(vmx_io_bitmap + PAGE_SIZE));
 
 	guest_write_tsc(0);
 
@@ -1148,7 +1150,7 @@ static int vmx_vcpu_setup(struct kvm_vcpu *vcpu)
 			       CPU_BASED_HLT_EXITING         /* 20.6.2 */
 			       | CPU_BASED_CR8_LOAD_EXITING    /* 20.6.2 */
 			       | CPU_BASED_CR8_STORE_EXITING   /* 20.6.2 */
-			       | CPU_BASED_UNCOND_IO_EXITING   /* 20.6.2 */
+			       | CPU_BASED_ACTIVATE_IO_BITMAP  /* 20.6.2 */
 			       | CPU_BASED_MOV_DR_EXITING
 			       | CPU_BASED_USE_TSC_OFFSETING   /* 21.3 */
 			);
@@ -2190,11 +2192,39 @@ static struct kvm_arch_ops vmx_arch_ops = {
 
 static int __init vmx_init(void)
 {
-	return kvm_init_arch(&vmx_arch_ops, THIS_MODULE);
+	int r;
+
+	vmx_io_bitmap = (char *) __get_free_pages(GFP_KERNEL, 1);
+	if (!vmx_io_bitmap) {
+		printk(KERN_ERR "kvm: vmx_io_bitmap allocation failed.\n");
+		r = -ENOMEM;
+		goto out;
+	}
+
+	/*
+	 * Allow direct access to the PC debug port (it is often used for I/O
+	 * delays, but the vmexits simply slow things down).
+	 */
+	memset(vmx_io_bitmap, ~0, 2 * PAGE_SIZE);
+	clear_bit(0x80, vmx_io_bitmap);
+
+	r = kvm_init_arch(&vmx_arch_ops, THIS_MODULE);
+	if (r) {
+		goto out1;
+	}
+
+	return 0;
+
+out1:
+	free_pages((unsigned long) vmx_io_bitmap, 1);
+out:
+	return r;
 }
 
 static void __exit vmx_exit(void)
 {
+	if (vmx_io_bitmap)
+		free_pages((unsigned long) vmx_io_bitmap, 1);
 	kvm_exit_arch();
 }
 

[-- Attachment #3: Type: text/plain, Size: 286 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

[-- Attachment #4: Type: text/plain, Size: 186 bytes --]

_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/kvm-devel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] vmx: enable io bitmaps to avoid IO port 0x80 VMEXITs
       [not found] ` <37E52D09333DE2469A03574C88DBF40F048D9E-wq7ZOvIWXbM/UvCtAeCM4rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2007-04-29  6:35   ` Neo Jia
       [not found]     ` <5d649bdb0704282335h2ac4ac8cn77b2b32366cd7015-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2007-04-29  8:40   ` Avi Kivity
  2007-04-29  9:23   ` Avi Kivity
  2 siblings, 1 reply; 5+ messages in thread
From: Neo Jia @ 2007-04-29  6:35 UTC (permalink / raw)
  To: He, Qing; +Cc: kvm-devel

On 4/29/07, He, Qing <qing.he-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> wrote:
> This patch enables IO bitmaps control on vmx and unmask the 0x80 port to
> avoid VMEXITs caused by accessing port 0x80. 0x80 is used as delays (see
> include/asm/io.h), and handling VMEXITs on its access is unnecessary but
> slows things down. This patch improves kernel build test at around
> 3%~5%.
>         Because every VM uses the same io bitmap, it is shared between
> all VMs rather than a per-VM data structure.
>
> Signed-off-by: Qing He <qing.he-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
>
>
> diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
> index 1d2b41b..a91d71f 100644
> --- a/drivers/kvm/vmx.c
> +++ b/drivers/kvm/vmx.c
> @@ -33,6 +33,8 @@ MODULE_LICENSE("GPL");
>  static DEFINE_PER_CPU(struct vmcs *, vmxarea);
>  static DEFINE_PER_CPU(struct vmcs *, current_vmcs);
>
> +static char *vmx_io_bitmap;
> +
>  #ifdef CONFIG_X86_64
>  #define HOST_IS_64 1
>  #else
> @@ -1127,8 +1129,8 @@ static int vmx_vcpu_setup(struct kvm_vcpu *vcpu)
>         vmcs_write32(GUEST_PENDING_DBG_EXCEPTIONS, 0);
>
>         /* I/O */
> -       vmcs_write64(IO_BITMAP_A, 0);
> -       vmcs_write64(IO_BITMAP_B, 0);
> +       vmcs_write64(IO_BITMAP_A, (unsigned long) __pa(vmx_io_bitmap));
> +       vmcs_write64(IO_BITMAP_B, (unsigned long) __pa(vmx_io_bitmap +
> PAGE_SIZE));
>
>         guest_write_tsc(0);
>
> @@ -1148,7 +1150,7 @@ static int vmx_vcpu_setup(struct kvm_vcpu *vcpu)
>                                CPU_BASED_HLT_EXITING         /* 20.6.2
> */
>                                | CPU_BASED_CR8_LOAD_EXITING    /* 20.6.2
> */
>                                | CPU_BASED_CR8_STORE_EXITING   /* 20.6.2
> */
> -                              | CPU_BASED_UNCOND_IO_EXITING   /* 20.6.2
> */
> +                              | CPU_BASED_ACTIVATE_IO_BITMAP  /* 20.6.2
> */
>                                | CPU_BASED_MOV_DR_EXITING
>                                | CPU_BASED_USE_TSC_OFFSETING   /* 21.3
> */
>                         );
> @@ -2190,11 +2192,39 @@ static struct kvm_arch_ops vmx_arch_ops = {
>
>  static int __init vmx_init(void)
>  {
> -       return kvm_init_arch(&vmx_arch_ops, THIS_MODULE);
> +       int r;
> +
> +       vmx_io_bitmap = (char *) __get_free_pages(GFP_KERNEL, 1);

Why allocate two continuous pages instead of two separate pages for
IO_BITMAP_A and IO_BITMAP_B?

> +       if (!vmx_io_bitmap) {
> +               printk(KERN_ERR "kvm: vmx_io_bitmap allocation
> failed.\n");
> +               r = -ENOMEM;
> +               goto out;
> +       }
> +
> +       /*
> +        * Allow direct access to the PC debug port (it is often used
> for I/O
> +        * delays, but the vmexits simply slow things down).
> +        */
> +       memset(vmx_io_bitmap, ~0, 2 * PAGE_SIZE);
> +       clear_bit(0x80, vmx_io_bitmap);
> +
> +       r = kvm_init_arch(&vmx_arch_ops, THIS_MODULE);
> +       if (r) {
> +               goto out1;
> +       }
> +
> +       return 0;
> +
> +out1:
> +       free_pages((unsigned long) vmx_io_bitmap, 1);
> +out:
> +       return r;
>  }
>
>  static void __exit vmx_exit(void)
>  {
> +       if (vmx_io_bitmap)
> +               free_pages((unsigned long) vmx_io_bitmap, 1);

Is there necessary to set vmx_io_bimap to NULL after free_page? And, I
assume that this
one should go to vmx member later.

Thanks,
Neo

>         kvm_exit_arch();
>  }
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> kvm-devel mailing list
> kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/kvm-devel
>
>
>


-- 
I would remember that if researchers were not ambitious
probably today we haven't the technology we are using!

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] vmx: enable io bitmaps to avoid IO port 0x80 VMEXITs
       [not found]     ` <5d649bdb0704282335h2ac4ac8cn77b2b32366cd7015-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2007-04-29  6:55       ` He, Qing
  0 siblings, 0 replies; 5+ messages in thread
From: He, Qing @ 2007-04-29  6:55 UTC (permalink / raw)
  To: Neo Jia; +Cc: kvm-devel

[-- Attachment #1: Type: text/plain, Size: 5103 bytes --]



>-----Original Message-----
>From: Neo Jia [mailto:neojia-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org]
>Sent: 2007年4月29日 14:36
>To: He, Qing
>Cc: kvm-devel
>Subject: Re: [kvm-devel] [PATCH] vmx: enable io bitmaps to avoid IO port 0x80 VMEXITs
>
>On 4/29/07, He, Qing <qing.he-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> wrote:
>> This patch enables IO bitmaps control on vmx and unmask the 0x80 port to
>> avoid VMEXITs caused by accessing port 0x80. 0x80 is used as delays (see
>> include/asm/io.h), and handling VMEXITs on its access is unnecessary but
>> slows things down. This patch improves kernel build test at around
>> 3%~5%.
>>         Because every VM uses the same io bitmap, it is shared between
>> all VMs rather than a per-VM data structure.
>>
>> Signed-off-by: Qing He <qing.he-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
>>
>>
>> diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
>> index 1d2b41b..a91d71f 100644
>> --- a/drivers/kvm/vmx.c
>> +++ b/drivers/kvm/vmx.c
>> @@ -33,6 +33,8 @@ MODULE_LICENSE("GPL");
>>  static DEFINE_PER_CPU(struct vmcs *, vmxarea);
>>  static DEFINE_PER_CPU(struct vmcs *, current_vmcs);
>>
>> +static char *vmx_io_bitmap;
>> +
>>  #ifdef CONFIG_X86_64
>>  #define HOST_IS_64 1
>>  #else
>> @@ -1127,8 +1129,8 @@ static int vmx_vcpu_setup(struct kvm_vcpu *vcpu)
>>         vmcs_write32(GUEST_PENDING_DBG_EXCEPTIONS, 0);
>>
>>         /* I/O */
>> -       vmcs_write64(IO_BITMAP_A, 0);
>> -       vmcs_write64(IO_BITMAP_B, 0);
>> +       vmcs_write64(IO_BITMAP_A, (unsigned long) __pa(vmx_io_bitmap));
>> +       vmcs_write64(IO_BITMAP_B, (unsigned long) __pa(vmx_io_bitmap +
>> PAGE_SIZE));
>>
>>         guest_write_tsc(0);
>>
>> @@ -1148,7 +1150,7 @@ static int vmx_vcpu_setup(struct kvm_vcpu *vcpu)
>>                                CPU_BASED_HLT_EXITING         /* 20.6.2
>> */
>>                                | CPU_BASED_CR8_LOAD_EXITING    /* 20.6.2
>> */
>>                                | CPU_BASED_CR8_STORE_EXITING   /* 20.6.2
>> */
>> -                              | CPU_BASED_UNCOND_IO_EXITING   /* 20.6.2
>> */
>> +                              | CPU_BASED_ACTIVATE_IO_BITMAP  /* 20.6.2
>> */
>>                                | CPU_BASED_MOV_DR_EXITING
>>                                | CPU_BASED_USE_TSC_OFFSETING   /* 21.3
>> */
>>                         );
>> @@ -2190,11 +2192,39 @@ static struct kvm_arch_ops vmx_arch_ops = {
>>
>>  static int __init vmx_init(void)
>>  {
>> -       return kvm_init_arch(&vmx_arch_ops, THIS_MODULE);
>> +       int r;
>> +
>> +       vmx_io_bitmap = (char *) __get_free_pages(GFP_KERNEL, 1);
>
>Why allocate two continuous pages instead of two separate pages for
>IO_BITMAP_A and IO_BITMAP_B?

There's no special reason, just because these two pages are logically connected. I know there is a concern that allocating two separate pages is easier, but does that really matter?
>
>> +       if (!vmx_io_bitmap) {
>> +               printk(KERN_ERR "kvm: vmx_io_bitmap allocation
>> failed.\n");
>> +               r = -ENOMEM;
>> +               goto out;
>> +       }
>> +
>> +       /*
>> +        * Allow direct access to the PC debug port (it is often used
>> for I/O
>> +        * delays, but the vmexits simply slow things down).
>> +        */
>> +       memset(vmx_io_bitmap, ~0, 2 * PAGE_SIZE);
>> +       clear_bit(0x80, vmx_io_bitmap);
>> +
>> +       r = kvm_init_arch(&vmx_arch_ops, THIS_MODULE);
>> +       if (r) {
>> +               goto out1;
>> +       }
>> +
>> +       return 0;
>> +
>> +out1:
>> +       free_pages((unsigned long) vmx_io_bitmap, 1);
>> +out:
>> +       return r;
>>  }
>>
>>  static void __exit vmx_exit(void)
>>  {
>> +       if (vmx_io_bitmap)
>> +               free_pages((unsigned long) vmx_io_bitmap, 1);
>
>Is there necessary to set vmx_io_bimap to NULL after free_page? And, I
>assume that this
>one should go to vmx member later.

Yeah, setting it to NULL is better practice, I just missed that. But it is not necessary because after the pages are freed, the kernel module is also removed.

In fact, I also think this bitmap should be better if it's in some per-VM vmx specific context, but such a context is not there in current KVM. And for this patch, it's just safe for all VMs to share the io bitmap.

Thanks,
Qing

>
>Thanks,
>Neo
>
>>         kvm_exit_arch();
>>  }
>>
>>
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by DB2 Express
>> Download DB2 Express C - the FREE version of DB2 express and take
>> control of your XML. No limits. Just data. Click to get it now.
>> http://sourceforge.net/powerbar/db2/
>> _______________________________________________
>> kvm-devel mailing list
>> kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
>> https://lists.sourceforge.net/lists/listinfo/kvm-devel
>>
>>
>>
>
>
>--
>I would remember that if researchers were not ambitious
>probably today we haven't the technology we are using!


[-- Attachment #2: Type: text/plain, Size: 286 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

[-- Attachment #3: Type: text/plain, Size: 186 bytes --]

_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/kvm-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] vmx: enable io bitmaps to avoid IO port 0x80 VMEXITs
       [not found] ` <37E52D09333DE2469A03574C88DBF40F048D9E-wq7ZOvIWXbM/UvCtAeCM4rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
  2007-04-29  6:35   ` Neo Jia
@ 2007-04-29  8:40   ` Avi Kivity
  2007-04-29  9:23   ` Avi Kivity
  2 siblings, 0 replies; 5+ messages in thread
From: Avi Kivity @ 2007-04-29  8:40 UTC (permalink / raw)
  To: He, Qing; +Cc: kvm-devel

He, Qing wrote:
> This patch enables IO bitmaps control on vmx and unmask the 0x80 port to
> avoid VMEXITs caused by accessing port 0x80. 0x80 is used as delays (see
> include/asm/io.h), and handling VMEXITs on its access is unnecessary but
> slows things down. This patch improves kernel build test at around
> 3%~5%.
>   

It's quite surprising to see such a large speedup!


> +
>  #ifdef CONFIG_X86_64
>  #define HOST_IS_64 1
>  #else
> @@ -1127,8 +1129,8 @@ static int vmx_vcpu_setup(struct kvm_vcpu *vcpu)
>  	vmcs_write32(GUEST_PENDING_DBG_EXCEPTIONS, 0);
>  
>  	/* I/O */
> -	vmcs_write64(IO_BITMAP_A, 0);
> -	vmcs_write64(IO_BITMAP_B, 0);
> +	vmcs_write64(IO_BITMAP_A, (unsigned long) __pa(vmx_io_bitmap));
> +	vmcs_write64(IO_BITMAP_B, (unsigned long) __pa(vmx_io_bitmap +
> PAGE_SIZE));
>   

Unnecessary casts.

> +	r = kvm_init_arch(&vmx_arch_ops, THIS_MODULE);
> +	if (r) {
> +		goto out1;
> +	}
>   

No braces around single statements in kernel code, please.

> +
> +	return 0;
> +
> +out1:
> +	free_pages((unsigned long) vmx_io_bitmap, 1);
> +out:
> +	return r;
>  }
>  
>  static void __exit vmx_exit(void)
>  {
> +	if (vmx_io_bitmap)
> +		free_pages((unsigned long) vmx_io_bitmap, 1);
>   

The if is unnecessary, since we can't get here with a NULL vmx_io_bitmap 
(also free_pages() checks for NULL).

-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] vmx: enable io bitmaps to avoid IO port 0x80 VMEXITs
       [not found] ` <37E52D09333DE2469A03574C88DBF40F048D9E-wq7ZOvIWXbM/UvCtAeCM4rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
  2007-04-29  6:35   ` Neo Jia
  2007-04-29  8:40   ` Avi Kivity
@ 2007-04-29  9:23   ` Avi Kivity
  2 siblings, 0 replies; 5+ messages in thread
From: Avi Kivity @ 2007-04-29  9:23 UTC (permalink / raw)
  To: He, Qing; +Cc: kvm-devel

He, Qing wrote:
>  
> +static char *vmx_io_bitmap;
>   

If you write

    static char vmx_io_bitmap[PAGE_SIZE*2] __aligned(PAGE_SIZE);

you can avoid the allocation and deallocation completely.  But you have 
to use vmalloc_to_page() instead of __pa().


-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-04-29  9:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-29  5:33 [PATCH] vmx: enable io bitmaps to avoid IO port 0x80 VMEXITs He, Qing
     [not found] ` <37E52D09333DE2469A03574C88DBF40F048D9E-wq7ZOvIWXbM/UvCtAeCM4rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2007-04-29  6:35   ` Neo Jia
     [not found]     ` <5d649bdb0704282335h2ac4ac8cn77b2b32366cd7015-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-04-29  6:55       ` He, Qing
2007-04-29  8:40   ` Avi Kivity
2007-04-29  9:23   ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox