From nobody Fri Apr 26 08:39:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1585150276; cv=none; d=zohomail.com; s=zohoarc; b=an4DCtyQV+2LGj5LYAmPvWn0VgMUkEWKSAXnDnYDCGYWkbZBwwQhcDW+By3c3JmKshQyheM/X+XgKqwoMF8eC741LatAaAbRCtDKAJLZ/fOUvMD1gonENQtrpNB+F9Bb00VwVuK5OTjKBI5chkGlBRTWnYhgyYyPta6X/L5IJ2w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585150276; 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=7i6zB+NO+h/fADsEUvpVSnTvzEfrMFhFvr7x8zI6Sqg=; b=DYJpFU3mlNYTJe/BM+Vot9+kSrgksGjRGyYamVReMZo1I7KfbHY2jPjxDHcno3rxea2p0lpwaInnAj24jjUSFP8OXsjymgzfmo6VT1wN3Q9gibeOTACwjzaYo3JpD3GWeMit7mgsqWQPbMThYchRE2cYJ74B25KFJzgWjcp+5Vk= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 15851502763122.6501208139741266; Wed, 25 Mar 2020 08:31:16 -0700 (PDT) Received: from localhost ([::1]:38378 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jH7zv-0000g0-1F for importer@patchew.org; Wed, 25 Mar 2020 11:31:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43184) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jH7ua-00021K-Vc for qemu-devel@nongnu.org; Wed, 25 Mar 2020 11:25:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jH7uZ-00072p-PU for qemu-devel@nongnu.org; Wed, 25 Mar 2020 11:25:44 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:64582 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jH7uZ-0006wI-L5 for qemu-devel@nongnu.org; Wed, 25 Mar 2020 11:25:43 -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 02PF2mlA075115 for ; Wed, 25 Mar 2020 11:25:37 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0b-001b2d01.pphosted.com with ESMTP id 2ywf2jdfq8-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 25 Mar 2020 11:25:37 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 25 Mar 2020 15:25:31 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 25 Mar 2020 15:25:28 -0000 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 02PFPVgg51314836 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 25 Mar 2020 15:25:31 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3543742041; Wed, 25 Mar 2020 15:25:31 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F0E0B42042; Wed, 25 Mar 2020 15:25:30 +0000 (GMT) Received: from bahia.lan (unknown [9.145.41.106]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 25 Mar 2020 15:25:30 +0000 (GMT) Subject: [PATCH 1/4] spapr: Don't check capabilities removed between CAS calls From: Greg Kurz To: David Gibson Date: Wed, 25 Mar 2020 16:25:30 +0100 In-Reply-To: <158514992409.478799.6718223069768660390.stgit@bahia.lan> References: <158514992409.478799.6718223069768660390.stgit@bahia.lan> User-Agent: StGit/unknown-version MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 x-cbid: 20032515-0016-0000-0000-000002F7973D X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20032515-0017-0000-0000-0000335B3B39 Message-Id: <158514993021.478799.10928618293640651819.stgit@bahia.lan> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.645 definitions=2020-03-25_07:2020-03-24, 2020-03-25 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 impostorscore=0 suspectscore=0 adultscore=0 priorityscore=1501 spamscore=0 phishscore=0 malwarescore=0 mlxlogscore=999 clxscore=1034 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003250123 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.158.5 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexey Kardashevskiy , qemu-ppc@nongnu.org, =?utf-8?q?C=C3=A9dric?= Le Goater , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" We currently check if some capability in OV5 was removed by the guest since the previous CAS, and we trigger a CAS reboot in that case. This was required because it could call for a device-tree property or node removal, that we didn't support until recently (see commit 6787d27b04a7 "spapr: add option vector handling in CAS-generated resets" for details). Now that we render a full FDT at CAS and that SLOF is able to handle node removal, we don't need to do a CAS reset in this case anymore. Also, this check can only return true if the guest has already called CAS since the last full system reset (otherwise spapr->ov5_cas is empty). Linux doesn't do that so this can be considered as dead code for the vast majority of existing setups. Drop the check. Since the only use of the ov5_cas_old variable is precisely the check itself, drop the variable as well. Signed-off-by: Greg Kurz --- hw/ppc/spapr_hcall.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c index 40c86e91eb89..1f123a68e46c 100644 --- a/hw/ppc/spapr_hcall.c +++ b/hw/ppc/spapr_hcall.c @@ -1676,7 +1676,7 @@ static target_ulong h_client_architecture_support(Pow= erPCCPU *cpu, target_ulong fdt_bufsize =3D args[2]; target_ulong ov_table; uint32_t cas_pvr; - SpaprOptionVector *ov1_guest, *ov5_guest, *ov5_cas_old; + SpaprOptionVector *ov1_guest, *ov5_guest; bool guest_radix; Error *local_err =3D NULL; bool raw_mode_supported =3D false; @@ -1781,22 +1781,10 @@ static target_ulong h_client_architecture_support(P= owerPCCPU *cpu, * by LoPAPR 1.1, 14.5.4.8, which QEMU doesn't implement, we don't need * to worry about this for now. */ - ov5_cas_old =3D spapr_ovec_clone(spapr->ov5_cas); - - /* also clear the radix/hash bit from the current ov5_cas bits to - * be in sync with the newly ov5 bits. Else the radix bit will be - * seen as being removed and this will generate a reset loop - */ - spapr_ovec_clear(ov5_cas_old, OV5_MMU_RADIX_300); =20 /* full range of negotiated ov5 capabilities */ spapr_ovec_intersect(spapr->ov5_cas, spapr->ov5, ov5_guest); spapr_ovec_cleanup(ov5_guest); - /* capabilities that have been added since CAS-generated guest reset. - * if capabilities have since been removed, generate another reset - */ - spapr->cas_reboot =3D !spapr_ovec_subset(ov5_cas_old, spapr->ov5_cas); - spapr_ovec_cleanup(ov5_cas_old); /* Now that processing is finished, set the radix/hash bit for the * guest if it requested a valid mode; otherwise terminate the boot. */ if (guest_radix) { From nobody Fri Apr 26 08:39:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1585150082; cv=none; d=zohomail.com; s=zohoarc; b=KXTl4gjAzwNTb2lqmHwH9YI8OjCFo9aD9vlqxDk96bVyxWNY1Q4+Q56Oj1LXEUNuj+7j+lFokELGSX8zjANbh/VKxzgpKgZ4JwWcgxXtg1TMIndlJI8Q+X+2A9wkP3xvNPa+NFs+MtlXLqqhLSTMcvyFIbWX/wyo5BsS98uK/vk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585150082; 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=ULP9Ab2rtesICW+sIuAAr6j8aUT5RY24s9GdDMWo3tk=; b=kAQZG8sHer7ADAUNMOHRWl56QUtwGRVJb98yL6vsSlEVJuOc2IgeTTxGRWeS1N1fc0aK4R1Etqnq3ohWtdNferBk60JBJAAYYQCQhq6Lnx4cdjvpLZSbs310Y6hev/hQidEzh2CYbRZfh896Dm54sYAv9osVTfi7DKynt8sdii4= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1585150082414240.76975637155317; Wed, 25 Mar 2020 08:28:02 -0700 (PDT) Received: from localhost ([::1]:38280 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jH7wn-0005rQ-51 for importer@patchew.org; Wed, 25 Mar 2020 11:28:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43191) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jH7ub-00022e-JM for qemu-devel@nongnu.org; Wed, 25 Mar 2020 11:25:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jH7ua-000739-B2 for qemu-devel@nongnu.org; Wed, 25 Mar 2020 11:25:45 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:15016 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jH7ua-00072t-5F for qemu-devel@nongnu.org; Wed, 25 Mar 2020 11:25:44 -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 02PF4Ahx141378 for ; Wed, 25 Mar 2020 11:25:43 -0400 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0b-001b2d01.pphosted.com with ESMTP id 2ywbuwvups-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 25 Mar 2020 11:25:43 -0400 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 25 Mar 2020 15:25:41 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 25 Mar 2020 15:25:37 -0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 02PFPbj062390456 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 25 Mar 2020 15:25:37 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4919511C052; Wed, 25 Mar 2020 15:25:37 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 105B911C04A; Wed, 25 Mar 2020 15:25:37 +0000 (GMT) Received: from bahia.lan (unknown [9.145.41.106]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 25 Mar 2020 15:25:36 +0000 (GMT) Subject: [PATCH 2/4] spapr: Simplify selection of radix/hash during CAS From: Greg Kurz To: David Gibson Date: Wed, 25 Mar 2020 16:25:36 +0100 In-Reply-To: <158514992409.478799.6718223069768660390.stgit@bahia.lan> References: <158514992409.478799.6718223069768660390.stgit@bahia.lan> User-Agent: StGit/unknown-version MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 x-cbid: 20032515-0028-0000-0000-000003EB4AB0 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20032515-0029-0000-0000-000024B0B906 Message-Id: <158514993621.478799.4204740354545734293.stgit@bahia.lan> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.645 definitions=2020-03-25_07:2020-03-24, 2020-03-25 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1034 priorityscore=1501 lowpriorityscore=0 malwarescore=0 bulkscore=0 adultscore=0 mlxscore=0 phishscore=0 impostorscore=0 mlxlogscore=999 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003250121 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.158.5 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexey Kardashevskiy , qemu-ppc@nongnu.org, =?utf-8?q?C=C3=A9dric?= Le Goater , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" The guest can select the MMU mode by setting bits 0-1 of byte 24 in OV5 to to 0b00 for hash or 0b01 for radix. As required by the architecture, we terminate the boot process if any other value is found there. The usual way to negotiate features in OV5 is basically ANDing the bitfield provided by the guest and the bitfield of features supported by QEMU, previously populated at machine init. For some not documented reason, MMU is treated differently : bit 1 of byte 24 (the radix/hash bit) is cleared from the guest OV5 and explicitely set in the final negotiated OV5 if radix was requested. Since the only expected input from the guest is the radix/hash bit being set or not, it seems more appropriate to handle this like we do for XIVE. Set the radix bit in spapr->ov5 at machine init if it has a chance to work (ie. power9, either TCG or a radix capable KVM) and rely exclusively on spapr_ovec_intersect() to set the radix bit in spapr->ov5_cas. Signed-off-by: Greg Kurz --- hw/ppc/spapr.c | 1 + hw/ppc/spapr_hcall.c | 6 +----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 9a2bd501aa6e..91f8cfe7a8b1 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -2837,6 +2837,7 @@ static void spapr_machine_init(MachineState *machine) if ((!kvm_enabled() || kvmppc_has_cap_mmu_radix()) && ppc_type_check_compat(machine->cpu_type, CPU_POWERPC_LOGICAL_3_00,= 0, spapr->max_compat_pvr)) { + spapr_ovec_set(spapr->ov5, OV5_MMU_RADIX_300); /* KVM and TCG always allow GTSE with radix... */ spapr_ovec_set(spapr->ov5, OV5_MMU_RADIX_GTSE); } diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c index 1f123a68e46c..9bed659b1a94 100644 --- a/hw/ppc/spapr_hcall.c +++ b/hw/ppc/spapr_hcall.c @@ -1738,9 +1738,7 @@ static target_ulong h_client_architecture_support(Pow= erPCCPU *cpu, exit(EXIT_FAILURE); } =20 - /* The radix/hash bit in byte 24 requires special handling: */ guest_radix =3D spapr_ovec_test(ov5_guest, OV5_MMU_RADIX_300); - spapr_ovec_clear(ov5_guest, OV5_MMU_RADIX_300); =20 guest_xive =3D spapr_ovec_test(ov5_guest, OV5_XIVE_EXPLOIT); =20 @@ -1785,14 +1783,12 @@ static target_ulong h_client_architecture_support(P= owerPCCPU *cpu, /* full range of negotiated ov5 capabilities */ spapr_ovec_intersect(spapr->ov5_cas, spapr->ov5, ov5_guest); spapr_ovec_cleanup(ov5_guest); - /* Now that processing is finished, set the radix/hash bit for the - * guest if it requested a valid mode; otherwise terminate the boot. */ + if (guest_radix) { if (kvm_enabled() && !kvmppc_has_cap_mmu_radix()) { error_report("Guest requested unavailable MMU mode (radix)."); exit(EXIT_FAILURE); } - spapr_ovec_set(spapr->ov5_cas, OV5_MMU_RADIX_300); } else { if (kvm_enabled() && kvmppc_has_cap_mmu_radix() && !kvmppc_has_cap_mmu_hash_v3()) { From nobody Fri Apr 26 08:39:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1585150439; cv=none; d=zohomail.com; s=zohoarc; b=iBJTPt9Tf1ep5PbTp6Z0ouWkONVIdYp2xOzxPYyChWVxJyitymk3qmVnwdzuc1sC5GuxPfrhAjQH2DKkv5NJeHc2k9fCC5kieJcLaP0vuxMIKfjWtrYHVUeDgyGz6qK8zpa4LZTSac9yviMv4XxAmUY4u9t6XTA1jo0a0tpO21U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585150439; 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=fFWpYxR6UNCeeTaOc6oeIU+pxZ+ucwkf5Az0lbrRDhI=; b=O6wNIaFZAgt9NhT7hn37cWQfJFGlfb2ymhbDIuLznhJotdbWo8ykNKZpsZZIlk85kv/aVFBUexpBbQvxQncVvjVV9r3DKe8tj7mDuKb+yE+5S+S6BguKKnj82jWhm/EcsUJhcnZxw+qObChWr2jzmMmp76KgJLTXBwxully21co= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 158515043955888.35663363583706; Wed, 25 Mar 2020 08:33:59 -0700 (PDT) Received: from localhost ([::1]:38411 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jH82Y-0002vF-0g for importer@patchew.org; Wed, 25 Mar 2020 11:33:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43239) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jH7uh-0002Hv-Pf for qemu-devel@nongnu.org; Wed, 25 Mar 2020 11:25:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jH7ug-00075x-42 for qemu-devel@nongnu.org; Wed, 25 Mar 2020 11:25:51 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:55696) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jH7uf-00075e-SR for qemu-devel@nongnu.org; Wed, 25 Mar 2020 11:25:50 -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 02PF4lvB099100 for ; Wed, 25 Mar 2020 11:25:49 -0400 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ywe7usdp7-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 25 Mar 2020 11:25:48 -0400 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 25 Mar 2020 15:25:42 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp05.uk.ibm.com (192.168.101.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 25 Mar 2020 15:25:40 -0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 02PFPhBb59179198 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 25 Mar 2020 15:25:44 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E5275AE04D; Wed, 25 Mar 2020 15:25:43 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AEC15AE057; Wed, 25 Mar 2020 15:25:43 +0000 (GMT) Received: from bahia.lan (unknown [9.145.41.106]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 25 Mar 2020 15:25:43 +0000 (GMT) Subject: [PATCH 3/4] spapr/cas: Separate CAS handling from rebuilding the FDT From: Greg Kurz To: David Gibson Date: Wed, 25 Mar 2020 16:25:42 +0100 In-Reply-To: <158514992409.478799.6718223069768660390.stgit@bahia.lan> References: <158514992409.478799.6718223069768660390.stgit@bahia.lan> User-Agent: StGit/unknown-version MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 x-cbid: 20032515-0020-0000-0000-000003BADE61 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20032515-0021-0000-0000-00002213650C Message-Id: <158514994229.478799.2178881312094922324.stgit@bahia.lan> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.645 definitions=2020-03-25_07:2020-03-24, 2020-03-25 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 impostorscore=0 bulkscore=0 phishscore=0 spamscore=0 adultscore=0 mlxscore=0 lowpriorityscore=0 suspectscore=48 malwarescore=0 priorityscore=1501 clxscore=1034 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003250121 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.156.1 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexey Kardashevskiy , qemu-ppc@nongnu.org, =?utf-8?q?C=C3=A9dric?= Le Goater , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Alexey Kardashevskiy At the moment "ibm,client-architecture-support" ("CAS") is implemented in SLOF and QEMU assists via the custom H_CAS hypercall which copies an updated flatten device tree (FDT) blob to the SLOF memory which it then uses to update its internal tree. When we enable the OpenFirmware client interface in QEMU, we won't need to copy the FDT to the guest as the client is expected to fetch the device tree using the client interface. This moves FDT rebuild out to a separate helper which is going to be called from the "ibm,client-architecture-support" handler and leaves writing FDT to the guest in the H_CAS handler. This should not cause any behavioral change. Signed-off-by: Alexey Kardashevskiy Message-Id: <20200310050733.29805-3-aik@ozlabs.ru> Signed-off-by: Greg Kurz --- hw/ppc/spapr.c | 1 - hw/ppc/spapr_hcall.c | 67 +++++++++++++++++++++++++++++---------------= ---- include/hw/ppc/spapr.h | 7 +++++ 3 files changed, 48 insertions(+), 27 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 91f8cfe7a8b1..c522cd205fee 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -96,7 +96,6 @@ * * We load our kernel at 4M, leaving space for SLOF initial image */ -#define FDT_MAX_SIZE 0x100000 #define RTAS_MAX_ADDR 0x80000000 /* RTAS must stay below that */ #define FW_MAX_SIZE 0x400000 #define FW_FILE_NAME "slof.bin" diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c index 9bed659b1a94..b424bca4d2c0 100644 --- a/hw/ppc/spapr_hcall.c +++ b/hw/ppc/spapr_hcall.c @@ -1665,16 +1665,12 @@ static void spapr_handle_transient_dev_before_cas(S= paprMachineState *spapr) spapr_clear_pending_hotplug_events(spapr); } =20 -static target_ulong h_client_architecture_support(PowerPCCPU *cpu, - SpaprMachineState *spapr, - target_ulong opcode, - target_ulong *args) +target_ulong do_client_architecture_support(PowerPCCPU *cpu, + SpaprMachineState *spapr, + target_ulong vec, + target_ulong fdt_bufsize) { - /* Working address in data buffer */ - target_ulong addr =3D ppc64_phys_to_real(args[0]); - target_ulong fdt_buf =3D args[1]; - target_ulong fdt_bufsize =3D args[2]; - target_ulong ov_table; + target_ulong ov_table; /* Working address in data buffer */ uint32_t cas_pvr; SpaprOptionVector *ov1_guest, *ov5_guest; bool guest_radix; @@ -1694,7 +1690,7 @@ static target_ulong h_client_architecture_support(Pow= erPCCPU *cpu, } } =20 - cas_pvr =3D cas_check_pvr(spapr, cpu, &addr, &raw_mode_supported, &loc= al_err); + cas_pvr =3D cas_check_pvr(spapr, cpu, &vec, &raw_mode_supported, &loca= l_err); if (local_err) { error_report_err(local_err); return H_HARDWARE; @@ -1717,7 +1713,7 @@ static target_ulong h_client_architecture_support(Pow= erPCCPU *cpu, } =20 /* For the future use: here @ov_table points to the first option vecto= r */ - ov_table =3D addr; + ov_table =3D vec; =20 ov1_guest =3D spapr_ovec_parse_vector(ov_table, 1); if (!ov1_guest) { @@ -1823,7 +1819,6 @@ static target_ulong h_client_architecture_support(Pow= erPCCPU *cpu, =20 if (!spapr->cas_reboot) { void *fdt; - SpaprDeviceTreeUpdateHeader hdr =3D { .version_id =3D 1 }; =20 /* If spapr_machine_reset() did not set up a HPT but one is necess= ary * (because the guest isn't going to use radix) then set it up her= e. */ @@ -1832,21 +1827,7 @@ static target_ulong h_client_architecture_support(Po= werPCCPU *cpu, spapr_setup_hpt(spapr); } =20 - if (fdt_bufsize < sizeof(hdr)) { - error_report("SLOF provided insufficient CAS buffer " - TARGET_FMT_lu " (min: %zu)", fdt_bufsize, sizeof(= hdr)); - exit(EXIT_FAILURE); - } - - fdt_bufsize -=3D sizeof(hdr); - fdt =3D spapr_build_fdt(spapr, false, fdt_bufsize); - _FDT((fdt_pack(fdt))); - - cpu_physical_memory_write(fdt_buf, &hdr, sizeof(hdr)); - cpu_physical_memory_write(fdt_buf + sizeof(hdr), fdt, - fdt_totalsize(fdt)); - trace_spapr_cas_continue(fdt_totalsize(fdt) + sizeof(hdr)); =20 g_free(spapr->fdt_blob); spapr->fdt_size =3D fdt_totalsize(fdt); @@ -1861,6 +1842,40 @@ static target_ulong h_client_architecture_support(Po= werPCCPU *cpu, return H_SUCCESS; } =20 +static target_ulong h_client_architecture_support(PowerPCCPU *cpu, + SpaprMachineState *spapr, + target_ulong opcode, + target_ulong *args) +{ + target_ulong vec =3D ppc64_phys_to_real(args[0]); + target_ulong fdt_buf =3D args[1]; + target_ulong fdt_bufsize =3D args[2]; + target_ulong ret; + SpaprDeviceTreeUpdateHeader hdr =3D { .version_id =3D 1 }; + + if (fdt_bufsize < sizeof(hdr)) { + error_report("SLOF provided insufficient CAS buffer " + TARGET_FMT_lu " (min: %zu)", fdt_bufsize, sizeof(hdr)= ); + exit(EXIT_FAILURE); + } + + fdt_bufsize -=3D sizeof(hdr); + + ret =3D do_client_architecture_support(cpu, spapr, vec, fdt_bufsize); + if (ret =3D=3D H_SUCCESS) { + _FDT((fdt_pack(spapr->fdt_blob))); + spapr->fdt_size =3D fdt_totalsize(spapr->fdt_blob); + spapr->fdt_initial_size =3D spapr->fdt_size; + + cpu_physical_memory_write(fdt_buf, &hdr, sizeof(hdr)); + cpu_physical_memory_write(fdt_buf + sizeof(hdr), spapr->fdt_blob, + spapr->fdt_size); + trace_spapr_cas_continue(spapr->fdt_size + sizeof(hdr)); + } + + return ret; +} + static target_ulong h_home_node_associativity(PowerPCCPU *cpu, SpaprMachineState *spapr, target_ulong opcode, diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h index 42d64a036821..b7e13e5aafb7 100644 --- a/include/hw/ppc/spapr.h +++ b/include/hw/ppc/spapr.h @@ -102,6 +102,8 @@ typedef enum { #define SPAPR_CAP_FIXED_CCD 0x03 #define SPAPR_CAP_FIXED_NA 0x10 /* Lets leave a bit of a gap.= .. */ =20 +#define FDT_MAX_SIZE 0x100000 + typedef struct SpaprCapabilities SpaprCapabilities; struct SpaprCapabilities { uint8_t caps[SPAPR_CAP_NUM]; @@ -566,6 +568,11 @@ void spapr_register_hypercall(target_ulong opcode, spa= pr_hcall_fn fn); target_ulong spapr_hypercall(PowerPCCPU *cpu, target_ulong opcode, target_ulong *args); =20 +target_ulong do_client_architecture_support(PowerPCCPU *cpu, + SpaprMachineState *spapr, + target_ulong addr, + target_ulong fdt_bufsize); + /* Virtual Processor Area structure constants */ #define VPA_MIN_SIZE 640 #define VPA_SIZE_OFFSET 0x4 From nobody Fri Apr 26 08:39:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1585150020; cv=none; d=zohomail.com; s=zohoarc; b=VnpiVfD8hQ28Tdu3pHJqeMO1oV5ubECAQ1w9rBj/oA3Sqcn0GBvLwlw+2Ts2z5dqeFGVILFC+CCkpn4TxxvT+E1zYvFt/s6ARMUfH84MwLnTG44GGWDQk0OLHrVxEpemfmcdbXWIOC8rROE7L1EOm+uqZmPRaCSzZ75/pv0XAcw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585150020; 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=m38o4PzUClALkKLUSUqsNZSS7W7OG4pEJDUFrrvkn+M=; b=AnFBeyRUQgTJps9+eFPr8b5SYbffAUNS8sD0zgABxQbPSQqB6z1NtoFZlczrmelOFDvG8usrH2cs5UMGiSMe5MeTqHmzGBpeun5qauOphM8BeyoeMFrr21DLWHDohEk2gdbQg6W+HKX7rkd2EbPmAPCtXNwEyzg/PRZJHWuvIPc= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1585150020385368.184594152591; Wed, 25 Mar 2020 08:27:00 -0700 (PDT) Received: from localhost ([::1]:38250 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jH7vl-0003k0-KK for importer@patchew.org; Wed, 25 Mar 2020 11:26:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43268) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jH7uo-0002TW-EO for qemu-devel@nongnu.org; Wed, 25 Mar 2020 11:25:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jH7un-00079K-65 for qemu-devel@nongnu.org; Wed, 25 Mar 2020 11:25:58 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:8872 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jH7un-000794-0l for qemu-devel@nongnu.org; Wed, 25 Mar 2020 11:25:57 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 02PF43vB111098 for ; Wed, 25 Mar 2020 11:25:56 -0400 Received: from e06smtp01.uk.ibm.com (e06smtp01.uk.ibm.com [195.75.94.97]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ywet52hd6-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 25 Mar 2020 11:25:56 -0400 Received: from localhost by e06smtp01.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 25 Mar 2020 15:25:50 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp01.uk.ibm.com (192.168.101.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 25 Mar 2020 15:25:48 -0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 02PFPoWB38142128 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 25 Mar 2020 15:25:50 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D55C5A4067; Wed, 25 Mar 2020 15:25:50 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A9932A4062; Wed, 25 Mar 2020 15:25:50 +0000 (GMT) Received: from bahia.lan (unknown [9.145.41.106]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 25 Mar 2020 15:25:50 +0000 (GMT) Subject: [PATCH 4/4] spapr: Drop CAS reboot flag From: Greg Kurz To: David Gibson Date: Wed, 25 Mar 2020 16:25:49 +0100 In-Reply-To: <158514992409.478799.6718223069768660390.stgit@bahia.lan> References: <158514992409.478799.6718223069768660390.stgit@bahia.lan> User-Agent: StGit/unknown-version MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 x-cbid: 20032515-4275-0000-0000-000003B2D76E X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20032515-4276-0000-0000-000038C81651 Message-Id: <158514994893.478799.11772512888322840990.stgit@bahia.lan> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.645 definitions=2020-03-25_07:2020-03-24, 2020-03-25 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 bulkscore=0 mlxlogscore=999 adultscore=0 spamscore=0 clxscore=1034 phishscore=0 malwarescore=0 lowpriorityscore=0 mlxscore=0 suspectscore=2 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003250123 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.158.5 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexey Kardashevskiy , qemu-ppc@nongnu.org, =?utf-8?q?C=C3=A9dric?= Le Goater , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" The CAS reboot flag is false by default and all the locations that could set it to true have been dropped. This means that all code blocks depending on the flag being set is dead code and the other code blocks should be executed always. Just do that and drop the now uneeded CAS reboot flag. Fix a comment on the way to make checkpatch happy. Signed-off-by: Greg Kurz --- hw/ppc/spapr.c | 18 ++++-------------- hw/ppc/spapr_hcall.c | 33 ++++++++++++++------------------- include/hw/ppc/spapr.h | 1 - 3 files changed, 18 insertions(+), 34 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index c522cd205fee..4c46578b1387 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1579,9 +1579,7 @@ void spapr_setup_hpt(SpaprMachineState *spapr) { int hpt_shift; =20 - if ((spapr->resize_hpt =3D=3D SPAPR_RESIZE_HPT_DISABLED) - || (spapr->cas_reboot - && !spapr_ovec_test(spapr->ov5_cas, OV5_HPT_RESIZE))) { + if (spapr->resize_hpt =3D=3D SPAPR_RESIZE_HPT_DISABLED) { hpt_shift =3D spapr_hpt_shift_for_ramsize(MACHINE(spapr)->maxram_s= ize); } else { uint64_t current_ram_size; @@ -1645,16 +1643,10 @@ static void spapr_machine_reset(MachineState *machi= ne) =20 qemu_devices_reset(); =20 - /* - * If this reset wasn't generated by CAS, we should reset our - * negotiated options and start from scratch - */ - if (!spapr->cas_reboot) { - spapr_ovec_cleanup(spapr->ov5_cas); - spapr->ov5_cas =3D spapr_ovec_new(); + spapr_ovec_cleanup(spapr->ov5_cas); + spapr->ov5_cas =3D spapr_ovec_new(); =20 - ppc_set_compat_all(spapr->max_compat_pvr, &error_fatal); - } + ppc_set_compat_all(spapr->max_compat_pvr, &error_fatal); =20 /* * This is fixing some of the default configuration of the XIVE @@ -1707,8 +1699,6 @@ static void spapr_machine_reset(MachineState *machine) spapr_cpu_set_entry_state(first_ppc_cpu, SPAPR_ENTRY_POINT, 0, fdt_add= r, 0); first_ppc_cpu->env.gpr[5] =3D 0; =20 - spapr->cas_reboot =3D false; - spapr->fwnmi_system_reset_addr =3D -1; spapr->fwnmi_machine_check_addr =3D -1; spapr->fwnmi_machine_check_interlock =3D -1; diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c index b424bca4d2c0..0fe8da3c9359 100644 --- a/hw/ppc/spapr_hcall.c +++ b/hw/ppc/spapr_hcall.c @@ -1678,6 +1678,7 @@ target_ulong do_client_architecture_support(PowerPCCP= U *cpu, bool raw_mode_supported =3D false; bool guest_xive; CPUState *cs; + void *fdt; =20 /* CAS is supposed to be called early when only the boot vCPU is activ= e. */ CPU_FOREACH(cs) { @@ -1817,27 +1818,21 @@ target_ulong do_client_architecture_support(PowerPC= CPU *cpu, =20 spapr_handle_transient_dev_before_cas(spapr); =20 - if (!spapr->cas_reboot) { - void *fdt; - - /* If spapr_machine_reset() did not set up a HPT but one is necess= ary - * (because the guest isn't going to use radix) then set it up her= e. */ - if ((spapr->patb_entry & PATE1_GR) && !guest_radix) { - /* legacy hash or new hash: */ - spapr_setup_hpt(spapr); - } - - fdt =3D spapr_build_fdt(spapr, false, fdt_bufsize); - - g_free(spapr->fdt_blob); - spapr->fdt_size =3D fdt_totalsize(fdt); - spapr->fdt_initial_size =3D spapr->fdt_size; - spapr->fdt_blob =3D fdt; + /* + * If spapr_machine_reset() did not set up a HPT but one is necessary + * (because the guest isn't going to use radix) then set it up here. + */ + if ((spapr->patb_entry & PATE1_GR) && !guest_radix) { + /* legacy hash or new hash: */ + spapr_setup_hpt(spapr); } =20 - if (spapr->cas_reboot) { - qemu_system_reset_request(SHUTDOWN_CAUSE_SUBSYSTEM_RESET); - } + fdt =3D spapr_build_fdt(spapr, false, fdt_bufsize); + + g_free(spapr->fdt_blob); + spapr->fdt_size =3D fdt_totalsize(fdt); + spapr->fdt_initial_size =3D spapr->fdt_size; + spapr->fdt_blob =3D fdt; =20 return H_SUCCESS; } diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h index b7e13e5aafb7..e579eaf28c05 100644 --- a/include/hw/ppc/spapr.h +++ b/include/hw/ppc/spapr.h @@ -178,7 +178,6 @@ struct SpaprMachineState { SpaprEventSource *event_sources; =20 /* ibm,client-architecture-support option negotiation */ - bool cas_reboot; bool cas_pre_isa3_guest; SpaprOptionVector *ov5; /* QEMU-supported option vectors */ SpaprOptionVector *ov5_cas; /* negotiated (via CAS) option vectors= */