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

Reply via email to