Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Kubecek <mkubecek@suse.cz>2019-05-20 17:23:52 +0200
committerMichal Kubecek <mkubecek@suse.cz>2019-05-20 17:23:52 +0200
commitb33dbfc955962f68c395dd8ef8c6ef62ae4373c5 (patch)
tree94f0d50a8bf4655b31e6d0fcb6560f447e87df69
parent4c41263438f1aac48a41e93b6207d0d5b60bf0c3 (diff)
kvm: make kvm_vcpu_(un)map dependency on CONFIG_HAS_IOMEMHEADmaster
explicit. Fixes build of s390x/zfcpdump.
-rw-r--r--patches.suse/kvm-make-kvm_vcpu_-un-map-dependency-on-CONFIG_HAS_I.patch56
-rw-r--r--series.conf1
2 files changed, 57 insertions, 0 deletions
diff --git a/patches.suse/kvm-make-kvm_vcpu_-un-map-dependency-on-CONFIG_HAS_I.patch b/patches.suse/kvm-make-kvm_vcpu_-un-map-dependency-on-CONFIG_HAS_I.patch
new file mode 100644
index 0000000000..669f064ce1
--- /dev/null
+++ b/patches.suse/kvm-make-kvm_vcpu_-un-map-dependency-on-CONFIG_HAS_I.patch
@@ -0,0 +1,56 @@
+From: Michal Kubecek <mkubecek@suse.cz>
+Date: Mon, 20 May 2019 17:12:52 +0200
+Subject: kvm: make kvm_vcpu_(un)map dependency on CONFIG_HAS_IOMEM explicit
+Patch-mainline: Submitted - 2019-05-20
+References: none
+
+Recently introduced functions kvm_vcpu_map() and kvm_vcpu_unmap() call
+memremap() and memunmap() which are only available if HAS_IOMEM is enabled
+but this dependency is not explicit, so that the build fails with HAS_IOMEM
+disabled.
+
+As both function are only used on x86 where HAS_IOMEM is always enabled,
+the easiest fix seems to be to only provide them when HAS_IOMEM is enabled.
+
+Fixes: e45adf665a53 ("KVM: Introduce a new guest mapping API")
+Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
+---
+ include/linux/kvm_host.h | 6 +++++-
+ virt/kvm/kvm_main.c | 2 ++
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+--- a/include/linux/kvm_host.h
++++ b/include/linux/kvm_host.h
+@@ -759,9 +759,13 @@ struct kvm_memslots *kvm_vcpu_memslots(struct kvm_vcpu *vcpu);
+ struct kvm_memory_slot *kvm_vcpu_gfn_to_memslot(struct kvm_vcpu *vcpu, gfn_t gfn);
+ kvm_pfn_t kvm_vcpu_gfn_to_pfn_atomic(struct kvm_vcpu *vcpu, gfn_t gfn);
+ kvm_pfn_t kvm_vcpu_gfn_to_pfn(struct kvm_vcpu *vcpu, gfn_t gfn);
++
++#ifdef CONFIG_HAS_IOMEM
+ int kvm_vcpu_map(struct kvm_vcpu *vcpu, gpa_t gpa, struct kvm_host_map *map);
+-struct page *kvm_vcpu_gfn_to_page(struct kvm_vcpu *vcpu, gfn_t gfn);
+ void kvm_vcpu_unmap(struct kvm_vcpu *vcpu, struct kvm_host_map *map, bool dirty);
++#endif
++
++struct page *kvm_vcpu_gfn_to_page(struct kvm_vcpu *vcpu, gfn_t gfn);
+ unsigned long kvm_vcpu_gfn_to_hva(struct kvm_vcpu *vcpu, gfn_t gfn);
+ unsigned long kvm_vcpu_gfn_to_hva_prot(struct kvm_vcpu *vcpu, gfn_t gfn, bool *writable);
+ int kvm_vcpu_read_guest_page(struct kvm_vcpu *vcpu, gfn_t gfn, void *data, int offset,
+--- a/virt/kvm/kvm_main.c
++++ b/virt/kvm/kvm_main.c
+@@ -1743,6 +1743,7 @@ struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn)
+ }
+ EXPORT_SYMBOL_GPL(gfn_to_page);
+
++#ifdef CONFIG_HAS_IOMEM
+ static int __kvm_map_gfn(struct kvm_memory_slot *slot, gfn_t gfn,
+ struct kvm_host_map *map)
+ {
+@@ -1806,6 +1807,7 @@ void kvm_vcpu_unmap(struct kvm_vcpu *vcpu, struct kvm_host_map *map,
+ map->page = NULL;
+ }
+ EXPORT_SYMBOL_GPL(kvm_vcpu_unmap);
++#endif /* CONFIG_HAS_IOMEM */
+
+ struct page *kvm_vcpu_gfn_to_page(struct kvm_vcpu *vcpu, gfn_t gfn)
+ {
diff --git a/series.conf b/series.conf
index 5d5e4444c2..8a53a572b9 100644
--- a/series.conf
+++ b/series.conf
@@ -412,6 +412,7 @@
# KVM patches
########################################################
patches.suse/x86-kvm-pmu-Set-AMD-s-virt-PMU-version-to-1.patch
+ patches.suse/kvm-make-kvm_vcpu_-un-map-dependency-on-CONFIG_HAS_I.patch
########################################################
# documentation