From patchwork Tue Jun 14 12:13:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cornelia Huck X-Patchwork-Id: 635230 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rTTLN6QBxz9t0q for ; Tue, 14 Jun 2016 22:22:36 +1000 (AEST) Received: from localhost ([::1]:34819 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCnMY-0007lk-F8 for incoming@patchwork.ozlabs.org; Tue, 14 Jun 2016 08:22:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34267) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCnET-0008UR-CJ for qemu-devel@nongnu.org; Tue, 14 Jun 2016 08:14:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bCnEN-0002TZ-K1 for qemu-devel@nongnu.org; Tue, 14 Jun 2016 08:14:12 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:38966) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCnEN-0002TS-Be for qemu-devel@nongnu.org; Tue, 14 Jun 2016 08:14:07 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u5ECDo8D105122 for ; Tue, 14 Jun 2016 08:14:06 -0400 Received: from e06smtp10.uk.ibm.com (e06smtp10.uk.ibm.com [195.75.94.106]) by mx0a-001b2d01.pphosted.com with ESMTP id 23jgpcafye-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 14 Jun 2016 08:14:06 -0400 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 14 Jun 2016 13:14:04 +0100 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 14 Jun 2016 13:14:01 +0100 X-IBM-Helo: d06dlp02.portsmouth.uk.ibm.com X-IBM-MailFrom: cornelia.huck@de.ibm.com X-IBM-RcptTo: qemu-devel@nongnu.org Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 85CAF219005E for ; Tue, 14 Jun 2016 13:13:32 +0100 (BST) Received: from d06av07.portsmouth.uk.ibm.com (d06av07.portsmouth.uk.ibm.com [9.149.37.248]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u5ECE08S18350450 for ; Tue, 14 Jun 2016 12:14:00 GMT Received: from d06av07.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u5ECE0Pj005794 for ; Tue, 14 Jun 2016 08:14:00 -0400 Received: from gondolin.boeblingen.de.ibm.com (dyn-9-152-224-202.boeblingen.de.ibm.com [9.152.224.202]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u5ECDvp9005597 (version=TLSv1/SSLv3 cipher=AES256-SHA256 bits=256 verify=NO); Tue, 14 Jun 2016 08:13:59 -0400 From: Cornelia Huck To: peter.maydell@linaro.org Date: Tue, 14 Jun 2016 14:13:55 +0200 X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160614121355.9320-1-cornelia.huck@de.ibm.com> References: <20160614121355.9320-1-cornelia.huck@de.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16061412-0040-0000-0000-000001ED16EF X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16061412-0041-0000-0000-000020A15D2F Message-Id: <20160614121355.9320-8-cornelia.huck@de.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-06-14_05:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1606140137 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PULL 7/7] s390x/kvm: Fixup interrupt type for non-adapter I/O interrupts X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Cornelia Huck , borntraeger@de.ibm.com, jfrei@linux.vnet.ibm.com, agraf@suse.de, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Christian Borntraeger The current algorithm for I/O interrupts would result in a wrong interrupt type for subchannel numbers fffe and ffff. In addition a non adapter interrupt might look like an adapter interrupt for any subchannel number that has the 0x0400 bit set. No kernel has ever used the type outside logging - and the logging was wrong all the time. For everything else the kernel used the interrupt parameters. Let's use the KVM_S390_INT_IO macro as for adapter interrupts. Signed-off-by: Christian Borntraeger Reviewed-by: David Hildenbrand Acked-by: Cornelia Huck Signed-off-by: Cornelia Huck --- target-s390x/kvm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c index 8f46fd0..f108cd3 100644 --- a/target-s390x/kvm.c +++ b/target-s390x/kvm.c @@ -2071,8 +2071,9 @@ void kvm_s390_io_interrupt(uint16_t subchannel_id, if (io_int_word & IO_INT_WORD_AI) { irq.type = KVM_S390_INT_IO(1, 0, 0, 0); } else { - irq.type = ((subchannel_id & 0xff00) << 24) | - ((subchannel_id & 0x00060) << 22) | (subchannel_nr << 16); + irq.type = KVM_S390_INT_IO(0, (subchannel_id & 0xff00) >> 8, + (subchannel_id & 0x0006), + subchannel_nr); } kvm_s390_floating_interrupt(&irq); }