[lkml]   [2019]   [May]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH -next] kvm: fix compilation errors with mem[re|un]map()
The linux-next commit e45adf665a53 ("KVM: Introduce a new guest mapping
API") introduced compilation errors on arm64.

arch/arm64/kvm/../../../virt/kvm/kvm_main.c:1764:9: error: implicit
declaration of function 'memremap'
hva = memremap(pfn_to_hpa(pfn), PAGE_SIZE, MEMREMAP_WB);
arch/arm64/kvm/../../../virt/kvm/kvm_main.c:1764:9: error: this function
declaration is not a prototype [-Werror,-Wstrict-prototypes]
arch/arm64/kvm/../../../virt/kvm/kvm_main.c:1764:46: error: use of
undeclared identifier 'MEMREMAP_WB'
hva = memremap(pfn_to_hpa(pfn), PAGE_SIZE, MEMREMAP_WB);
arch/arm64/kvm/../../../virt/kvm/kvm_main.c:1796:3: error: implicit
declaration of function 'memunmap'

Fixed it by including io.h in kvm_main.c.

Signed-off-by: Qian Cai <>
virt/kvm/kvm_main.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 8d83a787fd6b..5c5102799c2c 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -51,6 +51,7 @@
#include <linux/slab.h>
#include <linux/sort.h>
#include <linux/bsearch.h>
+#include <linux/io.h>

#include <asm/processor.h>
#include <asm/io.h>
 \ /
  Last update: 2019-05-17 16:03    [W:0.029 / U:1.648 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site