diff mbox

[3/4] Avoid kmap_atomic_to_page in svm

Message ID 20091012085454.20775.70384.stgit@mchn012c.ww002.siemens.net (mailing list archive)
State New, archived
Headers show

Commit Message

Jan Kiszka Oct. 12, 2009, 8:54 a.m. UTC
None
diff mbox

Patch

diff --git a/sync b/sync
index 4821b84..8868e6d 100755
--- a/sync
+++ b/sync
@@ -121,6 +121,18 @@  def __hack(data):
         line = sub(r'boot_cpu_data.x86_phys_bits', 'kvm_x86_phys_bits', line)
         if match(r'^static const struct vm_operations_struct kvm_'):
             line = sub(r' const ', ' ', line)
+        if line == 'static void *nested_svm_map(struct vcpu_svm *svm, u64 gpa, enum km_type idx)':
+            line = sub(r'\)', ', struct page **mapped_page)', line)
+        if line == '\treturn kmap_atomic(page, idx);':
+            line = '\t*mapped_page = page;\n' + line
+        if line == 'static void nested_svm_unmap(void *addr, enum km_type idx)':
+            line = sub(r'\)', ', struct page *mapped_page)', line)
+        if line == '\tpage = kmap_atomic_to_page(addr);':
+            line = '\tpage = mapped_page;'
+        if match(r'= nested_svm_map(.*);'):
+            line = '\t{ struct page *mapped_page;\n' + sub(r'\);', ', &mapped_page);', line)
+        if match('nested_svm_unmap(.*);'):
+            line = sub(r'\);', ', mapped_page); }', line)
         w(line)
         if match(r'\tkvm_init_debug'):
             w('\thrtimer_kallsyms_resolve();')