]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
KVM: PPC: Pass change type down to memslot commit function
authorBharata B Rao <bharata@linux.ibm.com>
Wed, 12 Dec 2018 04:15:30 +0000 (15:15 +1100)
committerPaul Mackerras <paulus@ozlabs.org>
Sun, 16 Dec 2018 23:57:27 +0000 (10:57 +1100)
Currently, kvm_arch_commit_memory_region() gets called with a
parameter indicating what type of change is being made to the memslot,
but it doesn't pass it down to the platform-specific memslot commit
functions.  This adds the `change' parameter to the lower-level
functions so that they can use it in future.

[paulus@ozlabs.org - fix book E also.]

Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
Reviewed-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
arch/powerpc/include/asm/kvm_ppc.h
arch/powerpc/kvm/book3s.c
arch/powerpc/kvm/book3s_hv.c
arch/powerpc/kvm/book3s_pr.c
arch/powerpc/kvm/booke.c
arch/powerpc/kvm/powerpc.c

index 9b89b1918dfcc689ffe50631895a787ab639fb19..04c5b84df83dc9bbac1e7bb95cc7b131a4a0c371 100644 (file)
@@ -224,7 +224,8 @@ extern int kvmppc_core_prepare_memory_region(struct kvm *kvm,
 extern void kvmppc_core_commit_memory_region(struct kvm *kvm,
                                const struct kvm_userspace_memory_region *mem,
                                const struct kvm_memory_slot *old,
-                               const struct kvm_memory_slot *new);
+                               const struct kvm_memory_slot *new,
+                               enum kvm_mr_change change);
 extern int kvm_vm_ioctl_get_smmu_info(struct kvm *kvm,
                                      struct kvm_ppc_smmu_info *info);
 extern void kvmppc_core_flush_memslot(struct kvm *kvm,
@@ -294,7 +295,8 @@ struct kvmppc_ops {
        void (*commit_memory_region)(struct kvm *kvm,
                                     const struct kvm_userspace_memory_region *mem,
                                     const struct kvm_memory_slot *old,
-                                    const struct kvm_memory_slot *new);
+                                    const struct kvm_memory_slot *new,
+                                    enum kvm_mr_change change);
        int (*unmap_hva_range)(struct kvm *kvm, unsigned long start,
                           unsigned long end);
        int (*age_hva)(struct kvm *kvm, unsigned long start, unsigned long end);
index fd9893bc7aa1aa187e548996e1cfc68f5e5a4ecc..a35fb4099094b466fcc0c62819ddc51bfced9438 100644 (file)
@@ -830,9 +830,10 @@ int kvmppc_core_prepare_memory_region(struct kvm *kvm,
 void kvmppc_core_commit_memory_region(struct kvm *kvm,
                                const struct kvm_userspace_memory_region *mem,
                                const struct kvm_memory_slot *old,
-                               const struct kvm_memory_slot *new)
+                               const struct kvm_memory_slot *new,
+                               enum kvm_mr_change change)
 {
-       kvm->arch.kvm_ops->commit_memory_region(kvm, mem, old, new);
+       kvm->arch.kvm_ops->commit_memory_region(kvm, mem, old, new, change);
 }
 
 int kvm_unmap_hva_range(struct kvm *kvm, unsigned long start, unsigned long end)
index ab43306c4ea13ef6c10ce1c950b19e84b8f3e83c..f4fbb7b584869b56b3740699407d385670d8477f 100644 (file)
@@ -4371,7 +4371,8 @@ static int kvmppc_core_prepare_memory_region_hv(struct kvm *kvm,
 static void kvmppc_core_commit_memory_region_hv(struct kvm *kvm,
                                const struct kvm_userspace_memory_region *mem,
                                const struct kvm_memory_slot *old,
-                               const struct kvm_memory_slot *new)
+                               const struct kvm_memory_slot *new,
+                               enum kvm_mr_change change)
 {
        unsigned long npages = mem->memory_size >> PAGE_SHIFT;
 
index 82840160c60656fb613a061490af4ebb44480d89..811a3c2fb0e90116fe2360f1df62ad3b2565f927 100644 (file)
@@ -1914,7 +1914,8 @@ static int kvmppc_core_prepare_memory_region_pr(struct kvm *kvm,
 static void kvmppc_core_commit_memory_region_pr(struct kvm *kvm,
                                const struct kvm_userspace_memory_region *mem,
                                const struct kvm_memory_slot *old,
-                               const struct kvm_memory_slot *new)
+                               const struct kvm_memory_slot *new,
+                               enum kvm_mr_change change)
 {
        return;
 }
index a9ca016da67021691de512d0a8a2f9f0039d56e5..dbec4128bb51b4790caf812c8ef49e234bbe3486 100644 (file)
@@ -1833,7 +1833,8 @@ int kvmppc_core_prepare_memory_region(struct kvm *kvm,
 void kvmppc_core_commit_memory_region(struct kvm *kvm,
                                const struct kvm_userspace_memory_region *mem,
                                const struct kvm_memory_slot *old,
-                               const struct kvm_memory_slot *new)
+                               const struct kvm_memory_slot *new,
+                               enum kvm_mr_change change)
 {
 }
 
index 2869a299c4edc66445b8e841bb16b3e018f75cd0..6a7a6a101efd9bd29338a29c2196aa4ed85b72c9 100644 (file)
@@ -696,7 +696,7 @@ void kvm_arch_commit_memory_region(struct kvm *kvm,
                                   const struct kvm_memory_slot *new,
                                   enum kvm_mr_change change)
 {
-       kvmppc_core_commit_memory_region(kvm, mem, old, new);
+       kvmppc_core_commit_memory_region(kvm, mem, old, new, change);
 }
 
 void kvm_arch_flush_shadow_memslot(struct kvm *kvm,