public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: Gleb Natapov <gleb@kernel.org>, Paolo Bonzini <pbonzini@redhat.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>,
	kvm@vger.kernel.org, linux-s390@vger.kernel.org,
	Dominik Dingel <dingel@linux.vnet.ibm.com>,
	stable@vger.kernel.org, Cornelia Huck <cornelia.huck@de.ibm.com>
Subject: [PULL 6/6] KVM: s390: ioeventfd: ignore leftmost bits
Date: Wed, 11 Dec 2013 19:57:49 +0100	[thread overview]
Message-ID: <1386788269-20249-7-git-send-email-cornelia.huck@de.ibm.com> (raw)
In-Reply-To: <1386788269-20249-1-git-send-email-cornelia.huck@de.ibm.com>

From: Dominik Dingel <dingel@linux.vnet.ibm.com>

The diagnose 500 subcode 3 contains the 32 bit subchannel id in bits 32-63
(counting from the left). As for other I/O instructions, bits 0-31 should be
ignored and thus not be passed to kvm_io_bus_write_cookie().

This fixes a bug where the guest passed non-zero bits 0-31 which the
host tried to interpret, leading to ioeventfd notification failures.

Cc: stable@vger.kernel.org
Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
---
 arch/s390/kvm/diag.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/s390/kvm/diag.c b/arch/s390/kvm/diag.c
index 5ff29be..8216c0e 100644
--- a/arch/s390/kvm/diag.c
+++ b/arch/s390/kvm/diag.c
@@ -121,7 +121,7 @@ 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] & 0xffffffff,
 				      8, &vcpu->run->s.regs.gprs[3],
 				      vcpu->run->s.regs.gprs[4]);
 
-- 
1.7.9.5


      parent reply	other threads:[~2013-12-11 18:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-11 18:57 [PULL 0/6] KVM: s390: patches for kvm-next Cornelia Huck
2013-12-11 18:57 ` [PULL 1/6] KVM: s390: diagnose call documentation Cornelia Huck
2013-12-11 18:57 ` [PULL 2/6] KVM: s390: Use helper function to set CC in SIGP handler Cornelia Huck
2013-12-11 18:57 ` [PULL 3/6] KVM: s390: Add the SIGP order CONDITIONAL EMERGENCY SIGNAL Cornelia Huck
2013-12-11 18:57 ` [PULL 4/6] KVM: s390: Reworked SIGP RESTART order Cornelia Huck
2013-12-11 18:57 ` [PULL 5/6] KVM: s390: SIGP START has to report BUSY while stopping a CPU Cornelia Huck
2013-12-11 18:57 ` Cornelia Huck [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1386788269-20249-7-git-send-email-cornelia.huck@de.ibm.com \
    --to=cornelia.huck@de.ibm.com \
    --cc=borntraeger@de.ibm.com \
    --cc=dingel@linux.vnet.ibm.com \
    --cc=gleb@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox