KVM: Fix vmx I/O bitmap initialization on highmem systems
authorAvi Kivity <avi@qumranet.com>
Tue, 8 May 2007 08:34:07 +0000 (11:34 +0300)
committerAvi Kivity <avi@qumranet.com>
Mon, 16 Jul 2007 09:05:41 +0000 (12:05 +0300)
kunmap() expects a struct page, not a virtual address.  Fixes an oops loading
kvm-intel.ko on i386 with CONFIG_HIGHMEM.

Thanks to Michael Ivanov <deruhu@peterstar.ru> for reporting.

Signed-off-by: Avi Kivity <avi@qumranet.com>
drivers/kvm/vmx.c

index e39ebe0b6958a1db8c5a52f6b920353ae3e37400..34171d9008ffafa115e6ad813f0a3b1975424b2b 100644 (file)
@@ -2274,11 +2274,11 @@ static int __init vmx_init(void)
        iova = kmap(vmx_io_bitmap_a);
        memset(iova, 0xff, PAGE_SIZE);
        clear_bit(0x80, iova);
-       kunmap(iova);
+       kunmap(vmx_io_bitmap_a);
 
        iova = kmap(vmx_io_bitmap_b);
        memset(iova, 0xff, PAGE_SIZE);
-       kunmap(iova);
+       kunmap(vmx_io_bitmap_b);
 
        r = kvm_init_arch(&vmx_arch_ops, THIS_MODULE);
        if (r)