All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] invalid runstate transition: 'prelaunch' -> 'prelaunch'
@ 2016-07-27 19:40 Liviu Ionescu
  2016-07-28 10:22 ` Markus Armbruster
  2016-07-28 10:59 ` Liviu Ionescu
  0 siblings, 2 replies; 3+ messages in thread
From: Liviu Ionescu @ 2016-07-27 19:40 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell

Hi,

I just upgraded GNU ARM Eclipse QEMU to 2.6.0 and ran into a problem.

The console reads:

```
GNU ARM Eclipse 64-bits QEMU v2.6.0 (qemu-system-gnuarmeclipse).
Board: 'STM32F4-Discovery' (ST Discovery kit for STM32F407/417 lines).
Device: 'STM32F407VG' (Cortex-M4 r0p0, MPU), Flash: 1024 kB, RAM: 128 kB.
Command line: 'test' (4 bytes).
Cortex-M4 r0p0 core initialised.
GDB Server listening on: 'tcp::1234'...
Cortex-M4 r0p0 core reset.
... connection accepted from 127.0.0.1.

Execute 'mon system_reset'.

Cortex-M4 r0p0 core reset.
qemu-system-gnuarmeclipse: invalid runstate transition: 'prelaunch' -> 'prelaunch'
```

QEMU is started as a GDB server, and when the GDB client connects (from an Eclipse session), it issues a 'system_reset' command.

The problem occurs in:

```
void runstate_set(RunState new_state)
{
    assert(new_state < RUN_STATE__MAX);

    if (!runstate_valid_transitions[current_run_state][new_state]) {
        error_report("invalid runstate transition: '%s' -> '%s'",
                     RunState_lookup[current_run_state],
                     RunState_lookup[new_state]);
        abort();
    }
    trace_runstate_set(new_state);
    current_run_state = new_state;
}
```

when called from `main_loop_should_exit(void)`:

```
    if (qemu_reset_requested()) {
        pause_all_vcpus();
        qemu_system_reset(VMRESET_REPORT);
        resume_all_vcpus();
        if (!runstate_check(RUN_STATE_RUNNING) &&
                !runstate_check(RUN_STATE_INMIGRATE)) {
            runstate_set(RUN_STATE_PRELAUNCH);
        }
    }
```

I fixed the problem by adding a new transition in the `runstate_transitions_def[]` array:

```
#if defined(CONFIG_GNU_ARM_ECLIPSE)
    { RUN_STATE_PRELAUNCH, RUN_STATE_PRELAUNCH },
#endif /* defined(CONFIG_GNU_ARM_ECLIPSE) */
```

I don't know what these transition states are, but the above missing line might affect other users too.


For completeness, I'm referring to the source files tagged with v2.6.0.


Regards,

Liviu

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

end of thread, other threads:[~2016-07-28 10:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-27 19:40 [Qemu-devel] invalid runstate transition: 'prelaunch' -> 'prelaunch' Liviu Ionescu
2016-07-28 10:22 ` Markus Armbruster
2016-07-28 10:59 ` Liviu Ionescu

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.