提交 f20d2752 编写于 作者: J Jes Sorensen 提交者: Avi Kivity

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: NJes Sorensen <jes@sgi.com>
Acked-by: NXiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: NAvi Kivity <avi@qumranet.com>
上级 39b945a3
...@@ -159,7 +159,8 @@ static void mmio_access(struct kvm_vcpu *vcpu, u64 src_pa, u64 *dest, ...@@ -159,7 +159,8 @@ static void mmio_access(struct kvm_vcpu *vcpu, u64 src_pa, u64 *dest,
if (p->u.ioreq.state == STATE_IORESP_READY) { if (p->u.ioreq.state == STATE_IORESP_READY) {
if (dir == IOREQ_READ) if (dir == IOREQ_READ)
*dest = p->u.ioreq.data; /* it's necessary to ensure zero extending */
*dest = p->u.ioreq.data & (~0UL >> (64-(s*8)));
} else } else
panic_vm(vcpu); panic_vm(vcpu);
out: out:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册