[Disco,03/10] kvm: fix compilation on s390
diff mbox series

Message ID 20200131111035.38050-4-cascardo@canonical.com
State New
Headers show
Series
  • CVE-2019-3016
Related show

Commit Message

Thadeu Lima de Souza Cascardo Jan. 31, 2020, 11:10 a.m. UTC
From: Paolo Bonzini <pbonzini@redhat.com>

CVE-2019-3016
CVE-2020-3016

s390 does not have memremap, even though in this particular case it
would be useful.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit d30b214d1d0addb7b2c9c78178d1501cd39a01fb)
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
---
 virt/kvm/kvm_main.c | 2 ++
 1 file changed, 2 insertions(+)

Patch
diff mbox series

diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index c23b84dfe37a..f4d59133dce6 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -1809,8 +1809,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)