From nobody Wed Nov 5 05:22:24 2025 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.zohomail.com; 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; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1533314433500231.04721784684932; Fri, 3 Aug 2018 09:40:33 -0700 (PDT) Received: from localhost ([::1]:52265 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fld7w-0006sA-GG for importer@patchew.org; Fri, 03 Aug 2018 12:40:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49014) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fld4a-0004Qj-HP for qemu-devel@nongnu.org; Fri, 03 Aug 2018 12:37:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fld4Z-0006Zn-Ll for qemu-devel@nongnu.org; Fri, 03 Aug 2018 12:37:04 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:44042) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fld4X-0006RQ-9J; Fri, 03 Aug 2018 12:37:01 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1fld4M-00075u-Mk; Fri, 03 Aug 2018 17:36:50 +0100 From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Date: Fri, 3 Aug 2018 17:36:44 +0100 Message-Id: <20180803163646.31068-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180803163646.31068-1-peter.maydell@linaro.org> References: <20180803163646.31068-1-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PATCH 1/3] hw/intc/arm_gicv3_common: Give no-migration-shift-bug subsection a needed function 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: Juan Quintela , "Dr . David Alan Gilbert" , patches@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Currently the migration code incorrectly treats a subsection with no .needed function pointer as if it was the subsection list terminator -- it is ignored and so is everything after it. Work around this by giving vmstate_gicv3_gicd_no_migration_shift_bug a 'needed' function that always returns true. Signed-off-by: Peter Maydell Reviewed-by: Dr. David Alan Gilbert --- This should go into 3.0 to avoid awkward migration compat problems: the no-migration-shift-bug subsection is new in 3.0. --- hw/intc/arm_gicv3_common.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/intc/arm_gicv3_common.c b/hw/intc/arm_gicv3_common.c index ff326b374ad..e58bc8b8105 100644 --- a/hw/intc/arm_gicv3_common.c +++ b/hw/intc/arm_gicv3_common.c @@ -203,10 +203,16 @@ static int gicv3_gicd_no_migration_shift_bug_post_loa= d(void *opaque, return 0; } =20 +static bool needed_always(void *opaque) +{ + return true; +} + const VMStateDescription vmstate_gicv3_gicd_no_migration_shift_bug =3D { .name =3D "arm_gicv3/gicd_no_migration_shift_bug", .version_id =3D 1, .minimum_version_id =3D 1, + .needed =3D needed_always, .pre_load =3D gicv3_gicd_no_migration_shift_bug_pre_load, .post_load =3D gicv3_gicd_no_migration_shift_bug_post_load, .fields =3D (VMStateField[]) { --=20 2.17.1 From nobody Wed Nov 5 05:22:24 2025 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.zohomail.com; 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; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1533314334990289.3938972181902; Fri, 3 Aug 2018 09:38:54 -0700 (PDT) Received: from localhost ([::1]:52253 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fld6J-0005PZ-By for importer@patchew.org; Fri, 03 Aug 2018 12:38:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49001) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fld4Z-0004Pw-Sr for qemu-devel@nongnu.org; Fri, 03 Aug 2018 12:37:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fld4Z-0006ZN-29 for qemu-devel@nongnu.org; Fri, 03 Aug 2018 12:37:03 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:44042) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fld4W-0006RQ-9t; Fri, 03 Aug 2018 12:37:00 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1fld4N-00076C-JV; Fri, 03 Aug 2018 17:36:51 +0100 From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Date: Fri, 3 Aug 2018 17:36:45 +0100 Message-Id: <20180803163646.31068-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180803163646.31068-1-peter.maydell@linaro.org> References: <20180803163646.31068-1-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PATCH 2/3] hw/intc/arm_gicv3_common: Combine duplicate .subsections in vmstate_gicv3_cpu 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: Juan Quintela , "Dr . David Alan Gilbert" , patches@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Commit 6692aac411199064 accidentally introduced a second initialization of the .subsections field of vmstate_gicv3_cpu, instead of adding the new subsection to the existing list. The effect of this was probably that migration of GICv3 with virtualization enabled was broken (or alternatively that migration of ICC_SRE_EL1 was broken, depending on which of the two initializers the compiler used). Combine the two into a single list. Signed-off-by: Peter Maydell Reviewed-by: Dr. David Alan Gilbert --- Not strictly a 2.12 regression. --- hw/intc/arm_gicv3_common.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/hw/intc/arm_gicv3_common.c b/hw/intc/arm_gicv3_common.c index e58bc8b8105..e1a8999cf5b 100644 --- a/hw/intc/arm_gicv3_common.c +++ b/hw/intc/arm_gicv3_common.c @@ -134,9 +134,6 @@ static const VMStateDescription vmstate_gicv3_cpu =3D { }, .subsections =3D (const VMStateDescription * []) { &vmstate_gicv3_cpu_virt, - NULL - }, - .subsections =3D (const VMStateDescription * []) { &vmstate_gicv3_cpu_sre_el1, NULL } --=20 2.17.1 From nobody Wed Nov 5 05:22:24 2025 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.zohomail.com; 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; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1533314335094184.25450434713252; Fri, 3 Aug 2018 09:38:55 -0700 (PDT) Received: from localhost ([::1]:52252 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fld6K-0005PE-B1 for importer@patchew.org; Fri, 03 Aug 2018 12:38:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48996) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fld4Z-0004PY-Gr for qemu-devel@nongnu.org; Fri, 03 Aug 2018 12:37:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fld4X-0006YN-Os for qemu-devel@nongnu.org; Fri, 03 Aug 2018 12:37:03 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:44042) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fld4V-0006RQ-BX; Fri, 03 Aug 2018 12:36:59 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1fld4O-00076T-GZ; Fri, 03 Aug 2018 17:36:52 +0100 From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Date: Fri, 3 Aug 2018 17:36:46 +0100 Message-Id: <20180803163646.31068-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180803163646.31068-1-peter.maydell@linaro.org> References: <20180803163646.31068-1-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PATCH 3/3] target/arm: Add dummy needed functions to M profile vmstate subsections 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: Juan Quintela , "Dr . David Alan Gilbert" , patches@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Currently the migration code incorrectly treats a subsection with no .needed function pointer as if it was the subsection list terminator -- it is ignored and so is everything after it. Work around this by giving various M profile vmstate structs a 'needed' function that always returns true. We reuse m_needed() for this, since it's always true here. Signed-off-by: Peter Maydell Reviewed-by: Dr. David Alan Gilbert --- Not strictly a regression as it only affects M profile CPUs with the security extensions, and migration of those was broken anyway in 2.12 due to a different bug. --- target/arm/machine.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/arm/machine.c b/target/arm/machine.c index 2e28d086bdf..ff4ec22bf75 100644 --- a/target/arm/machine.c +++ b/target/arm/machine.c @@ -184,6 +184,7 @@ static const VMStateDescription vmstate_m_faultmask_pri= mask =3D { .name =3D "cpu/m/faultmask-primask", .version_id =3D 1, .minimum_version_id =3D 1, + .needed =3D m_needed, .fields =3D (VMStateField[]) { VMSTATE_UINT32(env.v7m.faultmask[M_REG_NS], ARMCPU), VMSTATE_UINT32(env.v7m.primask[M_REG_NS], ARMCPU), @@ -230,6 +231,7 @@ static const VMStateDescription vmstate_m_scr =3D { .name =3D "cpu/m/scr", .version_id =3D 1, .minimum_version_id =3D 1, + .needed =3D m_needed, .fields =3D (VMStateField[]) { VMSTATE_UINT32(env.v7m.scr[M_REG_NS], ARMCPU), VMSTATE_END_OF_LIST() @@ -240,6 +242,7 @@ static const VMStateDescription vmstate_m_other_sp =3D { .name =3D "cpu/m/other-sp", .version_id =3D 1, .minimum_version_id =3D 1, + .needed =3D m_needed, .fields =3D (VMStateField[]) { VMSTATE_UINT32(env.v7m.other_sp, ARMCPU), VMSTATE_END_OF_LIST() --=20 2.17.1