[PATCH kvm-kmod 2/3] the MMU notifier clear_flush_young callback changed in 3.18

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Passing end=start+1 is the easiest way to call the new callback from
the old API.  That is how kvm_handle_hva is implemented on top of
kvm_handle_hva_range.  So, now that kvm_age_hva calls kvm_handle_hva_range
instead of kvm_handle_hva, you can apply the same trick to the caller
of kvm_age_hva.

Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
---
 sync | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/sync b/sync
index 8b63ca7..fff85f3 100755
--- a/sync
+++ b/sync
@@ -310,6 +310,22 @@ def hack_content(fname, data):
             else:
                 w(sub(r'tkr\.', '', line))
             line = '#endif'
+        if match_block_end('^static int kvm_mmu_notifier_clear_flush_young', '^}'):
+            w(line)
+            w('#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0)')
+            w('static int kvm_mmu_notifier_clear_flush_young(struct mmu_notifier *mn,')
+            w('                                              struct mm_struct *mm,')
+            w('                                              unsigned long hva)')
+            w('{')
+            w('\treturn __kvm_mmu_notifier_clear_flush_young(mn, mm, hva, hva+1);')
+            w('}')
+            line = '#endif'
+        if match(r'^static int kvm_mmu_notifier_clear_flush_young'):
+            w('#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)')
+            w(line)
+            w('#else')
+            w(sub('kvm_', '__kvm_', line))
+            line = '#endif'
         if line == '#ifdef CONFIG_KEXEC':
             line = '#if defined(CONFIG_KEXEC) && LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)'
         if line == '\tif (!cpu_has_vmx_apicv())':
-- 
1.8.3.1


--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux