From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Carstens Subject: Re: [PATCH 06/12] KVM: s390: exploit GISA and AIV for emulated interrupts Date: Wed, 17 Jan 2018 09:14:03 +0100 Message-ID: <20180117081403.GB5708@osiris> References: <20180116200217.211897-1-borntraeger@de.ibm.com> <20180116200217.211897-7-borntraeger@de.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Cornelia Huck , KVM , linux-s390 , Janosch Frank , David Hildenbrand , Michael Mueller To: Christian Borntraeger Return-path: Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:53454 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750810AbeAQIOM (ORCPT ); Wed, 17 Jan 2018 03:14:12 -0500 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w0H8E7lY043850 for ; Wed, 17 Jan 2018 03:14:11 -0500 Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) by mx0a-001b2d01.pphosted.com with ESMTP id 2fhyr876y1-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 17 Jan 2018 03:14:11 -0500 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 17 Jan 2018 08:14:08 -0000 Content-Disposition: inline In-Reply-To: <20180116200217.211897-7-borntraeger@de.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Jan 16, 2018 at 09:02:11PM +0100, Christian Borntraeger wrote: > +static int __do_deliver_io(struct kvm_vcpu *vcpu, struct kvm_s390_io_info *io) > +{ > + int rc; > + > + rc = put_guest_lc(vcpu, io->subchannel_id, > + (u16 *)__LC_SUBCHANNEL_ID); > + rc |= put_guest_lc(vcpu, io->subchannel_nr, > + (u16 *)__LC_SUBCHANNEL_NR); > + rc |= put_guest_lc(vcpu, io->io_int_parm, > + (u32 *)__LC_IO_INT_PARM); > + rc |= put_guest_lc(vcpu, io->io_int_word, > + (u32 *)__LC_IO_INT_WORD); They all fit into one line now ;) > + rc |= write_guest_lc(vcpu, __LC_IO_OLD_PSW, > + &vcpu->arch.sie_block->gpsw, > + sizeof(psw_t)); > + rc |= read_guest_lc(vcpu, __LC_IO_NEW_PSW, > + &vcpu->arch.sie_block->gpsw, > + sizeof(psw_t)); > + return rc; > +} return rc = -EFAULT : 0; from below should be moved to this function, so it has a well defined return value instead of random garbage. Well, it's -EFAULT or 0 currently anyway, but nobody knows... > static int __must_check __deliver_io(struct kvm_vcpu *vcpu, > unsigned long irq_type) > { ... > +out: > return rc ? -EFAULT : 0; > }