aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/kvm/mmio.c
diff options
context:
space:
mode:
authorJes Sorensen <jes@sgi.com>2008-05-20 07:13:50 -0400
committerAvi Kivity <avi@qumranet.com>2008-06-06 14:08:25 -0400
commitf20d2752980c144c82649eb18746ef0c29f508dd (patch)
treec80876c536a9f26cb4147202cbbab9f1bd4862a6 /arch/ia64/kvm/mmio.c
parent39b945a37bac2b692773a470890c8ba301485b15 (diff)
KVM: ia64: fix zero extending for mmio ld1/2/4 emulation in KVM
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> Acked-by: Xiantao Zhang <xiantao.zhang@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'arch/ia64/kvm/mmio.c')
-rw-r--r--arch/ia64/kvm/mmio.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/ia64/kvm/mmio.c b/arch/ia64/kvm/mmio.c
index 351bf70da463..7f1a858bc69f 100644
--- a/arch/ia64/kvm/mmio.c
+++ b/arch/ia64/kvm/mmio.c
@@ -159,7 +159,8 @@ static void mmio_access(struct kvm_vcpu *vcpu, u64 src_pa, u64 *dest,
159 159
160 if (p->u.ioreq.state == STATE_IORESP_READY) { 160 if (p->u.ioreq.state == STATE_IORESP_READY) {
161 if (dir == IOREQ_READ) 161 if (dir == IOREQ_READ)
162 *dest = p->u.ioreq.data; 162 /* it's necessary to ensure zero extending */
163 *dest = p->u.ioreq.data & (~0UL >> (64-(s*8)));
163 } else 164 } else
164 panic_vm(vcpu); 165 panic_vm(vcpu);
165out: 166out: