From nobody Mon Feb 9 21:01:32 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=fail Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1563978989719913.201192502105; Wed, 24 Jul 2019 07:36:29 -0700 (PDT) Received: from localhost ([::1]:52244 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hqINY-0003RX-L1 for importer@patchew.org; Wed, 24 Jul 2019 10:36:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60455) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hqINL-0002x3-6K for qemu-devel@nongnu.org; Wed, 24 Jul 2019 10:36:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hqINK-0008Nz-45 for qemu-devel@nongnu.org; Wed, 24 Jul 2019 10:36:15 -0400 Received: from beetle.greensocs.com ([5.135.226.135]:44366) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hqINH-0008Jp-C1; Wed, 24 Jul 2019 10:36:11 -0400 Received: from kouign-amann.bar.greensocs.com (unknown [172.16.11.117]) by beetle.greensocs.com (Postfix) with ESMTPS id 11EFB96F51; Wed, 24 Jul 2019 14:36:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=greensocs.com; s=mail; t=1563978968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=KUurv/KQaHtXORkxGqb0dU1d7NJ5+71uYGLwWNlG2hI=; b=Y+3i/bif+o99Uor3vTkcEH7yR9iWCWLrUjYaQAeYq0L0fd2vlDQX0xtWpV9cXa/TFYmf6l w+ypNuzmqq6IMUV+2tVJ4IiJtTf0SbgH4Kitukm6b0/OBm+tShRCidTsJXYNEpnMnzS7hT Xk8oqeuEpjY8xMNcHQiMahISyl2mxdo= From: Damien Hedde To: qemu-devel@nongnu.org Date: Wed, 24 Jul 2019 16:35:53 +0200 Message-Id: <20190724143553.21557-1-damien.hedde@greensocs.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=greensocs.com; s=mail; t=1563978968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=KUurv/KQaHtXORkxGqb0dU1d7NJ5+71uYGLwWNlG2hI=; b=4wpMEr021XD0hMVbulDG6wTO+FlpLQVrxdJ94hueM2/mTsASn7pQYSYoKoeYWoJvHb6v/p lzWEiPsamiN6fHXe8CNT94m6UUhmtVp7eLm0T8IySZEfAjInGzwt+vkUZolk9LRQh5DPO+ kAhWhIHshrKPIlf/aqUgREfzhI8v00w= ARC-Seal: i=1; s=mail; d=greensocs.com; t=1563978968; a=rsa-sha256; cv=none; b=ic1ek3cXPpEdtxhEagFf9PbCZYG3bOhv/BvA2RYQwHK3j07IyJXznAKIBTPTQkDyj77PXE LrucliYHki1kH3lhVtFmaN16qfHef5NqHB2NwaNvtlfg/YOl1afw1825VrYdvsOa2fuZ5A wMMiUfqqd/ymyNJBDqWZ4HCkXKyHj1U= ARC-Authentication-Results: i=1; beetle.greensocs.com; none Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 5.135.226.135 Subject: [Qemu-devel] [PATCH for 4.1?] pl330: fix vmstate description 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: Damien Hedde , peter.maydell@linaro.org, qemu-arm@nongnu.org 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" Fix the pl330 main and queue vmstate description. There were missing POINTER flags causing crashes during incoming migration because: + PL330State chan field is a pointer to an array + PL330Queue queue field is a pointer to an array Also bump corresponding vmsd version numbers. Signed-off-by: Damien Hedde Acked-by: Dr. David Alan Gilbert Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daude --- I found this while working on reset with xilinx-zynq machine. I'm not sure what's the vmsd version policy in such cases (for backward compatibility). I've simply bumped them since migration was not working anyway (vmstate_load_state was erasing critical part of PL330State and causing segfaults while loading following fields). Tested doing migration with the xilinx-zynq-a9 machine. --- hw/dma/pl330.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/hw/dma/pl330.c b/hw/dma/pl330.c index 58df965a46..a56a3e7771 100644 --- a/hw/dma/pl330.c +++ b/hw/dma/pl330.c @@ -218,11 +218,12 @@ typedef struct PL330Queue { =20 static const VMStateDescription vmstate_pl330_queue =3D { .name =3D "pl330_queue", - .version_id =3D 1, - .minimum_version_id =3D 1, + .version_id =3D 2, + .minimum_version_id =3D 2, .fields =3D (VMStateField[]) { - VMSTATE_STRUCT_VARRAY_UINT32(queue, PL330Queue, queue_size, 1, - vmstate_pl330_queue_entry, PL330QueueEntr= y), + VMSTATE_STRUCT_VARRAY_POINTER_UINT32(queue, PL330Queue, queue_size, + vmstate_pl330_queue_entry, + PL330QueueEntry), VMSTATE_END_OF_LIST() } }; @@ -278,12 +279,12 @@ struct PL330State { =20 static const VMStateDescription vmstate_pl330 =3D { .name =3D "pl330", - .version_id =3D 1, - .minimum_version_id =3D 1, + .version_id =3D 2, + .minimum_version_id =3D 2, .fields =3D (VMStateField[]) { VMSTATE_STRUCT(manager, PL330State, 0, vmstate_pl330_chan, PL330Ch= an), - VMSTATE_STRUCT_VARRAY_UINT32(chan, PL330State, num_chnls, 0, - vmstate_pl330_chan, PL330Chan), + VMSTATE_STRUCT_VARRAY_POINTER_UINT32(chan, PL330State, num_chnls, + vmstate_pl330_chan, PL330Chan= ), VMSTATE_VBUFFER_UINT32(lo_seqn, PL330State, 1, NULL, num_chnls), VMSTATE_VBUFFER_UINT32(hi_seqn, PL330State, 1, NULL, num_chnls), VMSTATE_STRUCT(fifo, PL330State, 0, vmstate_pl330_fifo, PL330Fifo), --=20 2.22.0