All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Avi Kivity <avi@redhat.com>, Marcelo Tosatti <mtosatti@redhat.com>
Cc: kvm@vger.kernel.org
Subject: [PATCH 3/4] Avoid kmap_atomic_to_page in svm
Date: Mon, 12 Oct 2009 10:54:54 +0200	[thread overview]
Message-ID: <20091012085454.20775.70384.stgit@mchn012c.ww002.siemens.net> (raw)
In-Reply-To: <20091012085454.20775.12700.stgit@mchn012c.ww002.siemens.net>

kmap_atomic_to_page was not exported before 2.6.32, and adding a compat
wrapper for it is impossible due to further missing exports. This breaks
x86-32 modules under CONFIG_HIGHMEM.

So avoid its use via a crude hack: nested_svm_map callers receive the
mapped page and have to pass it back to nested_svm_unmap.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

 sync |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

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();')


  parent reply	other threads:[~2009-10-12  8:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-12  8:54 [PULL REQUEST] kvm-kmod Jan Kiszka
2009-10-12  8:54 ` [PATCH 4/4] Update source link Jan Kiszka
2009-10-12  8:54 ` Jan Kiszka [this message]
2009-10-12  8:54 ` [PATCH 1/4] Remove const from vm_ops to avoid warnings on older kernels Jan Kiszka
2009-10-12  8:54 ` [PATCH 2/4] Add cpufreq_get wrapper for !CONFIG_CPU_FREQ Jan Kiszka
2009-10-12 22:27 ` [PULL REQUEST] kvm-kmod Marcelo Tosatti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091012085454.20775.70384.stgit@mchn012c.ww002.siemens.net \
    --to=jan.kiszka@siemens.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.