From nobody Mon Feb 9 14:50:24 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; 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 1488302674049879.3984028894296; Tue, 28 Feb 2017 09:24:34 -0800 (PST) Received: from localhost ([::1]:35809 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cilVk-000864-RJ for importer@patchew.org; Tue, 28 Feb 2017 12:24:28 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43335) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cilO0-0001j5-7i for qemu-devel@nongnu.org; Tue, 28 Feb 2017 12:16:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cilNz-00036k-8S for qemu-devel@nongnu.org; Tue, 28 Feb 2017 12:16:28 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:48715) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cilNz-00034e-1v for qemu-devel@nongnu.org; Tue, 28 Feb 2017 12:16:27 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.84_2) (envelope-from ) id 1cilNx-0003UA-Ew for qemu-devel@nongnu.org; Tue, 28 Feb 2017 17:16:25 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Tue, 28 Feb 2017 17:16:09 +0000 Message-Id: <1488302176-19463-15-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1488302176-19463-1-git-send-email-peter.maydell@linaro.org> References: <1488302176-19463-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 14/21] hw/intc/arm_gicv3_kvm: Add ICC_SRE_EL1 register to vmstate 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Vijaya Kumar K To Save and Restore ICC_SRE_EL1 register introduce vmstate subsection and load only if non-zero. Also initialize icc_sre_el1 with to 0x7 in pre_load function. Signed-off-by: Vijaya Kumar K Reviewed-by: Peter Maydell Reviewed-by: Eric Auger Message-id: 1487850673-26455-3-git-send-email-vijay.kilari@gmail.com Signed-off-by: Peter Maydell --- include/hw/intc/arm_gicv3_common.h | 1 + hw/intc/arm_gicv3_common.c | 36 ++++++++++++++++++++++++++++++++++= ++ 2 files changed, 37 insertions(+) diff --git a/include/hw/intc/arm_gicv3_common.h b/include/hw/intc/arm_gicv3= _common.h index 4156051..bccdfe1 100644 --- a/include/hw/intc/arm_gicv3_common.h +++ b/include/hw/intc/arm_gicv3_common.h @@ -172,6 +172,7 @@ struct GICv3CPUState { uint8_t gicr_ipriorityr[GIC_INTERNAL]; =20 /* CPU interface */ + uint64_t icc_sre_el1; uint64_t icc_ctlr_el1[2]; uint64_t icc_pmr_el1; uint64_t icc_bpr[3]; diff --git a/hw/intc/arm_gicv3_common.c b/hw/intc/arm_gicv3_common.c index 16b9b0f..5b0e456 100644 --- a/hw/intc/arm_gicv3_common.c +++ b/hw/intc/arm_gicv3_common.c @@ -70,6 +70,38 @@ static const VMStateDescription vmstate_gicv3_cpu_virt = =3D { } }; =20 +static int icc_sre_el1_reg_pre_load(void *opaque) +{ + GICv3CPUState *cs =3D opaque; + + /* + * If the sre_el1 subsection is not transferred this + * means SRE_EL1 is 0x7 (which might not be the same as + * our reset value). + */ + cs->icc_sre_el1 =3D 0x7; + return 0; +} + +static bool icc_sre_el1_reg_needed(void *opaque) +{ + GICv3CPUState *cs =3D opaque; + + return cs->icc_sre_el1 !=3D 7; +} + +const VMStateDescription vmstate_gicv3_cpu_sre_el1 =3D { + .name =3D "arm_gicv3_cpu/sre_el1", + .version_id =3D 1, + .minimum_version_id =3D 1, + .pre_load =3D icc_sre_el1_reg_pre_load, + .needed =3D icc_sre_el1_reg_needed, + .fields =3D (VMStateField[]) { + VMSTATE_UINT64(icc_sre_el1, GICv3CPUState), + VMSTATE_END_OF_LIST() + } +}; + static const VMStateDescription vmstate_gicv3_cpu =3D { .name =3D "arm_gicv3_cpu", .version_id =3D 1, @@ -100,6 +132,10 @@ 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 --=20 2.7.4