All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 26/27] Enable 32bit dirty log pointers on 64bit host
@ 2009-09-29  8:18 Alexander Graf
  2009-09-29  9:14 ` Avi Kivity
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: Alexander Graf @ 2009-09-29  8:18 UTC (permalink / raw)
  To: kvm-ppc

With big endian userspace, we can't quite figure out if a pointer
is 32 bit (shifted >> 32) or 64 bit when we read a 64 bit pointer.

This is what happens with dirty logging. To get the pointer interpreted
correctly, I just make it bounce twice, but admittedly that is not ideal.

I'm open for suggestions here.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 virt/kvm/kvm_main.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index e27b7a9..91c0225 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -720,6 +720,11 @@ int kvm_get_dirty_log(struct kvm *kvm,
 
 	r = -EFAULT;
 	if (copy_to_user(log->dirty_bitmap, memslot->dirty_bitmap, n))
+#ifdef __BIG_ENDIAN
+		/* Did we get a 32 bit pointer? */
+		if (copy_to_user((void*)((u64)log->dirty_bitmap >> 32),
+				 memslot->dirty_bitmap, n))
+#endif
 		goto out;
 
 	if (any)
-- 
1.6.0.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2009-10-20 13:32 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-29  8:18 [PATCH 26/27] Enable 32bit dirty log pointers on 64bit host Alexander Graf
2009-09-29  9:14 ` Avi Kivity
2009-09-29  9:17 ` Alexander Graf
2009-09-29 13:25 ` Avi Kivity
2009-09-29 14:08 ` Alexander Graf
2009-09-29 16:29 ` Alexander Graf
2009-09-29 16:42 ` Avi Kivity
2009-09-29 17:09 ` Alexander Graf
2009-09-30 12:04 ` Arnd Bergmann
2009-09-30 13:17 ` Avi Kivity
2009-09-30 13:29 ` Avi Kivity
2009-10-20 10:09 ` Alexander Graf
2009-10-20 13:23 ` Avi Kivity
2009-10-20 13:28 ` Alexander Graf
2009-10-20 13:32 ` Avi Kivity

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.