From nobody Wed Apr 24 07:12:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1575019822; cv=none; d=zohomail.com; s=zohoarc; b=JApgxpGSXbbV4tAN5A6ENUrhxqT4MvoH4dmp5rz8t3pLCV/j2k4QOSbQWdSupahlFFAJmBe2g3qaD5n/DXZQguiEnNazRmXfMN18KIdntIecy8gXJeEYCS4egB9CWm1PwFqQXyMiHstea43SQv0Ds2aXG90c8UvjVLH1R3NpfQc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1575019822; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=qX/rTkG0x8V/+mR6uvf5ChAPosw3P8YQRzYVmhk+nek=; b=QJ+ExmmUm2qVlQSx2A0yZQY+4wP282da6LqScxLb8W48xqjPdYrrY0QBcP63SrPhx/crRdkeZRR0rxlyX+xHM+Cfw5hZrghD2fF9O/Gs2yUwUwuFrywAw4thrjZH4de5N2GpFiqep3iwz7oWayEPXzguhhGvz4nIYvc7/OOj9SI= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1575019821722481.6060094365972; Fri, 29 Nov 2019 01:30:21 -0800 (PST) Received: from localhost ([::1]:56346 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iacbT-000645-7T for importer@patchew.org; Fri, 29 Nov 2019 04:30:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:58046) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iacQ5-0000JG-Av for qemu-devel@nongnu.org; Fri, 29 Nov 2019 04:18:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iacPy-0002oo-05 for qemu-devel@nongnu.org; Fri, 29 Nov 2019 04:18:27 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:29580 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iacPu-0002jr-Mo for qemu-devel@nongnu.org; Fri, 29 Nov 2019 04:18:23 -0500 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xAT9ICPW118514 for ; Fri, 29 Nov 2019 04:18:18 -0500 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0b-001b2d01.pphosted.com with ESMTP id 2wjttrsw11-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 29 Nov 2019 04:18:16 -0500 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 29 Nov 2019 09:17:24 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 29 Nov 2019 09:17:21 -0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id xAT9HJCM55312428 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 29 Nov 2019 09:17:19 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A525B4C04A; Fri, 29 Nov 2019 09:17:19 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A0F904C044; Fri, 29 Nov 2019 09:17:17 +0000 (GMT) Received: from localhost.localdomain (unknown [9.145.188.128]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 29 Nov 2019 09:17:17 +0000 (GMT) From: Janosch Frank To: qemu-devel@nongnu.org Subject: [PATCH v5] s390x: kvm: Make kvm_sclp_service_call void Date: Fri, 29 Nov 2019 04:17:13 -0500 X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191129100155.331ae2f0.cohuck@redhat.com> References: <20191129100155.331ae2f0.cohuck@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 x-cbid: 19112909-0016-0000-0000-000002CDD12E X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19112909-0017-0000-0000-0000332FBADF Message-Id: <20191129091713.4582-1-frankja@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-11-29_02:2019-11-29,2019-11-29 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 clxscore=1015 mlxscore=0 phishscore=0 bulkscore=0 mlxlogscore=999 spamscore=0 lowpriorityscore=0 suspectscore=1 adultscore=0 malwarescore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-1911290081 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.158.5 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: thuth@redhat.com, pmorel@linux.ibm.com, david@redhat.com, cohuck@redhat.com, borntraeger@de.ibm.com, qemu-s390x@nongnu.org, mihajlov@linux.ibm.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" It defaults to returning 0 anyway and that return value is not necessary, as 0 is also the default rc that the caller would return. While doing that we can simplify the logic a bit and return early if we inject a PGM exception. Signed-off-by: Janosch Frank Reviewed-by: Thomas Huth Reviewed-by: David Hildenbrand --- target/s390x/kvm.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c index 0c9d14b4b1..ad6e38c876 100644 --- a/target/s390x/kvm.c +++ b/target/s390x/kvm.c @@ -1159,13 +1159,13 @@ void kvm_s390_access_exception(S390CPU *cpu, uint16= _t code, uint64_t te_code) kvm_s390_vcpu_interrupt(cpu, &irq); } =20 -static int kvm_sclp_service_call(S390CPU *cpu, struct kvm_run *run, +static void kvm_sclp_service_call(S390CPU *cpu, struct kvm_run *run, uint16_t ipbh0) { CPUS390XState *env =3D &cpu->env; uint64_t sccb; uint32_t code; - int r =3D 0; + int r; =20 sccb =3D env->regs[ipbh0 & 0xf]; code =3D env->regs[(ipbh0 & 0xf0) >> 4]; @@ -1173,11 +1173,9 @@ static int kvm_sclp_service_call(S390CPU *cpu, struc= t kvm_run *run, r =3D sclp_service_call(env, sccb, code); if (r < 0) { kvm_s390_program_interrupt(cpu, -r); - } else { - setcc(cpu, r); + return; } - - return 0; + setcc(cpu, r); } =20 static int handle_b2(S390CPU *cpu, struct kvm_run *run, uint8_t ipa1) @@ -1240,7 +1238,7 @@ static int handle_b2(S390CPU *cpu, struct kvm_run *ru= n, uint8_t ipa1) setcc(cpu, 3); break; case PRIV_B2_SCLP_CALL: - rc =3D kvm_sclp_service_call(cpu, run, ipbh0); + kvm_sclp_service_call(cpu, run, ipbh0); break; default: rc =3D -1; --=20 2.20.1