All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH for-3.0 0/2] MPS/v8M bug fixes
@ 2018-07-27 11:38 Peter Maydell
  2018-07-27 11:38 ` [Qemu-devel] [PATCH for-3.0 1/2] armv7m_nvic: Fix m-security subsection name Peter Maydell
  2018-07-27 11:38 ` [Qemu-devel] [PATCH for-3.0 2/2] hw/arm/iotkit: Fix IRQ number for timer1 Peter Maydell
  0 siblings, 2 replies; 5+ messages in thread
From: Peter Maydell @ 2018-07-27 11:38 UTC (permalink / raw)
  To: qemu-arm, qemu-devel; +Cc: patches

This patchset fixes a couple of bugs I found in the v8M
and MPS board code:
 * migration wasn't working because of an incorrect
   subsection name in the NVIC vmstate
 * the timer1 IRQ line was miswired in the iotkit

Neither of these are strictly speaking regressions
from 2.12, but because they're so simple they seem
worth getting into 3.0 (especially the first one,
which means migration of any v8M system won't work
at all.)

thanks
-- PMM

Peter Maydell (2):
  armv7m_nvic: Fix m-security subsection name
  hw/arm/iotkit: Fix IRQ number for timer1

 hw/arm/iotkit.c       | 2 +-
 hw/intc/armv7m_nvic.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

-- 
2.17.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PATCH for-3.0 1/2] armv7m_nvic: Fix m-security subsection name
  2018-07-27 11:38 [Qemu-devel] [PATCH for-3.0 0/2] MPS/v8M bug fixes Peter Maydell
@ 2018-07-27 11:38 ` Peter Maydell
  2018-07-28 16:42   ` Richard Henderson
  2018-07-27 11:38 ` [Qemu-devel] [PATCH for-3.0 2/2] hw/arm/iotkit: Fix IRQ number for timer1 Peter Maydell
  1 sibling, 1 reply; 5+ messages in thread
From: Peter Maydell @ 2018-07-27 11:38 UTC (permalink / raw)
  To: qemu-arm, qemu-devel; +Cc: patches

The vmstate save/load code insists that subsections of a VMState must
have names which include their parent VMState's name as a leading
substring.  Unfortunately it neither documents this nor checks it on
device init or state save, but instead fails state load with a
confusing error message ("Missing section footer for armv7m_nvic").

Fix the name of the m-security subsection of the NVIC, so that
state save/load works correctly for the security-enabled NVIC.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/intc/armv7m_nvic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c
index 6be7fc5266d..cd1e7f17299 100644
--- a/hw/intc/armv7m_nvic.c
+++ b/hw/intc/armv7m_nvic.c
@@ -2064,7 +2064,7 @@ static int nvic_security_post_load(void *opaque, int version_id)
 }
 
 static const VMStateDescription vmstate_nvic_security = {
-    .name = "nvic/m-security",
+    .name = "armv7m_nvic/m-security",
     .version_id = 1,
     .minimum_version_id = 1,
     .needed = nvic_security_needed,
-- 
2.17.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PATCH for-3.0 2/2] hw/arm/iotkit: Fix IRQ number for timer1
  2018-07-27 11:38 [Qemu-devel] [PATCH for-3.0 0/2] MPS/v8M bug fixes Peter Maydell
  2018-07-27 11:38 ` [Qemu-devel] [PATCH for-3.0 1/2] armv7m_nvic: Fix m-security subsection name Peter Maydell
@ 2018-07-27 11:38 ` Peter Maydell
  2018-07-27 12:05   ` [Qemu-devel] [Qemu-arm] " Philippe Mathieu-Daudé
  1 sibling, 1 reply; 5+ messages in thread
From: Peter Maydell @ 2018-07-27 11:38 UTC (permalink / raw)
  To: qemu-arm, qemu-devel; +Cc: patches

