public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] fix zero extending for mmio ld1/2/4 emulation in KVM
@ 2008-05-20  9:57 Jes Sorensen
  2008-05-20 10:33 ` Matthew Chapman
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Jes Sorensen @ 2008-05-20  9:57 UTC (permalink / raw)
  To: linux-ia64

[-- Attachment #1: Type: text/plain, Size: 188 bytes --]

Hi,

This one seems to solve the problem I have been seeing with ld2.acq
not being zero extended under KVM.

I believe this patch is correct - please shoot me if I am wrong.

Cheers,
Jes


[-- Attachment #2: mmio-zero-extend.diff --]
[-- Type: text/plain, Size: 834 bytes --]

Only copy in the data actually requested by the instruction emulation
and zero pad the destination register first. This avoids the problem
where emulated mmio access got garbled data from ld2.acq instructions
in the vga console driver.

Signed-off-by: Jes Sorensen <jes@sgi.com>

---
 arch/ia64/kvm/mmio.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Index: linux-2.6.git/arch/ia64/kvm/mmio.c
===================================================================
--- linux-2.6.git.orig/arch/ia64/kvm/mmio.c
+++ linux-2.6.git/arch/ia64/kvm/mmio.c
@@ -158,8 +158,10 @@
 	vmm_transition(vcpu);
 
 	if (p->u.ioreq.state == STATE_IORESP_READY) {
-		if (dir == IOREQ_READ)
-			*dest = p->u.ioreq.data;
+		if (dir == IOREQ_READ) {
+			*dest = 0;
+			memcpy(dest, &p->u.ioreq.data, s);
+		}
 	} else
 		panic_vm(vcpu);
 out:

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

end of thread, other threads:[~2008-05-22 15:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-20  9:57 [patch] fix zero extending for mmio ld1/2/4 emulation in KVM Jes Sorensen
2008-05-20 10:33 ` Matthew Chapman
2008-05-20 11:13 ` Jes Sorensen
2008-05-21  9:46 ` Zhang, Xiantao
2008-05-21 10:05 ` Avi Kivity
2008-05-22  3:45 ` Isaku Yamahata
2008-05-22  8:08 ` Jes Sorensen
2008-05-22 15:16 ` Xu, Anthony
2008-05-22 15:23 ` Jes Sorensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox