From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 2002:ac2:5042:0:0:0:0:0 with SMTP id a2csp296536lfm; Tue, 21 Jul 2020 20:52:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjJGClIEuDDXLM8oT7s5oBIvnSQYsb7e3baOOWMiTrntrN6MttK+PIAcBc8bLB5QIUukgX X-Received: by 2002:a25:385:: with SMTP id 127mr47619490ybd.141.1595389956721; Tue, 21 Jul 2020 20:52:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595389956; cv=none; d=google.com; s=arc-20160816; b=E2VFc3hcVei+NoOdMGtLyv7mcPM5ngwG1IqimPs5UJ1VqQaWMCOwhO0U9/No9BHyUh 6wScQGEwKet3afSHnx8LlVdQzeBsJnc9lTSmzcw+tCRfLUGXGd5miW66jzW5OEPBdy4x Lp/vvLPvJvQrvgUeK++U8umkrnZsfA9vjwzw5wfOc57UqkVs9042XoFDuYOaHJ2srcG1 GlelB/wBAxhSvYxa98Wg86SwFD1GfdEY0r4HPoXm/UflTNtIAW6aqRJ8mgNrxgnogVih yj4xN9SSZ8YAllJmJTVmhcYbxvJWUNYCyDKj8h+PvAQgOsAiecr2M42jPtWK9Ywz8qXz PW4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from; bh=2XZ+fyfPPo1d/gwAyxWSaplNXsI4D2AHKDUzr3jkhGo=; b=yGMGMla0jaq4APtn+MejpUDFvtsJgoRagzWkP1lHXebcmPILkveqjxQCWLVZtOrda1 cXutqcOg5FMUyKMDUyFk36BU80CHLcDeDl1vVMJQZZQ4dXeLAbyGUicYwTQxXWRBEaA+ fGIKWF40Bw3Eyl5A1OzHs5p8zKTfKbIheTWKio76wHSAVjl1xNhUldBtswBgcj5y3xLC hbe6gFlTRJCUlYUOW5cGSvHIrIkncDxtv1bPvv9Zp7MZhlDzNJ1kfCGjCYUATwzNxg0I iNpn5419BTjmg444wgpJY267LWdB7dibWJXWFNi0dQ88Hv8cH3ItmKCsWEv0BLEXwLoc PdEg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id r11si20889081ybs.445.2020.07.21.20.52.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 Jul 2020 20:52:36 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from localhost ([::1]:53310 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jy5o4-0006TZ-1F for alex.bennee@linaro.org; Tue, 21 Jul 2020 23:52:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43340) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jy5n3-0005a4-IQ; Tue, 21 Jul 2020 23:51:33 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:28748) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jy5n1-0003ps-K9; Tue, 21 Jul 2020 23:51:33 -0400 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 06M3XPn7117120; Tue, 21 Jul 2020 23:50:58 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 32e1yakdsr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 21 Jul 2020 23:50:58 -0400 Received: from m0098409.ppops.net (m0098409.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 06M3ovBC155068; Tue, 21 Jul 2020 23:50:57 -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 32e1yakdsc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 21 Jul 2020 23:50:57 -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 06M3oMR8031965; Wed, 22 Jul 2020 03:50:56 GMT Received: from b01cxnp23033.gho.pok.ibm.com (b01cxnp23033.gho.pok.ibm.com [9.57.198.28]) by ppma02dal.us.ibm.com with ESMTP id 32brq9gxah-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Jul 2020 03:50:56 +0000 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp23033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 06M3ot4G57999832 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 22 Jul 2020 03:50:56 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E12ECAE05F; Wed, 22 Jul 2020 03:50:55 +0000 (GMT) Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id ECF4DAE05C; Wed, 22 Jul 2020 03:50:49 +0000 (GMT) Received: from morokweng.localdomain.com (unknown [9.163.58.88]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP; Wed, 22 Jul 2020 03:50:49 +0000 (GMT) From: Thiago Jung Bauermann To: qemu-ppc@nongnu.org Subject: [PATCH v2 0/9] Generalize start-powered-off property from ARM Date: Wed, 22 Jul 2020 00:50:07 -0300 Message-Id: <20200722035016.469075-1-bauerman@linux.ibm.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-07-22_01:2020-07-21, 2020-07-21 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 lowpriorityscore=0 suspectscore=1 bulkscore=0 adultscore=0 clxscore=1011 priorityscore=1501 mlxscore=0 mlxlogscore=999 phishscore=0 impostorscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007220022 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/07/21 23:51:27 X-ACL-Warn: Detected OS = Linux 3.x [generic] [fuzzy] X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, 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: Thiago Jung Bauermann , Peter Maydell , Aleksandar Rikalo , Eduardo Habkost , Aleksandar Markovic , Cornelia Huck , Mark Cave-Ayland , qemu-devel@nongnu.org, qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Artyom Tarasenko , Thomas Huth , Paolo Bonzini , David Hildenbrand , Richard Henderson , Aurelien Jarno , David Gibson Errors-To: qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org Sender: "Qemu-devel" X-TUID: 1VgAC+dJh89j The ARM code has a start-powered-off property in ARMCPU, which is a subclass of CPUState. This property causes arm_cpu_reset() to set CPUState::halted to 1, signalling that the CPU should start in a halted state. Other architectures also have code which aim to achieve the same effect, but without using a property. The ppc/spapr version has a bug where QEMU does a KVM_RUN on the vcpu before cs->halted is set to 1, causing the vcpu to run while it's still in an unitialized state (more details in patch 3). Peter Maydell mentioned the ARM start-powered-off property and Eduardo Habkost suggested making it generic, so this patch series does that, for all cases which I was able to find via grep in the code. The only problem is that I was only able to test these changes on a ppc64le pseries KVM guest, so except for patches 2 and 3, all others are only build-tested. Also, my grasp of QOM lifecycle is basically non-existant so please be aware of that when reviewing this series. The last 3 patches I think are good cleanups but I'm even less confident in their correctness compared to the other patches, so I marked them as RFC. Applies cleanly on yesterday's master. Thiago Jung Bauermann (9): target/arm: Move start-powered-off property to generic CPUState target/arm: Move setting of CPU halted state to generic code ppc/spapr: Use start-powered-off CPUState property ppc/e500: Use start-powered-off CPUState property mips/cps: Use start-powered-off CPUState property sparc/sun4m: Use start-powered-off CPUState property sparc/sun4m: Don't set CPUState::halted in cpu_devinit() sparc/sun4m: Use one cpu_reset() function for main and secondary CPUs target/s390x: Use start-powered-off CPUState property exec.c | 1 + hw/core/cpu.c | 2 +- hw/mips/cps.c | 6 +++--- hw/ppc/e500.c | 10 +++++++--- hw/ppc/spapr_cpu_core.c | 12 +++++++----- hw/sparc/sun4m.c | 23 +++++------------------ include/hw/core/cpu.h | 4 ++++ target/arm/cpu.c | 4 +--- target/arm/cpu.h | 3 --- target/arm/kvm32.c | 2 +- target/arm/kvm64.c | 2 +- target/s390x/cpu.c | 3 ++- 12 files changed, 33 insertions(+), 39 deletions(-)