summaryrefslogtreecommitdiffstats
path: root/virt/kvm/kvm_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'virt/kvm/kvm_main.c')
-rw-r--r--virt/kvm/kvm_main.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index f0d13d9d125d..134ec0283a8a 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -52,6 +52,7 @@
#include <linux/sort.h>
#include <linux/bsearch.h>
#include <linux/io.h>
+#include <linux/lockdep.h>
#include <asm/processor.h>
#include <asm/ioctl.h>
@@ -1760,8 +1761,10 @@ static int __kvm_map_gfn(struct kvm_memory_slot *slot, gfn_t gfn,
if (pfn_valid(pfn)) {
page = pfn_to_page(pfn);
hva = kmap(page);
+#ifdef CONFIG_HAS_IOMEM
} else {
hva = memremap(pfn_to_hpa(pfn), PAGE_SIZE, MEMREMAP_WB);
+#endif
}
if (!hva)
@@ -4181,7 +4184,9 @@ static int kvm_suspend(void)
static void kvm_resume(void)
{
if (kvm_usage_count) {
- lockdep_assert_held(&kvm_count_lock);
+#ifdef CONFIG_LOCKDEP
+ WARN_ON(lockdep_is_held(&kvm_count_lock));
+#endif
hardware_enable_nolock(NULL);
}
}