From nobody Sun May 19 00:47:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=1597721828; cv=none; d=zohomail.com; s=zohoarc; b=L9er9fTRZPf5viDSq4F51Cm54v/DYJd0KUb/8FNljHTHaz5rEoCFWyTe/vuL6/wUYXHvr0+x7/XJjr8Olnehdp4n2KWlCi3dUTyi16sMGxcCfeK0ka/iAnhDqzDcud9mOdQ+y1FnpI6WPnIMK2aYjncmlQ5vbePGCyAu1p2Z5yQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597721828; h=Content-Type: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=MvO/3TaXIaWi0NFqkMYr5QRYsMxBjotQRfyRCmT/j60=; b=hhEX0W2toNsnHH8w0Jjv71Q7HKeL4FXoofrmHwteWR6C1xeSO+DWkIREw2w6LbZ7RIkblmznk9hhroK3G6h43oQUc9Iexiw6qwxyvfSeIyF3KJyi17EaEx+UG8dcBtH3usVZWBdTAfqYVo6fkoMUUkqRPGnbW5xVSH9NoLOLM7I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 1597721828523882.6488210810326; Mon, 17 Aug 2020 20:37:08 -0700 (PDT) Received: from localhost ([::1]:51618 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k7sQt-0000SH-1E for importer@patchew.org; Mon, 17 Aug 2020 23:37:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41198) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k7sOQ-00045V-Mc; Mon, 17 Aug 2020 23:34:34 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:57408) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k7sOO-0000mE-Kt; Mon, 17 Aug 2020 23:34:34 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 07I3Vmg1040227; Mon, 17 Aug 2020 23:34:01 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3304tdk7b0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Aug 2020 23:34:01 -0400 Received: from m0098410.ppops.net (m0098410.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 07I3WH5t041299; Mon, 17 Aug 2020 23:34:01 -0400 Received: from ppma02wdc.us.ibm.com (aa.5b.37a9.ip4.static.sl-reverse.com [169.55.91.170]) by mx0a-001b2d01.pphosted.com with ESMTP id 3304tdk7ag-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Aug 2020 23:34:01 -0400 Received: from pps.filterd (ppma02wdc.us.ibm.com [127.0.0.1]) by ppma02wdc.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 07I3UBaI027184; Tue, 18 Aug 2020 03:33:59 GMT Received: from b01cxnp23033.gho.pok.ibm.com (b01cxnp23033.gho.pok.ibm.com [9.57.198.28]) by ppma02wdc.us.ibm.com with ESMTP id 3304scgsmt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 18 Aug 2020 03:33:59 +0000 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp23033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07I3Xx8N48824662 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Aug 2020 03:33:59 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4564BAC05F; Tue, 18 Aug 2020 03:33:59 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1FDFAAC05E; Tue, 18 Aug 2020 03:33:52 +0000 (GMT) Received: from morokweng.localdomain.com (unknown [9.211.138.167]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Tue, 18 Aug 2020 03:33:51 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=pp1; bh=MvO/3TaXIaWi0NFqkMYr5QRYsMxBjotQRfyRCmT/j60=; b=bZ/yPHEMhpxVIuf4tn/xLNMuinBJ1YDuCD8h6inPgHQrBcZWm3CAFEMWZp4T8mXb6s5O JFjdGpB3wQ02fMixkM91SkOaqX8YTHhRJl4XHohh4aXFaWz6sBuOCODnooJ2DJRNoZkq K3r1syiVyMoxp7pocB0ANCGf9dN6uGc/nBxrgyJM9dUisPmjVWTX9GA9ahAxk20PPd/9 BSJfnghzdr9TEnnMmK1Q+bpfSYDdIOkXupHM2e1FRzy1Mq8Q0vbQzXNdZLMl6yAxeCiT P6RVuII+p2hQSGvbNOuXgda6TRDH2to4Aw8ozxAmYZbc6EDRp6AaaBohhPZyc/0ugoLA kg== From: Thiago Jung Bauermann To: qemu-ppc@nongnu.org Subject: [PATCH v4 1/8] target/arm: Move start-powered-off property to generic CPUState Date: Tue, 18 Aug 2020 00:33:16 -0300 Message-Id: <20200818033323.336912-2-bauerman@linux.ibm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200818033323.336912-1-bauerman@linux.ibm.com> References: <20200818033323.336912-1-bauerman@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-08-18_01:2020-08-17, 2020-08-18 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 adultscore=0 priorityscore=1501 phishscore=0 spamscore=0 impostorscore=0 suspectscore=1 mlxscore=0 clxscore=1015 malwarescore=0 lowpriorityscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008180022 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; Received-SPF: pass client-ip=148.163.156.1; envelope-from=bauerman@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/17 21:44:44 X-ACL-Warn: Detected OS = Linux 3.x [generic] [fuzzy] X-Spam_score_int: -36 X-Spam_score: -3.7 X-Spam_bar: --- X-Spam_report: (-3.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Peter Maydell , David Hildenbrand , Mark Cave-Ayland , qemu-devel@nongnu.org, Aleksandar Markovic , Thomas Huth , David Gibson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Artyom Tarasenko , Aleksandar Rikalo , Eduardo Habkost , Greg Kurz , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Cornelia Huck , Aurelien Jarno , Paolo Bonzini , Thiago Jung Bauermann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) There are other platforms which also have CPUs that start powered off, so generalize the start-powered-off property so that it can be used by them. Note that ARMv7MState also has a property of the same name but this patch doesn't change it because that class isn't a subclass of CPUState so it wouldn't be a trivial change. This change should not cause any change in behavior. Suggested-by: Eduardo Habkost Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: David Gibson Reviewed-by: Greg Kurz Signed-off-by: Thiago Jung Bauermann --- exec.c | 1 + include/hw/core/cpu.h | 4 ++++ target/arm/cpu.c | 5 ++--- target/arm/cpu.h | 3 --- target/arm/kvm32.c | 2 +- target/arm/kvm64.c | 2 +- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/exec.c b/exec.c index 6f381f98e2..82e82fab09 100644 --- a/exec.c +++ b/exec.c @@ -899,6 +899,7 @@ Property cpu_common_props[] =3D { DEFINE_PROP_LINK("memory", CPUState, memory, TYPE_MEMORY_REGION, MemoryRegion *), #endif + DEFINE_PROP_BOOL("start-powered-off", CPUState, start_powered_off, fal= se), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 8f145733ce..9fc2696db5 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -374,6 +374,10 @@ struct CPUState { bool created; bool stop; bool stopped; + + /* Should CPU start in powered-off state? */ + bool start_powered_off; + bool unplug; bool crash_occurred; bool exit_request; diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 111579554f..ec65c7653f 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -174,8 +174,8 @@ static void arm_cpu_reset(DeviceState *dev) env->vfp.xregs[ARM_VFP_MVFR1] =3D cpu->isar.mvfr1; env->vfp.xregs[ARM_VFP_MVFR2] =3D cpu->isar.mvfr2; =20 - cpu->power_state =3D cpu->start_powered_off ? PSCI_OFF : PSCI_ON; - s->halted =3D cpu->start_powered_off; + cpu->power_state =3D s->start_powered_off ? PSCI_OFF : PSCI_ON; + s->halted =3D s->start_powered_off; =20 if (arm_feature(env, ARM_FEATURE_IWMMXT)) { env->iwmmxt.cregs[ARM_IWMMXT_wCID] =3D 0x69051000 | 'Q'; @@ -2182,7 +2182,6 @@ static const ARMCPUInfo arm_cpus[] =3D { }; =20 static Property arm_cpu_properties[] =3D { - DEFINE_PROP_BOOL("start-powered-off", ARMCPU, start_powered_off, false= ), DEFINE_PROP_UINT32("psci-conduit", ARMCPU, psci_conduit, 0), DEFINE_PROP_UINT64("midr", ARMCPU, midr, 0), DEFINE_PROP_UINT64("mp-affinity", ARMCPU, diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 9e8ed423ea..a925d26996 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -810,9 +810,6 @@ struct ARMCPU { */ uint32_t psci_version; =20 - /* Should CPU start in PSCI powered-off state? */ - bool start_powered_off; - /* Current power state, access guarded by BQL */ ARMPSCIState power_state; =20 diff --git a/target/arm/kvm32.c b/target/arm/kvm32.c index 0af46b41c8..1f2b8f8b7a 100644 --- a/target/arm/kvm32.c +++ b/target/arm/kvm32.c @@ -218,7 +218,7 @@ int kvm_arch_init_vcpu(CPUState *cs) =20 /* Determine init features for this CPU */ memset(cpu->kvm_init_features, 0, sizeof(cpu->kvm_init_features)); - if (cpu->start_powered_off) { + if (cs->start_powered_off) { cpu->kvm_init_features[0] |=3D 1 << KVM_ARM_VCPU_POWER_OFF; } if (kvm_check_extension(cs->kvm_state, KVM_CAP_ARM_PSCI_0_2)) { diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c index 1169237905..f8a6d905fb 100644 --- a/target/arm/kvm64.c +++ b/target/arm/kvm64.c @@ -775,7 +775,7 @@ int kvm_arch_init_vcpu(CPUState *cs) =20 /* Determine init features for this CPU */ memset(cpu->kvm_init_features, 0, sizeof(cpu->kvm_init_features)); - if (cpu->start_powered_off) { + if (cs->start_powered_off) { cpu->kvm_init_features[0] |=3D 1 << KVM_ARM_VCPU_POWER_OFF; } if (kvm_check_extension(cs->kvm_state, KVM_CAP_ARM_PSCI_0_2)) { From nobody Sun May 19 00:47:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=1597721743; cv=none; d=zohomail.com; s=zohoarc; b=iD4bzHZssUkuXO/Buas0zy0o3hn2EQlmS8fpvJTelcB2o20xzS7xYnb+boLBTRzZQfUp0dnvHow5n74K9Gq8HSj8EuMq+SfIyAMnKWIbWGTZRdHLCTiZAJlEB8gfv5oPs+RA78lfa+unKJpy3Sr6e73ZMl5BOjym/CK7fITePoc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597721743; h=Content-Type: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=MJVxnsr+PE9RmmiXUlrGdTqgD3hIqKlsXA4ckkbFYx8=; b=elJHL8MaVHZ8uVYf0y7KL+BCsy5GvTkuppEcw5znD2kOzzDYSt3HYP/+HBzcHXkvmDz9AqAUdxrjuG/hThPG7CWA7Y9o8feomI+dfGtI2yer+HH2R1FL0bn56vDOMfyyXIgB9jgIfQ1X034FzTtpWlsmp/PjjqX8FXWIXYsgV4c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 1597721743276838.1146088428882; Mon, 17 Aug 2020 20:35:43 -0700 (PDT) Received: from localhost ([::1]:45120 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k7sPW-0006CB-2m for importer@patchew.org; Mon, 17 Aug 2020 23:35:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41248) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k7sOa-0004Oa-6N; Mon, 17 Aug 2020 23:34:44 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:31032) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k7sOY-0000mx-5j; Mon, 17 Aug 2020 23:34:43 -0400 Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 07I34qc4092442; Mon, 17 Aug 2020 23:34:09 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3304rsu3u9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Aug 2020 23:34:09 -0400 Received: from m0187473.ppops.net (m0187473.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 07I358eT092762; Mon, 17 Aug 2020 23:34:09 -0400 Received: from ppma02wdc.us.ibm.com (aa.5b.37a9.ip4.static.sl-reverse.com [169.55.91.170]) by mx0a-001b2d01.pphosted.com with ESMTP id 3304rsu3tu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Aug 2020 23:34:09 -0400 Received: from pps.filterd (ppma02wdc.us.ibm.com [127.0.0.1]) by ppma02wdc.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 07I3UBNU027192; Tue, 18 Aug 2020 03:34:07 GMT Received: from b01cxnp23034.gho.pok.ibm.com (b01cxnp23034.gho.pok.ibm.com [9.57.198.29]) by ppma02wdc.us.ibm.com with ESMTP id 3304scgsnk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 18 Aug 2020 03:34:07 +0000 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07I3Y7IQ52232486 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Aug 2020 03:34:07 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2B127AC05B; Tue, 18 Aug 2020 03:34:07 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DB5EFAC059; Tue, 18 Aug 2020 03:33:59 +0000 (GMT) Received: from morokweng.localdomain.com (unknown [9.211.138.167]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Tue, 18 Aug 2020 03:33:59 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=pp1; bh=MJVxnsr+PE9RmmiXUlrGdTqgD3hIqKlsXA4ckkbFYx8=; b=eGqGNHe1ENEsdz1LOrfbwUWYtEY5x9nK+MsB2t3qSiytOv8bt6yL861/85hqn9Pyellf btpEZtEnklx1TnHjnJWEKpUrcSV2D/K9DLz5Sx0OV1MWhdhqgiUgkvvIxi8SUHdBa5bZ Q0n9Jy5i8cgSPjE6QcyP/0rOpVUqFGEc+zL0N9k4OxBwEFj02t3NLAhimfznVbqb/wJa UtyrHVPHCwP8eE1/pcmBcT8qIX7KHObZEa6DcDphwGMmIFlt3rqFM8qgRft4Cngtuqun eyoA9u15wyujdss+kBmmcKQ4x8F8wd5ts+/a1NRC48aqSjtu3AEXcssMXuo7J+lOt8LF tA== From: Thiago Jung Bauermann To: qemu-ppc@nongnu.org Subject: [PATCH v4 2/8] target/arm: Move setting of CPU halted state to generic code Date: Tue, 18 Aug 2020 00:33:17 -0300 Message-Id: <20200818033323.336912-3-bauerman@linux.ibm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200818033323.336912-1-bauerman@linux.ibm.com> References: <20200818033323.336912-1-bauerman@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-08-18_01:2020-08-17, 2020-08-18 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 mlxlogscore=999 priorityscore=1501 suspectscore=1 phishscore=0 spamscore=0 impostorscore=0 adultscore=0 mlxscore=0 clxscore=1015 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008180022 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; Received-SPF: pass client-ip=148.163.156.1; envelope-from=bauerman@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/17 21:44:44 X-ACL-Warn: Detected OS = Linux 3.1-3.10 [fuzzy] X-Spam_score_int: -36 X-Spam_score: -3.7 X-Spam_bar: --- X-Spam_report: (-3.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Peter Maydell , David Hildenbrand , Mark Cave-Ayland , qemu-devel@nongnu.org, Aleksandar Markovic , Thomas Huth , David Gibson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Artyom Tarasenko , Aleksandar Rikalo , Eduardo Habkost , Greg Kurz , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Cornelia Huck , Aurelien Jarno , Paolo Bonzini , Thiago Jung Bauermann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) This change is in a separate patch because it's not so obvious that it won't cause a regression. Suggested-by: Eduardo Habkost Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: David Gibson Reviewed-by: Greg Kurz Signed-off-by: Thiago Jung Bauermann --- hw/core/cpu.c | 2 +- target/arm/cpu.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/core/cpu.c b/hw/core/cpu.c index 594441a150..71bb7859f1 100644 --- a/hw/core/cpu.c +++ b/hw/core/cpu.c @@ -258,7 +258,7 @@ static void cpu_common_reset(DeviceState *dev) } =20 cpu->interrupt_request =3D 0; - cpu->halted =3D 0; + cpu->halted =3D cpu->start_powered_off; cpu->mem_io_pc =3D 0; cpu->icount_extra =3D 0; atomic_set(&cpu->icount_decr_ptr->u32, 0); diff --git a/target/arm/cpu.c b/target/arm/cpu.c index ec65c7653f..b6c65e4df6 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -175,7 +175,6 @@ static void arm_cpu_reset(DeviceState *dev) env->vfp.xregs[ARM_VFP_MVFR2] =3D cpu->isar.mvfr2; =20 cpu->power_state =3D s->start_powered_off ? PSCI_OFF : PSCI_ON; - s->halted =3D s->start_powered_off; =20 if (arm_feature(env, ARM_FEATURE_IWMMXT)) { env->iwmmxt.cregs[ARM_IWMMXT_wCID] =3D 0x69051000 | 'Q'; From nobody Sun May 19 00:47:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=1597721759; cv=none; d=zohomail.com; s=zohoarc; b=ikygCHiHRFz/HhlhOZjguiNItZ42Op8NZTcvrF6amuJ77vKarB1N/QMNaVl57QIQVrSOZSdnOP5PQjY/F6ZW/z56cL/EiK6f9nJXfw01AFocH0/R6NNhh+YRGMbaYf4r8SVbI86D2nXKiEoOEUtOIdgpqq6dgPhXOq5Y2daAgZs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597721759; 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=ImfHbufiWEShYlyk8bCuzDxu0HKLaoGnoAzDATG6sGM=; b=IBKdcdDUi0Kb6gEUmW85FRZpKHAfQ9MpsJrNx4dbqRPtwoEipz+cF123GNOUKkyAN979a2/rXEDUC0q/wR+YCICOxvYnMCCOCYI5C5tjtSpQRUFEl4znVDIP36IVKy+XdKbbnxmRVrNkxfGn3hwcjlZ9CbcKEy5QtkTUUX9mHIs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 1597721759893334.558448278146; Mon, 17 Aug 2020 20:35:59 -0700 (PDT) Received: from localhost ([::1]:46520 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k7sPm-0006m0-Og for importer@patchew.org; Mon, 17 Aug 2020 23:35:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41288) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k7sOh-0004eZ-7R; Mon, 17 Aug 2020 23:34:51 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:65012 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k7sOe-0000nj-JU; Mon, 17 Aug 2020 23:34:50 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 07I3WR11000833; Mon, 17 Aug 2020 23:34:17 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 3304t133wh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Aug 2020 23:34:17 -0400 Received: from m0098419.ppops.net (m0098419.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 07I3WSLq000882; Mon, 17 Aug 2020 23:34:16 -0400 Received: from ppma05wdc.us.ibm.com (1b.90.2fa9.ip4.static.sl-reverse.com [169.47.144.27]) by mx0b-001b2d01.pphosted.com with ESMTP id 3304t133w9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Aug 2020 23:34:16 -0400 Received: from pps.filterd (ppma05wdc.us.ibm.com [127.0.0.1]) by ppma05wdc.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 07I3UXPb015644; Tue, 18 Aug 2020 03:34:15 GMT Received: from b01cxnp23034.gho.pok.ibm.com (b01cxnp23034.gho.pok.ibm.com [9.57.198.29]) by ppma05wdc.us.ibm.com with ESMTP id 3304tggsbd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 18 Aug 2020 03:34:15 +0000 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07I3YEQS55312694 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Aug 2020 03:34:14 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CFA0EAC05B; Tue, 18 Aug 2020 03:34:14 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A8796AC059; Tue, 18 Aug 2020 03:34:07 +0000 (GMT) Received: from morokweng.localdomain.com (unknown [9.211.138.167]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Tue, 18 Aug 2020 03:34:07 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=ImfHbufiWEShYlyk8bCuzDxu0HKLaoGnoAzDATG6sGM=; b=pH87TPQ8q97N8xl5NB/lY4Z0mTX8yXMsGmT2XU2DN1RMEWsTFBZj6pnz+7dBvr9Znx9T 2OhFi7h1/yreZDplFQmuYbEk6hHoIBA7EYEqWMqzT1U+ua4Ii9S362a8PjxFoNBrXgxf U3mHg/nFoTVRysgbIRFrsCGHg2D5hdujQHnL6cTGHvnABOWL+NoAKTZu4SIQGmfpTK/+ Ms7rcdKduc5WMjVgB/OIIzq4oRwqZukcMIHyM77y5k2feaMRIz+cTai8F5uuvK4t7Q0p 37Ney28Lc4xGuVwG7zfPrYU3HmYNKdohZAK7F3NP+ynCo+t71MWfH5k56Wd1Ejqye9y8 KA== From: Thiago Jung Bauermann To: qemu-ppc@nongnu.org Subject: [PATCH v4 3/8] ppc/spapr: Use start-powered-off CPUState property Date: Tue, 18 Aug 2020 00:33:18 -0300 Message-Id: <20200818033323.336912-4-bauerman@linux.ibm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200818033323.336912-1-bauerman@linux.ibm.com> References: <20200818033323.336912-1-bauerman@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-08-18_01:2020-08-17, 2020-08-18 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 adultscore=0 suspectscore=1 mlxscore=0 lowpriorityscore=0 mlxlogscore=999 malwarescore=0 phishscore=0 priorityscore=1501 bulkscore=0 clxscore=1011 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008180022 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; Received-SPF: pass client-ip=148.163.158.5; envelope-from=bauerman@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/17 23:34:47 X-ACL-Warn: Detected OS = Linux 3.x [generic] [fuzzy] X-Spam_score_int: -36 X-Spam_score: -3.7 X-Spam_bar: --- X-Spam_report: (-3.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Peter Maydell , David Hildenbrand , Mark Cave-Ayland , qemu-devel@nongnu.org, Aleksandar Markovic , Thomas Huth , David Gibson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Artyom Tarasenko , Aleksandar Rikalo , Eduardo Habkost , Greg Kurz , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Cornelia Huck , Aurelien Jarno , Paolo Bonzini , Thiago Jung Bauermann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" PowerPC sPAPR CPUs start in the halted state, and spapr_reset_vcpu() attempts to implement this by setting CPUState::halted to 1. But that's too late for the case of hotplugged CPUs in a machine configure with 2 or more threads per core. By then, other parts of QEMU have already caused the vCPU to run in an unitialized state a couple of times. For example, ppc_cpu_reset() calls ppc_tlb_invalidate_all(), which ends up calling async_run_on_cpu(). This kicks the new vCPU while it has CPUState::halted =3D 0, causing QEMU to iss= ue a KVM_RUN ioctl on the new vCPU before the guest is able to make the start-cpu RTAS call to initialize its register state. This problem doesn't seem to cause visible issues for regular guests, but on a secure guest running under the Ultravisor it does. The Ultravisor relies on being able to snoop on the start-cpu RTAS call to map vCPUs to guests, and this issue causes it to see a stray vCPU that doesn't belong to any guest. Fix by setting the start-powered-off CPUState property in spapr_create_vcpu(), which makes cpu_common_reset() initialize CPUState::halted to 1 at an earlier moment. Suggested-by: Eduardo Habkost Acked-by: David Gibson Reviewed-by: Greg Kurz Signed-off-by: Thiago Jung Bauermann --- hw/ppc/spapr_cpu_core.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c index c4f47dcc04..2125fdac34 100644 --- a/hw/ppc/spapr_cpu_core.c +++ b/hw/ppc/spapr_cpu_core.c @@ -36,11 +36,6 @@ static void spapr_reset_vcpu(PowerPCCPU *cpu) =20 cpu_reset(cs); =20 - /* All CPUs start halted. CPU0 is unhalted from the machine level - * reset code and the rest are explicitly started up by the guest - * using an RTAS call */ - cs->halted =3D 1; - env->spr[SPR_HIOR] =3D 0; =20 lpcr =3D env->spr[SPR_LPCR]; @@ -274,6 +269,11 @@ static PowerPCCPU *spapr_create_vcpu(SpaprCpuCore *sc,= int i, Error **errp) =20 cs =3D CPU(obj); cpu =3D POWERPC_CPU(obj); + /* + * All CPUs start halted. CPU0 is unhalted from the machine level rese= t code + * and the rest are explicitly started up by the guest using an RTAS c= all. + */ + cs->start_powered_off =3D true; cs->cpu_index =3D cc->core_id + i; spapr_set_vcpu_id(cpu, cs->cpu_index, &local_err); if (local_err) { From nobody Sun May 19 00:47:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=1597721847; cv=none; d=zohomail.com; s=zohoarc; b=MmloeVuQKseel/5ZZcAMflqo8x0NI1xMuB/Ti3ye5FVGhnkiMyhYLYdEwopg8ofNhh/rnGofXwLI6ttzdbkEOH+FLEMqoPBBhYiH6nv0FIwy8GHJeHKV7OxNOTiEOXA22eup5TBcnGAjzo+szh8a2yPvJoVe3tQm4UeCtVQp1pE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597721847; 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=Vc2zx12UOMaphWtyABPPHXpZMOTQHMRCgSz79WbZ/Wk=; b=cd+JEAHcXcv86bVRD1rFGdYbbqheUyMPM5q6hSta6OX8X9b2sw2s6oa3xf1inMJ4BCIrsa+0IRlYybcTVozB5YfzgSEmby2N0pyJ+3k4kskuI7fyuisxL7LzJ7pG/liNMcfpxP09yQnPHDpIRU5jdeiKm7eYWwWNHxeJlLmIwgs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 1597721847743792.8006940623582; Mon, 17 Aug 2020 20:37:27 -0700 (PDT) Received: from localhost ([::1]:53174 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k7sRC-00016z-L6 for importer@patchew.org; Mon, 17 Aug 2020 23:37:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41326) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k7sOk-0004ld-30; Mon, 17 Aug 2020 23:34:54 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:21022) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k7sOh-0000nu-IC; Mon, 17 Aug 2020 23:34:53 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 07I33Xgb073959; Mon, 17 Aug 2020 23:34:25 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3304r2u4ra-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Aug 2020 23:34:25 -0400 Received: from m0098393.ppops.net (m0098393.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 07I358Br081098; Mon, 17 Aug 2020 23:34:24 -0400 Received: from ppma04dal.us.ibm.com (7a.29.35a9.ip4.static.sl-reverse.com [169.53.41.122]) by mx0a-001b2d01.pphosted.com with ESMTP id 3304r2u4r2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Aug 2020 23:34:24 -0400 Received: from pps.filterd (ppma04dal.us.ibm.com [127.0.0.1]) by ppma04dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 07I3VGpF012918; Tue, 18 Aug 2020 03:34:23 GMT Received: from b01cxnp22034.gho.pok.ibm.com (b01cxnp22034.gho.pok.ibm.com [9.57.198.24]) by ppma04dal.us.ibm.com with ESMTP id 3304uq8y5x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 18 Aug 2020 03:34:23 +0000 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07I3YMwH50004342 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Aug 2020 03:34:22 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CCB72AC05B; Tue, 18 Aug 2020 03:34:22 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 71130AC059; Tue, 18 Aug 2020 03:34:15 +0000 (GMT) Received: from morokweng.localdomain.com (unknown [9.211.138.167]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Tue, 18 Aug 2020 03:34:15 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=Vc2zx12UOMaphWtyABPPHXpZMOTQHMRCgSz79WbZ/Wk=; b=fPfvXdPZ52Imk4Rsfhg/G4nPTOojNiRP+YihT1V3aTs8PCEqgZX0hiVNEOopbcdfoOY5 ++C9ihSkRHygFiGn3RQ8ppkOfbygWgRjSLv1JLMhT/HbcC4jk3nWRdpu6XNkD00IzbwP 5Vbui92eXlWoraPHQ2fWxxsjtvuL6VosEh8FTrcDrWC5bcUdnm33ZL3x/9Wv18EQG2QA XkVSFS+5hSoZFhUOOjGKn5O5DuzR/ES3qOXGsr2H7biUU+l5s3rKXp2d0zfM3NgHg+4S SfrH0/axnYo2HLO0gdeKeaszHT3mSGeN/Jlro2M+jz1DbOInZ80puY9QItcem3KwQo8j Xg== From: Thiago Jung Bauermann To: qemu-ppc@nongnu.org Subject: [PATCH v4 4/8] ppc/e500: Use start-powered-off CPUState property Date: Tue, 18 Aug 2020 00:33:19 -0300 Message-Id: <20200818033323.336912-5-bauerman@linux.ibm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200818033323.336912-1-bauerman@linux.ibm.com> References: <20200818033323.336912-1-bauerman@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-08-18_01:2020-08-17, 2020-08-18 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 spamscore=0 mlxlogscore=999 bulkscore=0 suspectscore=1 priorityscore=1501 malwarescore=0 impostorscore=0 adultscore=0 clxscore=1015 phishscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008180022 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; Received-SPF: pass client-ip=148.163.156.1; envelope-from=bauerman@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/17 21:44:44 X-ACL-Warn: Detected OS = Linux 3.x [generic] [fuzzy] X-Spam_score_int: -36 X-Spam_score: -3.7 X-Spam_bar: --- X-Spam_report: (-3.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Peter Maydell , David Hildenbrand , Mark Cave-Ayland , qemu-devel@nongnu.org, Aleksandar Markovic , Thomas Huth , David Gibson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Artyom Tarasenko , Aleksandar Rikalo , Eduardo Habkost , Greg Kurz , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Cornelia Huck , Aurelien Jarno , Paolo Bonzini , Thiago Jung Bauermann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Instead of setting CPUState::halted to 1 in ppce500_cpu_reset_sec(), use the start-powered-off property which makes cpu_common_reset() initialize it to 1 in common code. Also change creation of CPU object from cpu_create() to object_new() and qdev_realize() because cpu_create() realizes the CPU and it's not possible to set a property after the object is realized. Signed-off-by: Thiago Jung Bauermann --- hw/ppc/e500.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index ab9884e315..0077aca74d 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -704,9 +704,6 @@ static void ppce500_cpu_reset_sec(void *opaque) =20 cpu_reset(cs); =20 - /* Secondary CPU starts in halted state for now. Needs to change when - implementing non-kernel boot. */ - cs->halted =3D 1; cs->exception_index =3D EXCP_HLT; } =20 @@ -864,8 +861,9 @@ void ppce500_init(MachineState *machine) PowerPCCPU *cpu; CPUState *cs; qemu_irq *input; + Error *err =3D NULL; =20 - cpu =3D POWERPC_CPU(cpu_create(machine->cpu_type)); + cpu =3D POWERPC_CPU(object_new(machine->cpu_type)); env =3D &cpu->env; cs =3D CPU(cpu); =20 @@ -897,6 +895,19 @@ void ppce500_init(MachineState *machine) } else { /* Secondary CPUs */ qemu_register_reset(ppce500_cpu_reset_sec, cpu); + + /* + * Secondary CPU starts in halted state for now. Needs to chan= ge + * when implementing non-kernel boot. + */ + object_property_set_bool(OBJECT(cs), "start-powered-off", true, + &error_abort); + } + + if (!qdev_realize(DEVICE(cs), NULL, &err)) { + error_report_err(err); + object_unref(OBJECT(cs)); + exit(EXIT_FAILURE); } } =20 From nobody Sun May 19 00:47:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=1597721852; cv=none; d=zohomail.com; s=zohoarc; b=eTrd8+jzkY5e/Bs1InR/DVgLK9sS0Wy/VwijKQVeYTr+YlIpmwoKwBfsED/0r54fte35Myh1WT5ICf+1oRjtnzeaAxePM/oMozojNsPk+pGj5TE0XeuKv0NRiJQEYbloNNeDp9hdIidxZemo2UdWX8Zfq17XgoUJ+egfKqqDh+0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597721852; 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=5Cp+2Pjd9M1dvY9eDK1iY1GEDvhSr53MHy1G+xNlYlQ=; b=msGWjuVGb0cHe5DNq72BNcAIzuM/pAFU/xOo7Fl+m6D/T0ELtNbCbf27TpFCV76H8dZ39WnRjhB4HgLsXH9sqdQEWiGsHGoAJPjzag8XVOO5PPh37OZgAo3H8d4nM+sXpqWfWOHLNrxxvT1W+Y4mPPwNfQ3pNX2ArszN6tjv/kc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 1597721852289463.72102534765395; Mon, 17 Aug 2020 20:37:32 -0700 (PDT) Received: from localhost ([::1]:53562 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k7sRH-0001Gd-57 for importer@patchew.org; Mon, 17 Aug 2020 23:37:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41356) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k7sOt-0005CS-SX; Mon, 17 Aug 2020 23:35:03 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:1534) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k7sOr-0000oq-Pw; Mon, 17 Aug 2020 23:35:03 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 07I33X6V073927; Mon, 17 Aug 2020 23:34:32 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3304r2u4t2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Aug 2020 23:34:32 -0400 Received: from m0098393.ppops.net (m0098393.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 07I34B0O075178; Mon, 17 Aug 2020 23:34:32 -0400 Received: from ppma03wdc.us.ibm.com (ba.79.3fa9.ip4.static.sl-reverse.com [169.63.121.186]) by mx0a-001b2d01.pphosted.com with ESMTP id 3304r2u4sk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Aug 2020 23:34:32 -0400 Received: from pps.filterd (ppma03wdc.us.ibm.com [127.0.0.1]) by ppma03wdc.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 07I3UBOK007543; Tue, 18 Aug 2020 03:34:30 GMT Received: from b01cxnp22035.gho.pok.ibm.com (b01cxnp22035.gho.pok.ibm.com [9.57.198.25]) by ppma03wdc.us.ibm.com with ESMTP id 3304cdrw55-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 18 Aug 2020 03:34:30 +0000 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07I3YUVa53084456 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Aug 2020 03:34:30 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 65525AC05B; Tue, 18 Aug 2020 03:34:30 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 706CFAC059; Tue, 18 Aug 2020 03:34:23 +0000 (GMT) Received: from morokweng.localdomain.com (unknown [9.211.138.167]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Tue, 18 Aug 2020 03:34:23 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=5Cp+2Pjd9M1dvY9eDK1iY1GEDvhSr53MHy1G+xNlYlQ=; b=D6v0p9KbMwMaNlo/upSL/zYD7tQlscocFY9DXoqVa9/DaXiTapk1vmYQ37OGQTkQiICl L1m6AGfWflnHhMP6esordhPN32CUIHFQDSwd0gXpz6Tyc0XqpyG5oXuWtc+8h/dhoJXM /OtmErxkLdAZknyuGsgi+Xx0yvZv/CEvzYJp7FU8N+gKW2vBMXGkJSzeIcr1rDUuzPTt 8S7DCV0Qg5y4Vm6k/L+cDG3nx3oEgEdU8JW2HaLTk4OG9DT1jQviu2KE2meRDV24RcNG ULkTDK05CQzrVFJs7t6jQ5HeyH+4zWuyE6a51lvoTr0v21gMzqJbBetj5JtJ4IUldC/x pA== From: Thiago Jung Bauermann To: qemu-ppc@nongnu.org Subject: [PATCH v4 5/8] mips/cps: Use start-powered-off CPUState property Date: Tue, 18 Aug 2020 00:33:20 -0300 Message-Id: <20200818033323.336912-6-bauerman@linux.ibm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200818033323.336912-1-bauerman@linux.ibm.com> References: <20200818033323.336912-1-bauerman@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-08-18_01:2020-08-17, 2020-08-18 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 spamscore=0 mlxlogscore=999 bulkscore=0 suspectscore=1 priorityscore=1501 malwarescore=0 impostorscore=0 adultscore=0 clxscore=1015 phishscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008180022 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; Received-SPF: pass client-ip=148.163.156.1; envelope-from=bauerman@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/17 21:44:44 X-ACL-Warn: Detected OS = Linux 3.x [generic] [fuzzy] X-Spam_score_int: -36 X-Spam_score: -3.7 X-Spam_bar: --- X-Spam_report: (-3.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Peter Maydell , David Hildenbrand , Mark Cave-Ayland , qemu-devel@nongnu.org, Aleksandar Markovic , Thomas Huth , David Gibson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Artyom Tarasenko , Aleksandar Rikalo , Eduardo Habkost , Greg Kurz , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Cornelia Huck , Aurelien Jarno , Paolo Bonzini , Thiago Jung Bauermann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Instead of setting CPUState::halted to 1 in main_cpu_reset(), use the start-powered-off property which makes cpu_common_reset() initialize it to 1 in common code. Also change creation of CPU object from cpu_create() to object_new() and qdev_realize() because cpu_create() realizes the CPU and it's not possible = to set a property after the object is realized. Signed-off-by: Thiago Jung Bauermann --- hw/mips/cps.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/hw/mips/cps.c b/hw/mips/cps.c index 615e1a1ad2..be85357dc0 100644 --- a/hw/mips/cps.c +++ b/hw/mips/cps.c @@ -52,9 +52,6 @@ static void main_cpu_reset(void *opaque) CPUState *cs =3D CPU(cpu); =20 cpu_reset(cs); - - /* All VPs are halted on reset. Leave powering up to CPC. */ - cs->halted =3D 1; } =20 static bool cpu_mips_itu_supported(CPUMIPSState *env) @@ -76,7 +73,9 @@ static void mips_cps_realize(DeviceState *dev, Error **er= rp) bool saar_present =3D false; =20 for (i =3D 0; i < s->num_vp; i++) { - cpu =3D MIPS_CPU(cpu_create(s->cpu_type)); + Error *err =3D NULL; + + cpu =3D MIPS_CPU(object_new(s->cpu_type)); =20 /* Init internal devices */ cpu_mips_irq_init_cpu(cpu); @@ -89,7 +88,16 @@ static void mips_cps_realize(DeviceState *dev, Error **e= rrp) env->itc_tag =3D mips_itu_get_tag_region(&s->itu); env->itu =3D &s->itu; } + /* All VPs are halted on reset. Leave powering up to CPC. */ + object_property_set_bool(OBJECT(cpu), "start-powered-off", true, + &error_abort); qemu_register_reset(main_cpu_reset, cpu); + + if (!qdev_realize(DEVICE(cpu), NULL, &err)) { + error_report_err(err); + object_unref(OBJECT(cpu)); + exit(EXIT_FAILURE); + } } =20 cpu =3D MIPS_CPU(first_cpu); From nobody Sun May 19 00:47:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=1597721912; cv=none; d=zohomail.com; s=zohoarc; b=cx/9TDksekVnuqOxfFfpoDbUTlUWpOAhY6k6LmvZVb/wMnggD4gWXnNkLWcTTyYZUnQWR7EPOqlIMVcGpBBrLlhyAQY50ux1+tlkIP7kRhHh1EUzPwngrxQHJX9LXgyNsGmjeLrEFIBoCXPjM5f7rbEO7UPdd20vH5eoKHjuDME= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597721912; h=Content-Type: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=CQrxg/OF5ga3Tf7sEHbvVx7uiqTao1wgQrITxhY6Bq8=; b=hg6yRRSJBmUd3v3XuE9MAw2mrYUJwmF4P5UbR9EN6cad72liGkgBTvhsIaJhwd3rcM6fbTmZPKfVZlFj/TlkIB/WEZP6kf0vCOXEinuU7nPaO9H3/u6XQS/Cr8s+h9qgtf/4ezIVyX08TVX5jpSdkKAl1KLFUqDNP46c7zNtCtE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 1597721912822469.8147789341675; Mon, 17 Aug 2020 20:38:32 -0700 (PDT) Received: from localhost ([::1]:58692 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k7sSF-0003M1-Oh for importer@patchew.org; Mon, 17 Aug 2020 23:38:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41370) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k7sP1-0005VP-BY; Mon, 17 Aug 2020 23:35:11 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:10838 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k7sOz-0000pH-Hf; Mon, 17 Aug 2020 23:35:11 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 07I3XAn0189090; Mon, 17 Aug 2020 23:34:40 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 3304pf39j8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Aug 2020 23:34:40 -0400 Received: from m0098414.ppops.net (m0098414.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 07I3YeQn193446; Mon, 17 Aug 2020 23:34:40 -0400 Received: from ppma03wdc.us.ibm.com (ba.79.3fa9.ip4.static.sl-reverse.com [169.63.121.186]) by mx0b-001b2d01.pphosted.com with ESMTP id 3304pf39hs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Aug 2020 23:34:40 -0400 Received: from pps.filterd (ppma03wdc.us.ibm.com [127.0.0.1]) by ppma03wdc.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 07I3UBOM007543; Tue, 18 Aug 2020 03:34:39 GMT Received: from b01cxnp22033.gho.pok.ibm.com (b01cxnp22033.gho.pok.ibm.com [9.57.198.23]) by ppma03wdc.us.ibm.com with ESMTP id 3304cdrw5r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 18 Aug 2020 03:34:39 +0000 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07I3YcoI56623500 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Aug 2020 03:34:38 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9439FAC059; Tue, 18 Aug 2020 03:34:38 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0A27AAC05E; Tue, 18 Aug 2020 03:34:31 +0000 (GMT) Received: from morokweng.localdomain.com (unknown [9.211.138.167]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Tue, 18 Aug 2020 03:34:30 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=pp1; bh=CQrxg/OF5ga3Tf7sEHbvVx7uiqTao1wgQrITxhY6Bq8=; b=QWS/fg6hqHpe11MnjB701CAu4FQkN3Z2oYvDuk+MjM5hWcYmcUMP9oOn3MdTomc+Y0AW zZflTHcIwYs0BfXgU21CyU5EWEByeaDRZFhhwdBppfrvA8Wc8L7HjefisK9AXsTfZOQT 7/xEZhqShG6jKyIH7gtL5/ekPDuwpIKZJuaHH6XW+XSpPT5SsGpiW6lfUekHs0C4or8h pahSnDMticq/2mp6nl3ATiGoejJatjrLCLwzDPUmrQTQUM2WsmdZdXCF/CVlNc5itgbl ewGF2QwR6GWbUMQmT2Xhyk2/q3TNKv0lUOdyQYKV0U0SfajpURL1efP/VRIwbZZzsrNG CQ== From: Thiago Jung Bauermann To: qemu-ppc@nongnu.org Subject: [PATCH v4 6/8] sparc/sun4m: Remove main_cpu_reset() Date: Tue, 18 Aug 2020 00:33:21 -0300 Message-Id: <20200818033323.336912-7-bauerman@linux.ibm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200818033323.336912-1-bauerman@linux.ibm.com> References: <20200818033323.336912-1-bauerman@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-08-18_01:2020-08-17, 2020-08-18 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 mlxscore=0 priorityscore=1501 spamscore=0 clxscore=1015 lowpriorityscore=0 suspectscore=1 mlxlogscore=999 impostorscore=0 adultscore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008180025 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; Received-SPF: pass client-ip=148.163.158.5; envelope-from=bauerman@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/17 23:34:47 X-ACL-Warn: Detected OS = Linux 3.x [generic] [fuzzy] X-Spam_score_int: -36 X-Spam_score: -3.7 X-Spam_bar: --- X-Spam_report: (-3.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Peter Maydell , David Hildenbrand , Mark Cave-Ayland , qemu-devel@nongnu.org, Aleksandar Markovic , Thomas Huth , David Gibson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Artyom Tarasenko , Aleksandar Rikalo , Eduardo Habkost , Greg Kurz , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Cornelia Huck , Aurelien Jarno , Paolo Bonzini , Thiago Jung Bauermann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) We rely on cpu_common_reset() to set cs->halted to 0, so main_cpu_reset() is pointless. Suggested-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: David Gibson Signed-off-by: Thiago Jung Bauermann --- hw/sparc/sun4m.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index 9be930415f..f1d92df781 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -218,15 +218,6 @@ static void dummy_cpu_set_irq(void *opaque, int irq, i= nt level) { } =20 -static void main_cpu_reset(void *opaque) -{ - SPARCCPU *cpu =3D opaque; - CPUState *cs =3D CPU(cpu); - - cpu_reset(cs); - cs->halted =3D 0; -} - static void secondary_cpu_reset(void *opaque) { SPARCCPU *cpu =3D opaque; @@ -827,9 +818,7 @@ static void cpu_devinit(const char *cpu_type, unsigned = int id, env =3D &cpu->env; =20 cpu_sparc_set_id(env, id); - if (id =3D=3D 0) { - qemu_register_reset(main_cpu_reset, cpu); - } else { + if (id !=3D 0) { qemu_register_reset(secondary_cpu_reset, cpu); cs =3D CPU(cpu); cs->halted =3D 1; From nobody Sun May 19 00:47:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=1597721966; cv=none; d=zohomail.com; s=zohoarc; b=GdzPuCsIMnfrip9YArQqQcfulvVKXWkdzIoPYjm0diy3DCbjX089dCAiTNW52OighlY/vXXpQuIzLLcdwc+QJAAEvVG0XUiVKZUhhw/3nYTtiYueQ9F04qGnVVi5juqVHr0LuTNUmWgGWtCH0Te7Xb/hKa2OG87Gn/qB1GebZmo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597721966; h=Content-Type: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=HsHh9+eB0O5SPNaxMaxjkrsjZ6McJ76mgHj6uxA4AdA=; b=DJr69b3nt0GaMs8BiK3oPDn8oozjEvT8FIP9Lb9w5viUh7zP591Fh4T9NNmM6pVgUvYL9dQ8EUIuoZ/FJxmN8MueT+sOdaWmM6ilwTrqy3eoBTkuGEol1z2gWU6V9bAYlAQ7hST79pw0o4TWzC37I2qj2Uutdpv0bPJCwfcYJNk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 1597721966622948.1115614489863; Mon, 17 Aug 2020 20:39:26 -0700 (PDT) Received: from localhost ([::1]:60842 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k7sT5-0004Ej-NM for importer@patchew.org; Mon, 17 Aug 2020 23:39:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41452) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k7sPA-0005v8-5s; Mon, 17 Aug 2020 23:35:20 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:64392) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k7sP8-0000pl-16; Mon, 17 Aug 2020 23:35:19 -0400 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 07I3WgDr127784; Mon, 17 Aug 2020 23:34:48 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3304u6k4hb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Aug 2020 23:34:48 -0400 Received: from m0098396.ppops.net (m0098396.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 07I3XMCw129582; Mon, 17 Aug 2020 23:34:48 -0400 Received: from ppma04dal.us.ibm.com (7a.29.35a9.ip4.static.sl-reverse.com [169.53.41.122]) by mx0a-001b2d01.pphosted.com with ESMTP id 3304u6k4gw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Aug 2020 23:34:47 -0400 Received: from pps.filterd (ppma04dal.us.ibm.com [127.0.0.1]) by ppma04dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 07I3VC7u012889; Tue, 18 Aug 2020 03:34:46 GMT Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by ppma04dal.us.ibm.com with ESMTP id 3304uq8y7h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 18 Aug 2020 03:34:46 +0000 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07I3Ykj115008650 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Aug 2020 03:34:46 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1790EAC05B; Tue, 18 Aug 2020 03:34:46 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 09E74AC059; Tue, 18 Aug 2020 03:34:39 +0000 (GMT) Received: from morokweng.localdomain.com (unknown [9.211.138.167]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Tue, 18 Aug 2020 03:34:38 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=pp1; bh=HsHh9+eB0O5SPNaxMaxjkrsjZ6McJ76mgHj6uxA4AdA=; b=jwhpRNTKJVLaI/FO6htpC32ZPCuGqe7jJ3XhWaZSg4NqLReUwmf7NPo+gXwQ0QpZkbcN thHo5LRjd9APv7Xtb0E9MW0pRYGJJtxCYDlsgmRnGjWzELHDYo1kjsVNuUe+P+0MPbST jSm8q7hxDT77JZj14U3KBbWoLvMS+rJq/SDfSLcjeSqnxK8xCcRMXOVczerYdRH7W4on 4RehNnHN2WS0khdMginJAKKJ1vJmjVoO0MfuEqcrFW2FlbjYPQ3bs4C1nb1O93XAlbiS u0BS6yijMI0w5BEYI5ssrhdmGonFBCyg8rG6+JKzlDq7fmZpS1bAfmbrPhQ7VQ9Ihkd4 eA== From: Thiago Jung Bauermann To: qemu-ppc@nongnu.org Subject: [PATCH v4 7/8] sparc/sun4m: Use start-powered-off CPUState property Date: Tue, 18 Aug 2020 00:33:22 -0300 Message-Id: <20200818033323.336912-8-bauerman@linux.ibm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200818033323.336912-1-bauerman@linux.ibm.com> References: <20200818033323.336912-1-bauerman@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-08-18_01:2020-08-17, 2020-08-18 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 impostorscore=0 phishscore=0 mlxlogscore=999 lowpriorityscore=0 bulkscore=0 spamscore=0 suspectscore=1 adultscore=0 priorityscore=1501 malwarescore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008180022 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; Received-SPF: pass client-ip=148.163.156.1; envelope-from=bauerman@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/17 21:44:44 X-ACL-Warn: Detected OS = Linux 3.x [generic] [fuzzy] X-Spam_score_int: -36 X-Spam_score: -3.7 X-Spam_bar: --- X-Spam_report: (-3.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Peter Maydell , David Hildenbrand , Mark Cave-Ayland , qemu-devel@nongnu.org, Aleksandar Markovic , Thomas Huth , David Gibson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Artyom Tarasenko , Aleksandar Rikalo , Eduardo Habkost , Greg Kurz , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Cornelia Huck , Aurelien Jarno , Paolo Bonzini , Thiago Jung Bauermann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Instead of setting CPUState::halted to 1 in secondary_cpu_reset(), use the start-powered-off property which makes cpu_common_reset() initialize it to 1 in common code. This makes secondary_cpu_reset() unnecessary, so remove it. Also remove setting of cs->halted from cpu_devinit(), which seems out of place when compared to similar code in other architectures (e.g., ppce500_init() in hw/ppc/e500.c). Finally, change creation of CPU object from cpu_create() to object_new() and qdev_realize() because cpu_create() realizes the CPU and it's not possible to set a property after the object is realized. Suggested-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Thiago Jung Bauermann --- hw/sparc/sun4m.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index f1d92df781..41a7c5fa86 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -218,15 +218,6 @@ static void dummy_cpu_set_irq(void *opaque, int irq, i= nt level) { } =20 -static void secondary_cpu_reset(void *opaque) -{ - SPARCCPU *cpu =3D opaque; - CPUState *cs =3D CPU(cpu); - - cpu_reset(cs); - cs->halted =3D 1; -} - static void cpu_halt_signal(void *opaque, int irq, int level) { if (level && current_cpu) { @@ -810,21 +801,24 @@ static const TypeInfo ram_info =3D { static void cpu_devinit(const char *cpu_type, unsigned int id, uint64_t prom_addr, qemu_irq **cpu_irqs) { - CPUState *cs; SPARCCPU *cpu; CPUSPARCState *env; + Error *err =3D NULL; =20 - cpu =3D SPARC_CPU(cpu_create(cpu_type)); + cpu =3D SPARC_CPU(object_new(cpu_type)); env =3D &cpu->env; =20 cpu_sparc_set_id(env, id); - if (id !=3D 0) { - qemu_register_reset(secondary_cpu_reset, cpu); - cs =3D CPU(cpu); - cs->halted =3D 1; - } + object_property_set_bool(OBJECT(cpu), "start-powered-off", id !=3D 0, + &error_abort); *cpu_irqs =3D qemu_allocate_irqs(cpu_set_irq, cpu, MAX_PILS); env->prom_addr =3D prom_addr; + + if (!qdev_realize(DEVICE(cpu), NULL, &err)) { + error_report_err(err); + object_unref(OBJECT(cpu)); + exit(EXIT_FAILURE); + } } =20 static void dummy_fdc_tc(void *opaque, int irq, int level) From nobody Sun May 19 00:47:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=1597722040; cv=none; d=zohomail.com; s=zohoarc; b=Qa/4uqQb5V1079MQRy1hHXYtFNcT36eX32X0N8BxeBAQWL2CSmZAosJDyPU+B4ddVpRlFBx/vJrSrGGGDFIt88XX3SECUblq8bb3Mf6k4N/MRNZHCEk/vb6lDFPb/lkJMk9n+nTu0+s0Yz110sxmjFVkcPL/gpls4endRZcysN8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597722040; 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=ROECkcpI83are7d45wAbKAxpYfn/EVXwsj77lZ8DuL8=; b=gAedA1Y2xNqw2bFvErR+rBGjxNkeU5cVQwaseq90/RlgRnF3jwVIWnnp7wdhmDRHljEbK3QJ4gSsdiao7j2e0+vkqDJcL2sCdkd7LC+Jy5Wu8kTMJgmtRz+Eh3/1rnhf6I6NOA1U7hZ2eBJkIbKXKBRq5DgxdfnLInoUEExrKEA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 1597722040414641.7351846831976; Mon, 17 Aug 2020 20:40:40 -0700 (PDT) Received: from localhost ([::1]:35266 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k7sUI-0005MG-Uc for importer@patchew.org; Mon, 17 Aug 2020 23:40:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41486) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k7sPG-0006BI-3Z; Mon, 17 Aug 2020 23:35:26 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:25460) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k7sPE-0000th-8f; Mon, 17 Aug 2020 23:35:25 -0400 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 07I3WTeJ048356; Mon, 17 Aug 2020 23:34:55 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3304svu7ng-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Aug 2020 23:34:55 -0400 Received: from m0098421.ppops.net (m0098421.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 07I3Wj3e048630; Mon, 17 Aug 2020 23:34:55 -0400 Received: from ppma04dal.us.ibm.com (7a.29.35a9.ip4.static.sl-reverse.com [169.53.41.122]) by mx0a-001b2d01.pphosted.com with ESMTP id 3304svu7n5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Aug 2020 23:34:55 -0400 Received: from pps.filterd (ppma04dal.us.ibm.com [127.0.0.1]) by ppma04dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 07I3VB0L012882; Tue, 18 Aug 2020 03:34:54 GMT Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by ppma04dal.us.ibm.com with ESMTP id 3304uq8y89-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 18 Aug 2020 03:34:54 +0000 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07I3YrIH14877338 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Aug 2020 03:34:53 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BD852AC05E; Tue, 18 Aug 2020 03:34:53 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C3667AC05B; Tue, 18 Aug 2020 03:34:46 +0000 (GMT) Received: from morokweng.localdomain.com (unknown [9.211.138.167]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Tue, 18 Aug 2020 03:34:46 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=ROECkcpI83are7d45wAbKAxpYfn/EVXwsj77lZ8DuL8=; b=Fppjosor1T2GXFOnYGtwDoes429Sei5pUV8UKkOYk8TEyLgsB6p5KTbOMMg6DARzQBw/ 8R+1EZUamVTloztIn9U3jLmz3cPt78wFzslEd8rQYMYIqQdo2y8Ysrb90Uzl2deY8C7+ bQnsG9l2+pyxCTjMhw7QPLFr2zM99lmniWDcCMS11QVnHa5fI/khhf55uqcFbmur/Nz8 qxAm5YZNlSo39X0tvxDPW6huGkvsdVXywj+GfHv0yHJ8zTaTEt70rawqzk4lSJrrY0xy infZBN3CeJQw9NFWcWp8BNZPfR7OdHyD9Pj0B8cb+GYueTysW6nMOmu5c2M043nHmPC6 gQ== From: Thiago Jung Bauermann To: qemu-ppc@nongnu.org Subject: [PATCH v4 8/8] target/s390x: Use start-powered-off CPUState property Date: Tue, 18 Aug 2020 00:33:23 -0300 Message-Id: <20200818033323.336912-9-bauerman@linux.ibm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200818033323.336912-1-bauerman@linux.ibm.com> References: <20200818033323.336912-1-bauerman@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-08-18_01:2020-08-17, 2020-08-18 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 adultscore=0 mlxscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 lowpriorityscore=0 bulkscore=0 phishscore=0 impostorscore=0 suspectscore=1 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008180022 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; Received-SPF: pass client-ip=148.163.158.5; envelope-from=bauerman@linux.ibm.com; helo=mx0b-001b2d01.pphosted.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/17 23:34:47 X-ACL-Warn: Detected OS = Linux 3.x [generic] [fuzzy] X-Spam_score_int: -36 X-Spam_score: -3.7 X-Spam_bar: --- X-Spam_report: (-3.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Peter Maydell , David Hildenbrand , Mark Cave-Ayland , qemu-devel@nongnu.org, Aleksandar Markovic , Thomas Huth , David Gibson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Artyom Tarasenko , Aleksandar Rikalo , Eduardo Habkost , Greg Kurz , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Cornelia Huck , Aurelien Jarno , Paolo Bonzini , Thiago Jung Bauermann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Instead of setting CPUState::halted to 1 in s390_cpu_initfn(), use the start-powered-off property which makes cpu_common_reset() initialize it to 1 in common code. Note that this changes behavior by setting cs->halted to 1 on reset, which didn't happen before. Acked-by: Cornelia Huck Signed-off-by: Thiago Jung Bauermann --- target/s390x/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index 08eb674d22..73d7d6007e 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -291,7 +291,7 @@ static void s390_cpu_initfn(Object *obj) S390CPU *cpu =3D S390_CPU(obj); =20 cpu_set_cpustate_pointers(cpu); - cs->halted =3D 1; + cs->start_powered_off =3D true; cs->exception_index =3D EXCP_HLT; #if !defined(CONFIG_USER_ONLY) object_property_add(obj, "crash-information", "GuestPanicInformation",