From nobody Tue Feb 10 12:43:12 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; dkim=fail spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1498820081391926.5864404973197; Fri, 30 Jun 2017 03:54:41 -0700 (PDT) Received: from localhost ([::1]:43670 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dQtZP-0007Ar-V0 for importer@patchew.org; Fri, 30 Jun 2017 06:54:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34412) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dQtRl-0008Td-Al for qemu-devel@nongnu.org; Fri, 30 Jun 2017 06:46:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dQtRj-0007vV-Df for qemu-devel@nongnu.org; Fri, 30 Jun 2017 06:46:45 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:52165) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dQtRj-0007sj-0E; Fri, 30 Jun 2017 06:46:43 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 3wzY9m6X7mz9sPN; Fri, 30 Jun 2017 20:46:36 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1498819596; bh=T0d0JECuXMwvQC08D5IMtoyvwpzfqxxyuJ6DF85G4Do=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hHqNI1vD7zj+4NY6HcrPIPglKU34oFLrzO0rVzq1BZ+RoDajdTH8XDv1/upMAIaq9 qCFPTc6GKYx2NQu+WzOitq1//X5O/6cHbbo1Vm3PNoyDAzaw//s77kBYM8w4SleEBH SSAjbAog01r/roKz3oRJtl1BfD1MhyzFa28jDNks= From: David Gibson To: peter.maydell@linaro.org Date: Fri, 30 Jun 2017 20:46:15 +1000 Message-Id: <20170630104632.27942-5-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170630104632.27942-1-david@gibson.dropbear.id.au> References: <20170630104632.27942-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 04/21] pseries: Reset CPU compatibility mode X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lvivier@redhat.com, thuth@redhat.com, qemu-devel@nongnu.org, sursingh@redhat.com, mdroth@linux.vnet.ibm.com, agraf@suse.de, qemu-ppc@nongnu.org, sbobroff@redhat.com, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Currently, the CPU compatibility mode is set when the cpu is initialized, then again when the guest negotiates features. This means if a guest negotiates a compatibility mode, then reboots, that compatibility mode will be retained across the reset. Usually that will get overridden when features are negotiated on the next boot, but it's still not really correct. This patch moves the initial set up of the compatibility mode from cpu init to reset time. The mode *is* retained if the reboot was caused by the feature negotiation (it might be important in that case, though it's unlikely). Signed-off-by: David Gibson Reviewed-by: Alexey Kardashevskiy Reviewed-by: Michael Roth Tested-by: Andrea Bolognani --- hw/ppc/spapr.c | 2 ++ hw/ppc/spapr_cpu_core.c | 10 ---------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 67d4c13..81007b9 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1346,6 +1346,8 @@ static void ppc_spapr_reset(void) if (!spapr->cas_reboot) { spapr_ovec_cleanup(spapr->ov5_cas); spapr->ov5_cas =3D spapr_ovec_new(); + + ppc_set_compat_all(spapr->max_compat_pvr, &error_fatal); } =20 fdt =3D spapr_build_fdt(spapr, rtas_addr, spapr->rtas_size); diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c index 97472fd..d6719d5 100644 --- a/hw/ppc/spapr_cpu_core.c +++ b/hw/ppc/spapr_cpu_core.c @@ -118,16 +118,6 @@ static void spapr_cpu_init(sPAPRMachineState *spapr, P= owerPCCPU *cpu, /* Enable PAPR mode in TCG or KVM */ cpu_ppc_set_papr(cpu, PPC_VIRTUAL_HYPERVISOR(spapr)); =20 - if (spapr->max_compat_pvr) { - Error *local_err =3D NULL; - - ppc_set_compat(cpu, spapr->max_compat_pvr, &local_err); - if (local_err) { - error_propagate(errp, local_err); - return; - } - } - qemu_register_reset(spapr_cpu_reset, cpu); spapr_cpu_reset(cpu); } --=20 2.9.4