From nobody Sat May 11 18:00:15 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=1598421461; cv=none; d=zohomail.com; s=zohoarc; b=GCiCyMg7pmnmXzT8eMtZVn0+hFNGr+XD0xth5QZDepRREcv2fsE9rfhKIgLkUt7TtoubM9zRE36dbQFzwctrNAuVYkryrhofF1dCw25r+0NCxNpUEYT3DfPD468iwyzIiCspUbWzrRJNTfqgikPzLTKtW8lxohZ+Fa4oOYNJ95M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598421461; 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=CAhUZWWHP7DLqkTfrTPiJboynA1T3WIN1/Iu1YmOlghanJ0jXFtMzWWGJl/QJVukaa1bAmnr6X/xacdFYFFoxTspO7PDQAJvIYP1kzGKbguoTS9eh0iU30ClWOqKhAjVT/tAmeHnTkvpFxxmOgylsllw5q+frwgpUO9UJ4Udnl8= 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 1598421461890318.0032358397441; Tue, 25 Aug 2020 22:57:41 -0700 (PDT) Received: from localhost ([::1]:45486 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kAoRI-0006aF-Mj for importer@patchew.org; Wed, 26 Aug 2020 01:57:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60088) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAoQI-0004lQ-Oi; Wed, 26 Aug 2020 01:56:38 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:59314) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAoQG-0005sq-St; Wed, 26 Aug 2020 01:56:38 -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 07Q5WHnn054520; Wed, 26 Aug 2020 01:56:00 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 335f6p3ynk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Aug 2020 01:56:00 -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 07Q5WI13054602; Wed, 26 Aug 2020 01:55:59 -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 335f6p3ymt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Aug 2020 01:55:59 -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 07Q5mX3L022239; Wed, 26 Aug 2020 05:55:58 GMT Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by ppma02wdc.us.ibm.com with ESMTP id 332ujq7ath-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Aug 2020 05:55:58 +0000 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07Q5tvvq49152366 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Aug 2020 05:55:57 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 78D2EC605D; Wed, 26 Aug 2020 05:55:57 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B74DDC605B; Wed, 26 Aug 2020 05:55:52 +0000 (GMT) Received: from morokweng.localdomain.com (unknown [9.163.48.38]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 26 Aug 2020 05:55:52 +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=QuzBVFxs+gj9rI+E8Cnj0L0A6UhRCTTPXrYdul/B5rX4uGNqG6oq68TfVoXkzGWu82d+ AcSnxuhqQDSlPD48YLUZJjQsqJeWFqboi8JkHVj4fu3ZcHjWt5JYkJzJ3J9cIoL7zGQ0 cyJdsKtaLtznrFd9oYBkPzfBfqL8BjaWcyyOYTU/BTCPlLvgyAkpqcyRrKQUkRmWrRCq jmyrFpYLmNrjRMDe04SztPbYllK/MVyuJdeoiLTKrD/oJmFsByPb18xXHkOndgs6AY7f tKc+9NzosNm0cjVMoZu37cr9G2Ix295hEkJ+WKcuTPjsd8VyXTf5E9+EGAvWHnBHPW1R zA== From: Thiago Jung Bauermann To: qemu-ppc@nongnu.org Subject: [PATCH v7 1/8] target/arm: Move start-powered-off property to generic CPUState Date: Wed, 26 Aug 2020 02:55:28 -0300 Message-Id: <20200826055535.951207-2-bauerman@linux.ibm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200826055535.951207-1-bauerman@linux.ibm.com> References: <20200826055535.951207-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-25_11:2020-08-25, 2020-08-26 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 priorityscore=1501 impostorscore=0 adultscore=0 mlxlogscore=999 lowpriorityscore=0 phishscore=0 malwarescore=0 spamscore=0 bulkscore=0 suspectscore=1 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008260040 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/26 01:56:34 X-ACL-Warn: Detected OS = Linux 3.x [generic] [fuzzy] X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.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=-0.001, 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?C=C3=A9dric=20Le=20Goater?= , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Cornelia Huck , Thiago Jung Bauermann , Igor Mammedov , Aurelien Jarno 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 Sat May 11 18:00:15 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=1598421578; cv=none; d=zohomail.com; s=zohoarc; b=Xff3nsmkn9aIEX6S9KTIs9ENNXwUgvIwgZNBekmrsK/3c6acEPubODwS3wMHcBPQaBOVl1x9rbreEAz0MPxcGXqgYuEV0GQ0fH5GbzdhR8SldvDkTkowuVzdGBSBWiAOz5WUQf3AnfBQ0UEKeOmGi0Dz8/oveReztGytb5vleTQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598421578; 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=BkiiosRU0ErXraqegyZ5RMAbFBP+QgtXN9Ij0xjyD5o58ou/zveMeu5Mm4usHmVGn3PyvWPiSymUQZ3crXonoERi3qzFDV6QQyX/K/k/OHajpMIkwguyTgiwJdGEuqeZCnKPj9vAedTBy2kaU6HcLI5xyRDnRf7jSEgcRXBDcbs= 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 1598421578296663.4718847935142; Tue, 25 Aug 2020 22:59:38 -0700 (PDT) Received: from localhost ([::1]:51830 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kAoTB-0000k9-2t for importer@patchew.org; Wed, 26 Aug 2020 01:59:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60090) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAoQJ-0004lw-2F; Wed, 26 Aug 2020 01:56:39 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:19892) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAoQH-0005ss-85; Wed, 26 Aug 2020 01:56:38 -0400 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 07Q5W2Gh121076; Wed, 26 Aug 2020 01:56:06 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 335ggsa5r4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Aug 2020 01:56:06 -0400 Received: from m0098394.ppops.net (m0098394.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 07Q5WVNT123769; Wed, 26 Aug 2020 01:56:05 -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 335ggsa5q6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Aug 2020 01:56:05 -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 07Q5mXcU023204; Wed, 26 Aug 2020 05:56:04 GMT Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by ppma03wdc.us.ibm.com with ESMTP id 332utqy88c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Aug 2020 05:56:04 +0000 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07Q5u3dn39649760 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Aug 2020 05:56:03 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 243C7C605D; Wed, 26 Aug 2020 05:56:03 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EE0E7C6055; Wed, 26 Aug 2020 05:55:57 +0000 (GMT) Received: from morokweng.localdomain.com (unknown [9.163.48.38]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 26 Aug 2020 05:55:57 +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=ElcX4pV7Wg1xzlKcmzDwC4dhbjZhLd/dFI7U4OO2f4RZjOrOWHHC37x3rPTXSuzBMDap w5nsXhxQvUWhEmWgLZUcbO+CU35zBNgdDg5DNcJRbYEJgMbMQCLuA0hxgmyL2F76K3S4 /FanzsS6Uujrz0MpsgWyXWlB2MkqE/PuBhUajD8drYE8EosAeLywxUT0QbZdnNJr2sxW TmAuAMMOenuFt0fobe/wBspxrH1RZRZmqcVxt5ajFYy4I/G6bUEMvj7y6cITajZ4Woz4 ZKXEMLQ7bkF41W8B7wH9bg3xqcn/NQT3xpK7LoPcZJREVIJnedXcQJ2wraU3pjT0ES60 xg== From: Thiago Jung Bauermann To: qemu-ppc@nongnu.org Subject: [PATCH v7 2/8] target/arm: Move setting of CPU halted state to generic code Date: Wed, 26 Aug 2020 02:55:29 -0300 Message-Id: <20200826055535.951207-3-bauerman@linux.ibm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200826055535.951207-1-bauerman@linux.ibm.com> References: <20200826055535.951207-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-25_11:2020-08-25, 2020-08-26 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 spamscore=0 priorityscore=1501 adultscore=0 mlxscore=0 mlxlogscore=999 lowpriorityscore=0 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008260040 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/26 01:56:34 X-ACL-Warn: Detected OS = Linux 3.x [generic] [fuzzy] X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.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=-0.001, 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?C=C3=A9dric=20Le=20Goater?= , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Cornelia Huck , Thiago Jung Bauermann , Igor Mammedov , Aurelien Jarno 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 Sat May 11 18:00:15 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=1598421460; cv=none; d=zohomail.com; s=zohoarc; b=cqOyW0glUqeWKuHrePmaGijXRRBGQv6TuWXl79AI6v14uE91pu6NxVmJcbv3Xgvx+xxUCBNw9VNiFMpUIahLwyHBL8ZPyU3zKTlzmE+oIYNuVzgF4whOKmY5g/vT5waKShSEgcxwVvkzGMg6bN97VXnSnaSuKSJF1miwTyUZIBY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598421460; 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=SlerACFr10tVR2YiYO5CHTqIIWWKoHmBm8T2WN0EQct8I7eA0oteclS4qSC8CsRBzr01E18amE6frUArqfs5vXa/pTyPy4DmMzCIT1wifDWNF1iKF+ILIWfa8xjE8LxRgEqu1FyjhFz6fgBmp11zqZb59Z6Arr3+FthjDszVryw= 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 1598421460508232.72601211116194; Tue, 25 Aug 2020 22:57:40 -0700 (PDT) Received: from localhost ([::1]:45412 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kAoRH-0006YW-6v for importer@patchew.org; Wed, 26 Aug 2020 01:57:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60104) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAoQL-0004sc-SP; Wed, 26 Aug 2020 01:56:41 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:10580 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 1kAoQK-0005tE-1N; Wed, 26 Aug 2020 01:56:41 -0400 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 07Q5uBou042358; Wed, 26 Aug 2020 01:56:11 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 335j1e000s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Aug 2020 01:56:11 -0400 Received: from m0098420.ppops.net (m0098420.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 07Q5uBQQ042327; Wed, 26 Aug 2020 01:56:11 -0400 Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0b-001b2d01.pphosted.com with ESMTP id 335j1e000h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Aug 2020 01:56:11 -0400 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 07Q5lgJk021573; Wed, 26 Aug 2020 05:56:10 GMT Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by ppma03dal.us.ibm.com with ESMTP id 332uttq21h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Aug 2020 05:56:10 +0000 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07Q5u9J654657442 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Aug 2020 05:56:09 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 490B3C6055; Wed, 26 Aug 2020 05:56:09 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 88B3CC605B; Wed, 26 Aug 2020 05:56:03 +0000 (GMT) Received: from morokweng.localdomain.com (unknown [9.163.48.38]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 26 Aug 2020 05:56:03 +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=aynhe8qLAREtpomOvPaJbPRZkebcB5/rmjgaqoo//8nWjyveBzDf6mtrKf99PF9mjasY lDGPtrA8Zvs/tAEhlA80NUpCgCnlexDShAKtp9z4ZkQKlOe8xZIwN+QgudRpeIxRafUC 0aKuKEiDv9UMAq2g1RfPX0MmbbLd2RH2TiJts5Sw4djXDZ9omDu6G1b4bRBheJKzpAmo YijRz5rZvVPI4Uzb0szH7msFR8wYNm56m6H3JYb68O/4Vscz7qCsGD4sbuaHnS0ldOGJ 9bNYJL+61+dcnVUgO8ptGCCZnWTGOMDD+If5OLMysHo39L97VP+SNYoH1tMZtWZL2zUt Lg== From: Thiago Jung Bauermann To: qemu-ppc@nongnu.org Subject: [PATCH v7 3/8] ppc/spapr: Use start-powered-off CPUState property Date: Wed, 26 Aug 2020 02:55:30 -0300 Message-Id: <20200826055535.951207-4-bauerman@linux.ibm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200826055535.951207-1-bauerman@linux.ibm.com> References: <20200826055535.951207-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-25_11:2020-08-25, 2020-08-26 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=1 bulkscore=0 adultscore=0 mlxlogscore=999 impostorscore=0 lowpriorityscore=0 phishscore=0 priorityscore=1501 mlxscore=0 spamscore=0 clxscore=1015 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008260040 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/26 01:49:04 X-ACL-Warn: Detected OS = Linux 3.x [generic] [fuzzy] X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.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=-0.001, 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?C=C3=A9dric=20Le=20Goater?= , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Cornelia Huck , Thiago Jung Bauermann , Igor Mammedov , Aurelien Jarno 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 Sat May 11 18:00:15 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=1598421578; cv=none; d=zohomail.com; s=zohoarc; b=NqP/LA/9dCsMezW/LUo+DdOk3jqANK/jC4y7gwNrx4ZXuGdbWH3bvFPxylHBdd6yK449eDVu4I3uv7zCZutTairGNPehBWCMOPmo7YqRRFYWNvynNN9OmR1b0Aq7DR9GIORyqzv0f9X3+6nQWPeHzC9ph/kzmYwXQIIxM3+LYag= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598421578; 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=WjA51qR1tJ1GnmzpyrD7tREwDezbUBrRItTnjm47UI4=; b=YsusAs5mXifqcurPAB+jTUmeJztYa9fFM9xJ4A9x1i21AXjfR7lSt58tDLZZ4fMuEAJ7GBZwRkCf7sBuzBMwgj1VjUGcrKimgDWWh0md+YRvyBNvQ1419L/PA5y0Vw2vnokv4HMOY38csT3hZI+plDHhuzh5Dp6aXYbWieDqbgk= 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 1598421578273832.937836678358; Tue, 25 Aug 2020 22:59:38 -0700 (PDT) Received: from localhost ([::1]:51790 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kAoTA-0000jB-Us for importer@patchew.org; Wed, 26 Aug 2020 01:59:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60116) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAoQN-0004yX-Qf; Wed, 26 Aug 2020 01:56:43 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:48486) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAoQL-0005tU-VM; Wed, 26 Aug 2020 01:56:43 -0400 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 07Q5WPv3089178; Wed, 26 Aug 2020 01:56:18 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 335g80tprx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Aug 2020 01:56:17 -0400 Received: from m0098399.ppops.net (m0098399.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 07Q5X8b7090711; Wed, 26 Aug 2020 01:56:17 -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 335g80tpr7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Aug 2020 01:56:17 -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 07Q5mb4u023220; Wed, 26 Aug 2020 05:56:15 GMT Received: from b03cxnp08028.gho.boulder.ibm.com (b03cxnp08028.gho.boulder.ibm.com [9.17.130.20]) by ppma03wdc.us.ibm.com with ESMTP id 332utqy89h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Aug 2020 05:56:15 +0000 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07Q5uEA262390724 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Aug 2020 05:56:14 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C9308C6057; Wed, 26 Aug 2020 05:56:14 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A4005C6055; Wed, 26 Aug 2020 05:56:09 +0000 (GMT) Received: from morokweng.localdomain.com (unknown [9.163.48.38]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 26 Aug 2020 05:56:09 +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=WjA51qR1tJ1GnmzpyrD7tREwDezbUBrRItTnjm47UI4=; b=rjQsN6floAEUsqaA6zPWAFzhZ8JZ9isVf7QYqj3LP8DLJbqSbIAzVrRGsgeHa2x1sYEK pRz3MFwZ/ixeFCoyr2Jd2XNjm5yOCGiZHaez5iMqNykK0J0lo1ptilopbYGlO+tnq29H dS2rnwwRooX7kbZmlKfrjCTze/cLPd6eXkhIogv7r7E4+GaKaxC2AJCGSYxd2bBOv+jL 1Msbf8ZvlpmaDHBEkyo+LNCeiuIZHchiUmebC5Cb16md5WB7f8US4gX/t1q2FOX64o7z vxJUCjKHqAaROwZtkfu9V2uCCQk+CuoUuVwyJHI0LhBZYAO4iAVLJFDI8dKIZRldpHOV +g== From: Thiago Jung Bauermann To: qemu-ppc@nongnu.org Subject: [PATCH v7 4/8] ppc/e500: Use start-powered-off CPUState property Date: Wed, 26 Aug 2020 02:55:31 -0300 Message-Id: <20200826055535.951207-5-bauerman@linux.ibm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200826055535.951207-1-bauerman@linux.ibm.com> References: <20200826055535.951207-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-25_11:2020-08-25, 2020-08-26 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 malwarescore=0 mlxlogscore=999 priorityscore=1501 adultscore=0 bulkscore=0 phishscore=0 clxscore=1015 spamscore=0 mlxscore=0 suspectscore=1 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008260040 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/26 01:56:34 X-ACL-Warn: Detected OS = Linux 3.x [generic] [fuzzy] X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.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=-0.001, 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?C=C3=A9dric=20Le=20Goater?= , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Cornelia Huck , Thiago Jung Bauermann , Igor Mammedov , Aurelien Jarno 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_and_unref() 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 Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/ppc/e500.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index ab9884e315..ae39b9358e 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 @@ -865,7 +862,7 @@ void ppce500_init(MachineState *machine) CPUState *cs; qemu_irq *input; =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 @@ -875,6 +872,14 @@ void ppce500_init(MachineState *machine) exit(1); } =20 + /* + * Secondary CPU starts in halted state for now. Needs to change + * when implementing non-kernel boot. + */ + object_property_set_bool(OBJECT(cs), "start-powered-off", i !=3D 0, + &error_fatal); + qdev_realize_and_unref(DEVICE(cs), NULL, &error_fatal); + if (!firstenv) { firstenv =3D env; } From nobody Sat May 11 18:00:15 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=1598421770; cv=none; d=zohomail.com; s=zohoarc; b=I2vhzF+UHOWl5FFDEJGJPY9cujyiqNm9ihtOd1LPMgxJhmMZuoqqMWCihM2sKIPbxIihPNfvKLuoS67g49dj9jOz5rZxMhObF/kYY3mJvYs40XEwu+m8+3COPUH51Jch9rGMDEP2yvlJshsIoDdY3qPhqWi8CDH1lsAZO8nhObk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598421770; 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=XrxBHV8YQC3B+hBtragKGLFK4MktAPxO3MXlcxkka9I=; b=LSyS4S4VvayZeLPB+WmklBMQ22lVQcYyBtjSIRazrr21LDA/RF8roPN96Ye7qIx3clopqZFg0OIMGTbKvySgyGByy2bc8C7XhPnu7Y43ZcXDTUVmxUHaX5vs8JVIMI0qmPCTSKUWPfBCIB9U6T2/eZIRZ7hmEGLzyYgOZyrCwZ8= 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 159842177065781.91618109356193; Tue, 25 Aug 2020 23:02:50 -0700 (PDT) Received: from localhost ([::1]:59530 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kAoWH-00042u-0A for importer@patchew.org; Wed, 26 Aug 2020 02:02:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60154) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAoQa-0005V4-55; Wed, 26 Aug 2020 01:56:56 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:64706) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAoQY-0005uL-9Y; Wed, 26 Aug 2020 01:56:55 -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 07Q5VwcK194581; Wed, 26 Aug 2020 01:56:27 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 335ggn21h0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Aug 2020 01:56:25 -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 07Q5W0LL194635; Wed, 26 Aug 2020 01:56:23 -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 335ggn21fr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Aug 2020 01:56:23 -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 07Q5mWl8023193; Wed, 26 Aug 2020 05:56:21 GMT Received: from b03cxnp08028.gho.boulder.ibm.com (b03cxnp08028.gho.boulder.ibm.com [9.17.130.20]) by ppma03wdc.us.ibm.com with ESMTP id 332utqy89u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Aug 2020 05:56:21 +0000 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07Q5uKai56885530 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Aug 2020 05:56:20 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7DFB2C605A; Wed, 26 Aug 2020 05:56:20 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 38EAAC6059; Wed, 26 Aug 2020 05:56:15 +0000 (GMT) Received: from morokweng.localdomain.com (unknown [9.163.48.38]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 26 Aug 2020 05:56:14 +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=XrxBHV8YQC3B+hBtragKGLFK4MktAPxO3MXlcxkka9I=; b=UwxuchbUFnZMxM3QwGpZOU+S+XXf/9lXj9ARxZoMiWelDcTVTDpxcX+wqM0rTcq/NggN 42c5I+I/hpqAy3EtPGURz4YyQcwidmZRsXHTSXSEOUGwLcyoGsPIFk541DxlOC2RJvYf 3eFBAGnrdiSQ9t4ooPRFflhhjqNwZ++X57K2Q/y5ov9eHoPE56Vzq6dzhWPdLaEzGpNl 0ZSALT9TM9mzG24jpNnlzTnbgP7F3p86vRfeP7aaixwPDTmqwQxw0IpKg3H+8ZEo5ITr pBvpB/YJxJlyD8zyTiK1V2xeWQH4U6dSmeP3bk/RTKbaCHXrv9J3p52VjtntiKNv3qYp xw== From: Thiago Jung Bauermann To: qemu-ppc@nongnu.org Subject: [PATCH v7 5/8] mips/cps: Use start-powered-off CPUState property Date: Wed, 26 Aug 2020 02:55:32 -0300 Message-Id: <20200826055535.951207-6-bauerman@linux.ibm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200826055535.951207-1-bauerman@linux.ibm.com> References: <20200826055535.951207-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-25_11:2020-08-25, 2020-08-26 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 lowpriorityscore=0 adultscore=0 priorityscore=1501 suspectscore=1 phishscore=0 mlxlogscore=999 clxscore=1015 impostorscore=0 malwarescore=0 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008260040 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/26 01:56:34 X-ACL-Warn: Detected OS = Linux 3.1-3.10 [fuzzy] X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.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=-0.001, 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?C=C3=A9dric=20Le=20Goater?= , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Cornelia Huck , Thiago Jung Bauermann , Igor Mammedov , Aurelien Jarno 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_and_unref() 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 Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/mips/cps.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/hw/mips/cps.c b/hw/mips/cps.c index 615e1a1ad2..23c0f87e41 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,17 @@ static void mips_cps_realize(DeviceState *dev, Error **e= rrp) bool saar_present =3D false; =20 for (i =3D 0; i < s->num_vp; i++) { - cpu =3D MIPS_CPU(cpu_create(s->cpu_type)); + cpu =3D MIPS_CPU(object_new(s->cpu_type)); + + /* All VPs are halted on reset. Leave powering up to CPC. */ + if (!object_property_set_bool(OBJECT(cpu), "start-powered-off", tr= ue, + errp)) { + return; + } + + if (!qdev_realize_and_unref(DEVICE(cpu), NULL, errp)) { + return; + } =20 /* Init internal devices */ cpu_mips_irq_init_cpu(cpu); From nobody Sat May 11 18:00:15 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=1598421624; cv=none; d=zohomail.com; s=zohoarc; b=DIUkb3TmUeQqo6wau4tC+hmOCLV1UHhD/gNW0qcFtXxCb6+P4Yh6/Cd8KBM17HEXvqS2LHa26axV3WxCQvVoKinIoGKmJRF//y7Ad5j+QKKt5csmJUjT6TquwTjk/HLgFzl4MWbSffrHS4oZ5Yd8lUQ+DksYFWXqc8gFDEwiTsA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598421624; 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=wcozulgcpqPylsZTrgmzgmyFL/R2nv2XemoN+wFJmJI=; b=BPTjbJ2WUBGDZJYt5uUoEpAqo6QXEDYKXlkJGHA2mOaS8+zHZStW2XZ0GNdkQje5euSmIJCFHUpVGV9EzKYEu131i0hfw6UKr3mBnq3gXpYOjjAWYpe3CXYxIoc56/0SLptankR7/p5Uho+yRPA7D+rwGjJ84iZhaoP70qYCUoA= 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 1598421624779213.3176048853178; Tue, 25 Aug 2020 23:00:24 -0700 (PDT) Received: from localhost ([::1]:54106 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kAoTv-0001h4-GZ for importer@patchew.org; Wed, 26 Aug 2020 02:00:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60168) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAoQd-0005db-7y; Wed, 26 Aug 2020 01:56:59 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:13202) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAoQb-0005uv-AM; Wed, 26 Aug 2020 01:56:58 -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 07Q5WLNc127402; Wed, 26 Aug 2020 01:56:29 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 335hmj0jn5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Aug 2020 01:56:29 -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 07Q5WNxs127572; Wed, 26 Aug 2020 01:56:28 -0400 Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0a-001b2d01.pphosted.com with ESMTP id 335hmj0jmj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Aug 2020 01:56:28 -0400 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 07Q5lq4n007972; Wed, 26 Aug 2020 05:56:27 GMT Received: from b03cxnp08028.gho.boulder.ibm.com (b03cxnp08028.gho.boulder.ibm.com [9.17.130.20]) by ppma02dal.us.ibm.com with ESMTP id 332utuf1jt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Aug 2020 05:56:27 +0000 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07Q5uQnn62062848 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Aug 2020 05:56:26 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 15BBCC605A; Wed, 26 Aug 2020 05:56:26 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D4470C6055; Wed, 26 Aug 2020 05:56:20 +0000 (GMT) Received: from morokweng.localdomain.com (unknown [9.163.48.38]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 26 Aug 2020 05:56:20 +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=wcozulgcpqPylsZTrgmzgmyFL/R2nv2XemoN+wFJmJI=; b=HIubkjMJggF2D+x0NQlQqvF1ps9s1d/eJYbNTod45ypCyfCrevQOGopz3/7rIrRwEiTS AsRzvUH9PsEF7gM1Y53hxjG7bZodD6T7oz/HC88HUKkX0P2Dq/VxHbyx2o+GrP1Y/sJq 4FWa6nc+BUS1A6ODm7S3otSYhxPb/2t4oALf6GheBLvdI4RaRjplOhy3g5eMEcHOsVMR XwR8cyxvnPJxWbCo58t7ZGmlaUEn42diE3flZoy6tKsIAV1UH3KteuW0Hwkkn4tjAbWW FyO4NDXaEngTDGVNxBV1J8ljd3o3QYgg0CFgGPSCQEn4wGjYRY7SdM/YTIr9xEOdVnpx Ng== From: Thiago Jung Bauermann To: qemu-ppc@nongnu.org Subject: [PATCH v7 6/8] sparc/sun4m: Don't set cs->halted = 0 in main_cpu_reset() Date: Wed, 26 Aug 2020 02:55:33 -0300 Message-Id: <20200826055535.951207-7-bauerman@linux.ibm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200826055535.951207-1-bauerman@linux.ibm.com> References: <20200826055535.951207-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-25_11:2020-08-25, 2020-08-26 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 priorityscore=1501 mlxscore=0 mlxlogscore=999 clxscore=1015 malwarescore=0 suspectscore=1 bulkscore=0 impostorscore=0 lowpriorityscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008260040 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/26 01:56:34 X-ACL-Warn: Detected OS = Linux 3.x [generic] [fuzzy] X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.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=-0.001, 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?C=C3=A9dric=20Le=20Goater?= , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Cornelia Huck , Thiago Jung Bauermann , Igor Mammedov , Aurelien Jarno 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" We rely on cpu_common_reset() to set cs->halted to 0, it's redundant to do it in main_cpu_reset(). Signed-off-by: Thiago Jung Bauermann Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/sparc/sun4m.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index cf7dfa4af5..7484aa4438 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -224,7 +224,6 @@ static void main_cpu_reset(void *opaque) CPUState *cs =3D CPU(cpu); =20 cpu_reset(cs); - cs->halted =3D 0; } =20 static void secondary_cpu_reset(void *opaque) From nobody Sat May 11 18:00:15 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=1598421776; cv=none; d=zohomail.com; s=zohoarc; b=CVq2J3Mh8ddi9n2qhs9nq0yw0XTMuqqoRrEaAYlUErs6En9iViP5fce4rymW8bemfoaKLpARRQHT1vpQ+o7sxm2A9iWCvydDzefm8YCZ2mrx6NUKpxmIOOKKnsJjU10qBdZTPkLHNpzbrdTzhAfiJy3gS7/v49I3q2JnrfKvTk8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598421776; 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=ginZlmRS//+Wh2w9altSJdeQH8Wl+oNf3o/V2korlOA=; b=P6AUky2zOHKUKGqo8vxmih+/ptLXgU9n/18SIWNkeSysKSYWg891kEXQMQ2JPffH6SLT7mxCetNUlmFMtIxWlkwcXnrn0X9GfQE8afc54sgs0pDchoVZbWmLeg1+KStK8GNZSPmfJ8JnpoFLNxl5hB30Oz4Ebtvy1y5YdcfdaXQ= 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 1598421776920404.06480351312314; Tue, 25 Aug 2020 23:02:56 -0700 (PDT) Received: from localhost ([::1]:59950 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kAoWN-0004Dg-Ks for importer@patchew.org; Wed, 26 Aug 2020 02:02:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60194) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAoQi-0005sQ-N7; Wed, 26 Aug 2020 01:57:04 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:1144) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAoQg-0005vO-Np; Wed, 26 Aug 2020 01:57:04 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 07Q5lnOM027507; Wed, 26 Aug 2020 01:56:34 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 335hwgg73j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Aug 2020 01:56:34 -0400 Received: from m0098404.ppops.net (m0098404.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 07Q5mFi3030294; Wed, 26 Aug 2020 01:56:34 -0400 Received: from ppma01wdc.us.ibm.com (fd.55.37a9.ip4.static.sl-reverse.com [169.55.85.253]) by mx0a-001b2d01.pphosted.com with ESMTP id 335hwgg72t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Aug 2020 01:56:34 -0400 Received: from pps.filterd (ppma01wdc.us.ibm.com [127.0.0.1]) by ppma01wdc.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 07Q5l3n3013783; Wed, 26 Aug 2020 05:56:32 GMT Received: from b03cxnp08027.gho.boulder.ibm.com (b03cxnp08027.gho.boulder.ibm.com [9.17.130.19]) by ppma01wdc.us.ibm.com with ESMTP id 332uwaf8ax-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Aug 2020 05:56:32 +0000 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07Q5uSTQ18219360 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Aug 2020 05:56:28 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AFC10C6055; Wed, 26 Aug 2020 05:56:31 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 671EBC6059; Wed, 26 Aug 2020 05:56:26 +0000 (GMT) Received: from morokweng.localdomain.com (unknown [9.163.48.38]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 26 Aug 2020 05:56:26 +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=ginZlmRS//+Wh2w9altSJdeQH8Wl+oNf3o/V2korlOA=; b=CAU/H73a1IJY5AhuU2PWo/t+4Xpzo/WiQzBLIbj/HEkPk3vP3i2vv/6vd80uK7aITuU8 Lg+/D8ryiarOSrA513h2HzZRd6Bu4l3Oz2BJYrTTrdedWoin2RfzOFZHD61gDBYBcYn5 WWnskBK7wr2qPbqIJLjd74SFQfPHuCp9WCLzMfOzFIkcZcW7qa6vb60f7uUM2Zbu7QMR fuoxGUSxz2X5r2uHCoNUes62hiWzYRcLZLwn4PqM61sqzd852ZskNSLavlKT1FOUIXWR JhH5bJHPWLPBnh5zexzV041a0MLU+S7fwXMU0Oyv3OiWEAB4k0t73Ezg9gZktVrDgyVD Gw== From: Thiago Jung Bauermann To: qemu-ppc@nongnu.org Subject: [PATCH v7 7/8] sparc/sun4m: Use start-powered-off CPUState property Date: Wed, 26 Aug 2020 02:55:34 -0300 Message-Id: <20200826055535.951207-8-bauerman@linux.ibm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200826055535.951207-1-bauerman@linux.ibm.com> References: <20200826055535.951207-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-25_11:2020-08-25, 2020-08-26 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 phishscore=0 mlxlogscore=999 spamscore=0 adultscore=0 suspectscore=1 priorityscore=1501 mlxscore=0 impostorscore=0 malwarescore=0 lowpriorityscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008260042 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/26 01:56:34 X-ACL-Warn: Detected OS = Linux 3.x [generic] [fuzzy] X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.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=-0.001, 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?C=C3=A9dric=20Le=20Goater?= , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Cornelia Huck , Thiago Jung Bauermann , Igor Mammedov , Aurelien Jarno 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. Now secondary_cpu_reset() becomes equivalent to main_cpu_reset() so rename the function to sun4m_cpu_reset(). 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_and_unref() 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 Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/sparc/sun4m.c | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index 7484aa4438..6bf9d27d8a 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -218,7 +218,7 @@ static void dummy_cpu_set_irq(void *opaque, int irq, in= t level) { } =20 -static void main_cpu_reset(void *opaque) +static void sun4m_cpu_reset(void *opaque) { SPARCCPU *cpu =3D opaque; CPUState *cs =3D CPU(cpu); @@ -226,15 +226,6 @@ static void main_cpu_reset(void *opaque) cpu_reset(cs); } =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) { @@ -818,21 +809,17 @@ 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; =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=3D 0) { - qemu_register_reset(main_cpu_reset, cpu); - } else { - qemu_register_reset(secondary_cpu_reset, cpu); - cs =3D CPU(cpu); - cs->halted =3D 1; - } + qemu_register_reset(sun4m_cpu_reset, cpu); + object_property_set_bool(OBJECT(cpu), "start-powered-off", id !=3D 0, + &error_fatal); + qdev_realize_and_unref(DEVICE(cpu), NULL, &error_fatal); *cpu_irqs =3D qemu_allocate_irqs(cpu_set_irq, cpu, MAX_PILS); env->prom_addr =3D prom_addr; } From nobody Sat May 11 18:00:15 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=1598421851; cv=none; d=zohomail.com; s=zohoarc; b=MdLEHr4SojMQ7M+JOFdSBBDJBohwp5QJk91tg7v2gzP2f6ed8sDqpnQYv0fdPueFbrVWjQcUepf0zvaW41d+5gC8qsr5vnNLR1gYyrw5zMVE3fVUlKX0+IeoH50H19XZqtRuoeeJroEZz9T0ekNUf8pKVvGo2IgMpDppMIex6hc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598421851; 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=iJtdvxKa+XZtymxYM+PkmbRZGwJ9gc6rD4nqdrm2uws=; b=MpKNUJF/XlRW34Bf82JN6CVyZ1ZcZaHZr86mPC0RB2LW1islH6db2lP5QIuIyQksuCJQ8lnydCSmnh9gKU1la4dxDddtD8xnHZ0P6Cm4EadN0O4DcjJJwrVbD2hMeVAyn3lVdsBjxMxEZDNUCrXy59QqB10bI+0GlZBkVKfBAFk= 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 159842185190577.47708867578149; Tue, 25 Aug 2020 23:04:11 -0700 (PDT) Received: from localhost ([::1]:35080 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kAoXa-0005ct-My for importer@patchew.org; Wed, 26 Aug 2020 02:04:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60208) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAoQo-00068i-GV; Wed, 26 Aug 2020 01:57:10 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:20356) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAoQm-0005vq-OZ; Wed, 26 Aug 2020 01:57:10 -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 07Q5WHZ5054493; Wed, 26 Aug 2020 01:56:40 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 335f6p406v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Aug 2020 01:56:40 -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 07Q5ZEW4061407; Wed, 26 Aug 2020 01:56:39 -0400 Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0a-001b2d01.pphosted.com with ESMTP id 335f6p406e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Aug 2020 01:56:39 -0400 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 07Q5lkxI021607; Wed, 26 Aug 2020 05:56:38 GMT Received: from b03cxnp08027.gho.boulder.ibm.com (b03cxnp08027.gho.boulder.ibm.com [9.17.130.19]) by ppma03dal.us.ibm.com with ESMTP id 332uttq251-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Aug 2020 05:56:38 +0000 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07Q5uYCH27001570 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Aug 2020 05:56:34 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 37383C6059; Wed, 26 Aug 2020 05:56:37 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0C680C6055; Wed, 26 Aug 2020 05:56:32 +0000 (GMT) Received: from morokweng.localdomain.com (unknown [9.163.48.38]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 26 Aug 2020 05:56:31 +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=iJtdvxKa+XZtymxYM+PkmbRZGwJ9gc6rD4nqdrm2uws=; b=kWs/CAMOUax5oij4Ux0HMpc7DLknTUpvRUbfmyb7tbB7Juvn5hBw8/LapVn5dvMj9Zh6 emDBvu4AXgSmHBxRJja++OIRCmjnJTVwRkYZTDEjFwztOgNrsUl/6ZLipPT+FBFgDB4b umq3jrI8OyC/geGifxOSrU6xFTZPK8yo9qHDiuHAoMT6icaQPO1U3Z3PMXVxBBNnjuYC zn8p5ycoO5yPqOr4GcIKG7HQ5NtKBDunY7wDjot3UM3T0jQ16y2FggZ+S6FsNP6VWYVX HHUNaGw4vuCqb6J7lBKrY2zi5lkfnjhne/LLp1xY6veB6syqe5Z1R3Oog2leIcI2IzaG 2g== From: Thiago Jung Bauermann To: qemu-ppc@nongnu.org Subject: [PATCH v7 8/8] target/s390x: Use start-powered-off CPUState property Date: Wed, 26 Aug 2020 02:55:35 -0300 Message-Id: <20200826055535.951207-9-bauerman@linux.ibm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200826055535.951207-1-bauerman@linux.ibm.com> References: <20200826055535.951207-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-25_11:2020-08-25, 2020-08-26 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 priorityscore=1501 impostorscore=0 adultscore=0 mlxlogscore=999 lowpriorityscore=0 phishscore=0 malwarescore=0 spamscore=0 bulkscore=0 suspectscore=1 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008260040 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/26 01:56:34 X-ACL-Warn: Detected OS = Linux 3.x [generic] [fuzzy] X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.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=-0.001, 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?C=C3=A9dric=20Le=20Goater?= , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Cornelia Huck , Thiago Jung Bauermann , Igor Mammedov , Aurelien Jarno 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 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 Reviewed-by: Philippe Mathieu-Daud=C3=A9 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",