From nobody Tue Oct 14 10:36:56 2025 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 ARC-Seal: i=1; a=rsa-sha256; t=1588828415; cv=none; d=zohomail.com; s=zohoarc; b=B9N6j4ArQXSjKyQBSp8xyDWFBCx+EA4X0hEHwOwYQBGzqBSChpEvEE7A/H8sMZR8oPQ0kQXXSaCr6UYxwWKDPcrS8JjTHzXb6YFdurhnjeNAcyBcphn2bS8VMfqlTjr/lNb5lK2df3qa9HIwzm+Y7BHuARHhYyrf4lvqiJI7z3I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588828415; 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=8aTl13MTjuP44/3MMbE3aKoXo/RxyN9kgvCewND0a3o=; b=DNf+ioby8Gern1eKuuj1R62rO3evsHifgL1OHfpSkK6mJW1WCbsGoXlNSAPN1+JeH2/LdF9IqbEgH6+2G9cbZikM2/cxNNDa/+GiGEnpobctvFzgiMdlCHDDUA06/IkzAAiL1HTBV9B01yBsUCmE/C+Kl+AKTJI10PbHk75AamY= 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1588828415237982.4922413660461; Wed, 6 May 2020 22:13:35 -0700 (PDT) Received: from localhost ([::1]:52162 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jWYqk-0000QE-2B for importer@patchew.org; Thu, 07 May 2020 01:13:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33578) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWYhy-0007g0-CN; Thu, 07 May 2020 01:04:30 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:56607) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWYhw-0007du-QH; Thu, 07 May 2020 01:04:30 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 49HhFn6kNnz9sSx; Thu, 7 May 2020 15:04:13 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1588827853; bh=+QbVUd1UgLdlY1lqI5xNAI7XHDlOWMlYunUoNKLLV3s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VE/Gb0uM2mlbyjxEk0AZ/Xo1st4ZBqFl8gm71qUmbZ9HGcNelCeQmQ2F886JmgHpb ANE4GegUyXYQw175M6GxLZDv7ByLLyEs3vVKr3/wVFJd/vr7Xvom2qUp6ukWF8cS7m xP8zP/i5scZPOHIO+cuEJQqt/z1tiqkxiNq31hUY= From: David Gibson To: peter.maydell@linaro.org Subject: [PULL 07/18] spapr: Drop CAS reboot flag Date: Thu, 7 May 2020 15:02:17 +1000 Message-Id: <20200507050228.802395-8-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200507050228.802395-1-david@gibson.dropbear.id.au> References: <20200507050228.802395-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=2401:3900:2:1::2; envelope-from=dgibson@ozlabs.org; helo=ozlabs.org X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: aik@ozlabs.ru, qemu-devel@nongnu.org, npiggin@gmail.com, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson 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" From: Greg Kurz 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 Message-Id: <158514994893.478799.11772512888322840990.stgit@bahia.lan> Signed-off-by: David Gibson --- 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 f52488d397..841b5ec59b 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 48a8745514..0f54988f2e 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) { @@ -1818,27 +1819,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 b7e13e5aaf..e579eaf28c 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= */ --=20 2.26.2