As the IO Instruction format defines, the first 32 bits have to be ignored.

This fixes a bug, when the guest don't clear the first 32 bits and the host
then tries to interpret this.

Cc: [email protected]
Signed-off-by: Dominik Dingel <[email protected]>
---
 arch/s390/kvm/diag.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/s390/kvm/diag.c b/arch/s390/kvm/diag.c
index 4ad0336..213fccf 100644
--- a/arch/s390/kvm/diag.c
+++ b/arch/s390/kvm/diag.c
@@ -206,7 +206,8 @@ static int __diag_virtio_hypercall(struct kvm_vcpu *vcpu)
         * - gpr 4 contains the index on the bus (optionally)
         */
        ret = kvm_io_bus_write_cookie(vcpu->kvm, KVM_VIRTIO_CCW_NOTIFY_BUS,
-                                     vcpu->run->s.regs.gprs[2],
+                                     vcpu->run->s.regs.gprs[2] & 
+                                     0x00000000ffffffff,
                                      8, &vcpu->run->s.regs.gprs[3],
                                      vcpu->run->s.regs.gprs[4]);
 
-- 
1.8.3.4

--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to