From patchwork Fri Aug 3 16:36:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 143419 Delivered-To: patches@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp363141ljj; Fri, 3 Aug 2018 09:36:51 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdqraUYEYytXtMj+S4+qOaarV2gKMmC/aiAKmhC0CS/9zlx82sDpXOvFUfQ/Hh7hMqHQ53A X-Received: by 2002:a1c:1182:: with SMTP id 124-v6mr5475477wmr.75.1533314211553; Fri, 03 Aug 2018 09:36:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533314211; cv=none; d=google.com; s=arc-20160816; b=cQADoGbxvlAlhetseZ2Qa1wMAxVjdm9p3i4Mknr30oDkzAghv0EmkSrA9+lYEVUVcW uu3JAAy8GZGMCft4lDcDvm3ruSMgRF0+y/+aqth4Juii6wgvuqGOUdTDdKwidf6tuR19 vFsww7oturgvAM5GybR2IHaNfr7FJly12yeMmTL36T5BBhGT2oLBSWzzVcUmqJBwz/3q CClngbE2p3ruJ3UTkKRAgYp3ML5nd/beN24SExB7bu8XKU5dePHWixs9nIZHiPDlY4YC j1HWaInDdR1QZb8c4jec43SG+kSJCE72R7Kk/f7yzjrvl8KuPI9rxERchIDVFo23xVr/ vP3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=6x5YMUy+lOuSMbGgcSbFtKTMufRMOLv90gY4wV//u2Q=; b=SN7z95/bYbY+rlZSbbhvz6LgN8or8wCZsSglhggubyNUyoONsSw0Q/3wVRlwr1vG+7 7LAAGzZTtH+pSuLLubtNp2Flrum2WNvEGUPkOepdLEpjlYm7LCAZ8ZD2pbSgdmaTKM1I f0tfkbE/I6PNcmAgd2eIUCWD5Lgk9DHEGV405z8XQkM26gTUE83aMfR0j6LbwJevOJSx SRCpyBTljh0L7+5rcmSNPb8baLIY2OXSrKStEWkrkP61E4kZZFZiBKrxVrcW2BhchCJS rexv+5FZybBmkpwrdlbJ6uV1jyihtl5wSCjjg5mmuzFgxsZOmzyIkVGSqgrfmPm0bUP0 npaQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) smtp.mailfrom=pm215@archaic.org.uk; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by mx.google.com with ESMTPS id i70-v6si3772675wmf.171.2018.08.03.09.36.51 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Aug 2018 09:36:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) client-ip=2001:8b0:1d0::2; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) smtp.mailfrom=pm215@archaic.org.uk; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 Cc: patches@linaro.org, Juan Quintela , "Dr . David Alan Gilbert" Subject: [PATCH 1/3] hw/intc/arm_gicv3_common: Give no-migration-shift-bug subsection a needed function 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> 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 --- 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(+) -- 2.17.1 Reviewed-by: Dr. David Alan Gilbert 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_load(void *opaque, return 0; } +static bool needed_always(void *opaque) +{ + return true; +} + const VMStateDescription vmstate_gicv3_gicd_no_migration_shift_bug = { .name = "arm_gicv3/gicd_no_migration_shift_bug", .version_id = 1, .minimum_version_id = 1, + .needed = needed_always, .pre_load = gicv3_gicd_no_migration_shift_bug_pre_load, .post_load = gicv3_gicd_no_migration_shift_bug_post_load, .fields = (VMStateField[]) { From patchwork Fri Aug 3 16:36:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 143421 Delivered-To: patches@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp363153ljj; Fri, 3 Aug 2018 09:36:52 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdvo0wZ2wDUnf+PXMGhq5lFerJTnEcl9VZ/ec8yOFrIONYN9lTwl35EdOcuS/YM71sYiuAg X-Received: by 2002:adf:b112:: with SMTP id l18-v6mr3249131wra.101.1533314212139; Fri, 03 Aug 2018 09:36:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533314212; cv=none; d=google.com; s=arc-20160816; b=pX1WADlPOgzRPWXCcTNlGh5DiV3/jC0k2IAxDPztS8TMWV1V+Tq3qMUupEpUzQ0qOK uqVRToWvatQNM23L6eppUUY+uLflPH/zly53f3Fds4djtH+InSre8OUOG8m1mFguxicb BwQ0E162D5moQaMKsoP5oUCRULhI1OM1tuJWlL2w26EBlGPNtbZeKJV6QsphbaixGcWy 88KDQDqxKeBc3cWhNjCZPXvBkWUN4SHDgRf1/YOEmIosTCmWYCNsZQ0iNCoGsqtBTbBq H7Q/8tCGvk3oMs6iM76WbbcKceMTrLs7VQRJQGSosh+t8mwe2O6D74NU4Q3/uqbY153M PzEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=iY0v9pTL6lBK1FjCmjFHbuRVUHtSt05VkKYg7v/+3go=; b=kEhDgESD1lsJwged9PAiHQTECPS92DKrIx4fltouRprDM2zH2c0kKeV5KoZBDpme8B DgCO5sshz1w2ZKzIe4e0bXBL27UMxMZEcDi/3C7JqFe7JZmQl08VNkW8hPKEHLMgEUlj 1L0GI1AajVK1D2CPIkaISfGiOIG+uHd3q07gUjrfIRfRSOHU1Hac4OC6MTAvLrUYLzNx mXGRvznzt/AeogC/BFnwpvr0TzYxhmhFGw23bfP6A/Gu5uNeTjioi82Cv77LcYlzYHBp KFuzTWZ5icAaINNTrcsN1bJP8uz5fOeRzbyTSmG8DjX5/o7jCda2es0tAbYKG2iHm7gX R9vA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) smtp.mailfrom=pm215@archaic.org.uk; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by mx.google.com with ESMTPS id q16-v6si3533260wrr.414.2018.08.03.09.36.51 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Aug 2018 09:36:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) client-ip=2001:8b0:1d0::2; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) smtp.mailfrom=pm215@archaic.org.uk; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 Cc: patches@linaro.org, Juan Quintela , "Dr . David Alan Gilbert" Subject: [PATCH 2/3] hw/intc/arm_gicv3_common: Combine duplicate .subsections in vmstate_gicv3_cpu 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> 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 --- Not strictly a 2.12 regression. --- hw/intc/arm_gicv3_common.c | 3 --- 1 file changed, 3 deletions(-) -- 2.17.1 Reviewed-by: Dr. David Alan Gilbert 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 = { }, .subsections = (const VMStateDescription * []) { &vmstate_gicv3_cpu_virt, - NULL - }, - .subsections = (const VMStateDescription * []) { &vmstate_gicv3_cpu_sre_el1, NULL } From patchwork Fri Aug 3 16:36:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 143422 Delivered-To: patches@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp363169ljj; Fri, 3 Aug 2018 09:36:52 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdU2tZUGJuTHbq9bSfJ7xZpCN119aPCEuR7rGuXdgS7y/mXP9uCI4UoNDLj9b3nmUrrEvhx X-Received: by 2002:a1c:545:: with SMTP id 66-v6mr5786663wmf.140.1533314212942; Fri, 03 Aug 2018 09:36:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533314212; cv=none; d=google.com; s=arc-20160816; b=KequCDkpRUs007XVlUPwThAXgBZPr+b0ymLjqXdVyj5dy+8dn11NSe+G8BWp9p9EPY aZJd8gKJBze6tsQnHvrz2CM6l9Pl+edHXbw+nE7Oe1+AIKfy8bCewYEOZ8pGsiuWoeLg ldHgrBoNRj+T0x56qN42K58/6evXj76Jd+Yrt9eS/FQmJGpfKvUuKL3Ay6PnZv6I6tHy ddfFvb019xSlX/ImxhxdR+xNZ2XjkyNGjHOTrINH9A1q8LxUX0Scn8el7/WqkXtGFmiw BuYisX8ItOoA76DqtBP76Js6XE38J4BcGzfxc5kEQtDrCFPoR6QcJYStJsLAFH7Kl1sH sT/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=QDqvJhT/BO4HrPhyv/cBNa3b48L/m9HyHHOuCi6Nhkw=; b=I0ON++gf4V38IHYZArF/YAv0k/rHdHAMtHYDLolRuKJfG0CESMaownFwiDIP6+rhoB xPYD9+RIScsoXdJlHASUc3mV3DeldkQvbprw6hOiDb4z/h+kY4wUOWxyl1pBxjP+FYEt eadxdVWv5gx+xE+5hBlnGMPsGjJ1uvlvb73CaNHXcO7sFr7Xz5luzKIXczcjwwo5t/qJ TCKbeXHUBhjCZk3i6CqL9MjPqoiwyvy9xjLDIdT8yF/gL/8azejEXs4gQhUQvRnOvUBy rhjRquH/+wFyYhS8iL0kyiFmXsFJZfrRCSce6j6NNUUGdHDiOXqojlDgsxmZdzhvWCZ+ QmRw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) smtp.mailfrom=pm215@archaic.org.uk; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by mx.google.com with ESMTPS id v123-v6si3921063wmf.105.2018.08.03.09.36.52 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Aug 2018 09:36:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) client-ip=2001:8b0:1d0::2; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) smtp.mailfrom=pm215@archaic.org.uk; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 Cc: patches@linaro.org, Juan Quintela , "Dr . David Alan Gilbert" Subject: [PATCH 3/3] target/arm: Add dummy needed functions to M profile vmstate subsections 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> 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 --- 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(+) -- 2.17.1 Reviewed-by: Dr. David Alan Gilbert 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_primask = { .name = "cpu/m/faultmask-primask", .version_id = 1, .minimum_version_id = 1, + .needed = m_needed, .fields = (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 = { .name = "cpu/m/scr", .version_id = 1, .minimum_version_id = 1, + .needed = m_needed, .fields = (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 = { .name = "cpu/m/other-sp", .version_id = 1, .minimum_version_id = 1, + .needed = m_needed, .fields = (VMStateField[]) { VMSTATE_UINT32(env.v7m.other_sp, ARMCPU), VMSTATE_END_OF_LIST()