A cut-and-paste error meant we were incorrectly wiring up the timer1
IRQ to IRQ3. IRQ3 is the interrupt for timer0 -- move timer0 to
IRQ4 where it belongs.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/arm/iotkit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/arm/iotkit.c b/hw/arm/iotkit.c
index c76d3ed7435..8cadc8b1608 100644
--- a/hw/arm/iotkit.c
+++ b/hw/arm/iotkit.c
@@ -382,7 +382,7 @@ static void iotkit_realize(DeviceState *dev, Error **errp)
         return;
     }
     sysbus_connect_irq(SYS_BUS_DEVICE(&s->timer1), 0,
-                       qdev_get_gpio_in(DEVICE(&s->armv7m), 3));
+                       qdev_get_gpio_in(DEVICE(&s->armv7m), 4));
     mr = sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->timer1), 0);
     object_property_set_link(OBJECT(&s->apb_ppc0), OBJECT(mr), "port[1]", &err);
     if (err) {
-- 
2.17.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [Qemu-arm] [PATCH for-3.0 2/2] hw/arm/iotkit: Fix IRQ number for timer1
  2018-07-27 11:38 ` [Qemu-devel] [PATCH for-3.0 2/2] hw/arm/iotkit: Fix IRQ number for timer1 Peter Maydell
@ 2018-07-27 12:05   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-07-27 12:05 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-arm, qemu-devel, patches

On 07/27/2018 08:38 AM, Peter Maydell wrote:
> A cut-and-paste error meant we were incorrectly wiring up the timer1
> IRQ to IRQ3. IRQ3 is the interrupt for timer0 -- move timer0 to
> IRQ4 where it belongs.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
(ARM-ECM-0601256 Table 66 Interrupt Map)

> ---
>  hw/arm/iotkit.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/arm/iotkit.c b/hw/arm/iotkit.c
> index c76d3ed7435..8cadc8b1608 100644
> --- a/hw/arm/iotkit.c
> +++ b/hw/arm/iotkit.c
> @@ -382,7 +382,7 @@ static void iotkit_realize(DeviceState *dev, Error **errp)
>          return;
>      }
>      sysbus_connect_irq(SYS_BUS_DEVICE(&s->timer1), 0,
> -                       qdev_get_gpio_in(DEVICE(&s->armv7m), 3));
> +                       qdev_get_gpio_in(DEVICE(&s->armv7m), 4));
>      mr = sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->timer1), 0);
>      object_property_set_link(OBJECT(&s->apb_ppc0), OBJECT(mr), "port[1]", &err);
>      if (err) {
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH for-3.0 1/2] armv7m_nvic: Fix m-security subsection name
  2018-07-27 11:38 ` [Qemu-devel] [PATCH for-3.0 1/2] armv7m_nvic: Fix m-security subsection name Peter Maydell
@ 2018-07-28 16:42   ` Richard Henderson
  0 siblings, 0 replies; 5+ messages in thread
From: Richard Henderson @ 2018-07-28 16:42 UTC (permalink / raw)
  To: Peter Maydell, qemu-arm, qemu-devel; +Cc: patches

On 07/27/2018 04:38 AM, Peter Maydell wrote:
> The vmstate save/load code insists that subsections of a VMState must
> have names which include their parent VMState's name as a leading
> substring.  Unfortunately it neither documents this nor checks it on
> device init or state save, but instead fails state load with a
> confusing error message ("Missing section footer for armv7m_nvic").
> 
> Fix the name of the m-security subsection of the NVIC, so that
> state save/load works correctly for the security-enabled NVIC.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  hw/intc/armv7m_nvic.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-07-28 16:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-27 11:38 [Qemu-devel] [PATCH for-3.0 0/2] MPS/v8M bug fixes Peter Maydell
2018-07-27 11:38 ` [Qemu-devel] [PATCH for-3.0 1/2] armv7m_nvic: Fix m-security subsection name Peter Maydell
2018-07-28 16:42   ` Richard Henderson
2018-07-27 11:38 ` [Qemu-devel] [PATCH for-3.0 2/2] hw/arm/iotkit: Fix IRQ number for timer1 Peter Maydell
2018-07-27 12:05   ` [Qemu-devel] [Qemu-arm] " Philippe Mathieu-Daudé

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.