From nobody Thu May 2 16:00:59 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=1574425317; cv=none; d=zohomail.com; s=zohoarc; b=mdQsEOnalZOdF6RbqO2tbDdBAI/VhrY3+5gOXvy02Ze9+Gm9mPYawtHfNtkjI+QPc7B0KIFp7d9ZWGFK6YMkFcwEIhHnu22MDhaSPjhgS7k4as6Kwx81CPfQBbR4+EkjGhdvGbW0UMKoDHUisSh0vWrS3loC+lO/F+uKB+iwd2c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574425317; 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=LOfxg9uHLV+6xa2FGTUry5l3n8h/cUbRmt+6SMZLQog=; b=TfcAggWM9CsMbiJw8+U3R5cZz7x7Ej62XT0ViJZqppOHQos9i/aBNLsB5zQwGJz1ums4GYkAZC6BJnMDjRht9r96z5c2bjQ6tbIDh6wHrT9P+LIm1qUqe1klYFGgN0RcdjPFbpe9JuQEJ+cxSPn1DNCMzE4wtI7Au+T/xAuBcsE= 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 15744253178791019.127715475248; Fri, 22 Nov 2019 04:21:57 -0800 (PST) Received: from localhost ([::1]:50118 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iY7wg-00045I-JW for importer@patchew.org; Fri, 22 Nov 2019 07:21:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45937) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iY7vV-0003UI-Bv for qemu-devel@nongnu.org; Fri, 22 Nov 2019 07:20:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iY7vT-0005PQ-Qu for qemu-devel@nongnu.org; Fri, 22 Nov 2019 07:20:41 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:20574) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iY7vT-0005P7-J0 for qemu-devel@nongnu.org; Fri, 22 Nov 2019 07:20:39 -0500 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xAMCCo12142398 for ; Fri, 22 Nov 2019 07:20:35 -0500 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0a-001b2d01.pphosted.com with ESMTP id 2wdqn0p3c7-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 22 Nov 2019 07:20:35 -0500 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 22 Nov 2019 12:20:33 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) 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, 22 Nov 2019 12:20:31 -0000 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id xAMCKTKY38338656 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 22 Nov 2019 12:20:29 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BA7A342049; Fri, 22 Nov 2019 12:20:29 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A943E42045; Fri, 22 Nov 2019 12:20:27 +0000 (GMT) Received: from localhost.localdomain (unknown [9.145.41.23]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 22 Nov 2019 12:20:27 +0000 (GMT) From: Janosch Frank To: qemu-devel@nongnu.org Subject: [PATCH] Remove wrappers Date: Fri, 22 Nov 2019 07:20:19 -0500 X-Mailer: git-send-email 2.20.1 In-Reply-To: <4793f8ae-a709-2a41-ea71-4197a026b58a@redhat.com> References: <4793f8ae-a709-2a41-ea71-4197a026b58a@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 x-cbid: 19112212-0016-0000-0000-000002CAC856 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19112212-0017-0000-0000-0000332C92FD Message-Id: <20191122122019.23069-1-frankja@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-11-22_02:2019-11-21,2019-11-22 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 spamscore=0 lowpriorityscore=0 mlxlogscore=999 priorityscore=1501 impostorscore=0 clxscore=1015 suspectscore=1 malwarescore=0 bulkscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-1911220111 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.156.1 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" That's what it would look like. Signed-off-by: Janosch Frank --- target/s390x/cpu-qom.h | 12 ++++++++---- target/s390x/cpu.c | 28 +++++----------------------- target/s390x/cpu.h | 8 +++++--- target/s390x/sigp.c | 4 ++-- 4 files changed, 20 insertions(+), 32 deletions(-) diff --git a/target/s390x/cpu-qom.h b/target/s390x/cpu-qom.h index b809ec8418..e8ec999e77 100644 --- a/target/s390x/cpu-qom.h +++ b/target/s390x/cpu-qom.h @@ -34,13 +34,18 @@ typedef struct S390CPUModel S390CPUModel; typedef struct S390CPUDef S390CPUDef; =20 +typedef enum cpu_reset_type { + S390_CPU_RESET_NORMAL, + S390_CPU_RESET_INITIAL, + S390_CPU_RESET_CLEAR, +} cpu_reset_type; + /** * S390CPUClass: * @parent_realize: The parent class' realize handler. * @parent_reset: The parent class' reset handler. * @load_normal: Performs a load normal. - * @cpu_reset: Performs a CPU reset. - * @initial_cpu_reset: Performs an initial CPU reset. + * @reset: Performs a CPU reset of a given type. * * An S/390 CPU model. */ @@ -57,8 +62,7 @@ typedef struct S390CPUClass { DeviceRealize parent_realize; void (*parent_reset)(CPUState *cpu); void (*load_normal)(CPUState *cpu); - void (*cpu_reset)(CPUState *cpu); - void (*initial_cpu_reset)(CPUState *cpu); + void (*reset)(CPUState *cpu, cpu_reset_type type); } S390CPUClass; =20 typedef struct S390CPU S390CPU; diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index 556afecbc1..970495d042 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -82,12 +82,6 @@ static void s390_cpu_load_normal(CPUState *s) } #endif =20 -typedef enum cpu_reset_type { - S390_CPU_RESET_NORMAL, - S390_CPU_RESET_INITIAL, - S390_CPU_RESET_CLEAR, -} cpu_reset_type; - static void s390_cpu_reset(CPUState *s, cpu_reset_type type) { S390CPU *cpu =3D S390_CPU(s); @@ -138,21 +132,6 @@ static void s390_cpu_reset(CPUState *s, cpu_reset_type= type) #endif } =20 -static void s390_cpu_reset_normal(CPUState *s) -{ - return s390_cpu_reset(s, S390_CPU_RESET_NORMAL); -} - -static void s390_cpu_reset_initial(CPUState *s) -{ - return s390_cpu_reset(s, S390_CPU_RESET_INITIAL); -} - -static void s390_cpu_reset_clear(CPUState *s) -{ - return s390_cpu_reset(s, S390_CPU_RESET_CLEAR); -} - #if !defined(CONFIG_USER_ONLY) static void s390_cpu_machine_reset_cb(void *opaque) { @@ -444,6 +423,11 @@ static Property s390x_cpu_properties[] =3D { DEFINE_PROP_END_OF_LIST() }; =20 +static void s390_cpu_reset_clear(CPUState *s) +{ + return s390_cpu_reset(s, S390_CPU_RESET_CLEAR); +} + static void s390_cpu_class_init(ObjectClass *oc, void *data) { S390CPUClass *scc =3D S390_CPU_CLASS(oc); @@ -459,8 +443,6 @@ static void s390_cpu_class_init(ObjectClass *oc, void *= data) #if !defined(CONFIG_USER_ONLY) scc->load_normal =3D s390_cpu_load_normal; #endif - scc->cpu_reset =3D s390_cpu_reset_normal; - scc->initial_cpu_reset =3D s390_cpu_reset_initial; cc->reset =3D s390_cpu_reset_clear; cc->class_by_name =3D s390_cpu_class_by_name, cc->has_work =3D s390_cpu_has_work; diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index 17460ed7b3..687b31d87e 100644 --- a/target/s390x/cpu.h +++ b/target/s390x/cpu.h @@ -734,21 +734,23 @@ static inline uint64_t s390_build_validity_mcic(void) =20 static inline void s390_do_cpu_full_reset(CPUState *cs, run_on_cpu_data ar= g) { - cpu_reset(cs); + S390CPUClass *scc =3D S390_CPU_GET_CLASS(cs); + + scc->reset(cs, S390_CPU_RESET_CLEAR); } =20 static inline void s390_do_cpu_reset(CPUState *cs, run_on_cpu_data arg) { S390CPUClass *scc =3D S390_CPU_GET_CLASS(cs); =20 - scc->cpu_reset(cs); + scc->reset(cs, S390_CPU_RESET_CLEAR); } =20 static inline void s390_do_cpu_initial_reset(CPUState *cs, run_on_cpu_data= arg) { S390CPUClass *scc =3D S390_CPU_GET_CLASS(cs); =20 - scc->initial_cpu_reset(cs); + scc->reset(cs, S390_CPU_RESET_INITIAL); } =20 static inline void s390_do_cpu_load_normal(CPUState *cs, run_on_cpu_data a= rg) diff --git a/target/s390x/sigp.c b/target/s390x/sigp.c index 2ce22d4dc1..727875bb4a 100644 --- a/target/s390x/sigp.c +++ b/target/s390x/sigp.c @@ -254,7 +254,7 @@ static void sigp_initial_cpu_reset(CPUState *cs, run_on= _cpu_data arg) SigpInfo *si =3D arg.host_ptr; =20 cpu_synchronize_state(cs); - scc->initial_cpu_reset(cs); + scc->reset(cs, S390_CPU_RESET_INITIAL); cpu_synchronize_post_reset(cs); si->cc =3D SIGP_CC_ORDER_CODE_ACCEPTED; } @@ -266,7 +266,7 @@ static void sigp_cpu_reset(CPUState *cs, run_on_cpu_dat= a arg) SigpInfo *si =3D arg.host_ptr; =20 cpu_synchronize_state(cs); - scc->cpu_reset(cs); + scc->reset(cs, S390_CPU_RESET_NORMAL); cpu_synchronize_post_reset(cs); si->cc =3D SIGP_CC_ORDER_CODE_ACCEPTED; } --=20 2.20.1