qemu-e2k/docs/devel
Damien Hedde 310616d367 hw/core/resettable: fix reset level counting
The code for handling the reset level count in the Resettable code
has two issues:

The reset count is only decremented for the 1->0 case.  This means
that if there's ever a nested reset that takes the count to 2 then it
will never again be decremented.  Eventually the count will exceed
the '50' limit in resettable_phase_enter() and QEMU will trip over
the assertion failure.  The repro case in issue 1266 is an example of
this that happens now the SCSI subsystem uses three-phase reset.

Secondly, the count is decremented only after the exit phase handler
is called.  Moving the reset count decrement from "just after" to
"just before" calling the exit phase handler allows
resettable_is_in_reset() to return false during the handler
execution.

This simplifies reset handling in resettable devices.  Typically, a
function that updates the device state will just need to read the
current reset state and not anymore treat the "in a reset-exit
transition" as a special case.

Note that the semantics change to the *_is_in_reset() functions
will have no effect on the current codebase, because only two
devices (hw/char/cadence_uart.c and hw/misc/zynq_sclr.c) currently
call those functions, and in neither case do they do it from the
device's exit phase methed.

Fixes: 4a5fc890 ("scsi: Use device_cold_reset() and bus_cold_reset()")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1266
Signed-off-by: Damien Hedde <damien.hedde@greensocs.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reported-by: Michael Peter <michael.peter@hensoldt-cyber.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20221020142749.3357951-1-peter.maydell@linaro.org
Buglink: https://bugs.launchpad.net/qemu/+bug/1905297
Reported-by: Michael Peter <michael.peter@hensoldt-cyber.com>
[PMM: adjust the docs paragraph changed to get the name of the
 'enter' phase right and to clarify exactly when the count is
 adjusted; rewrite the commit message]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-10-27 10:27:23 +01:00
..
atomics.rst
bitops.rst
blkdebug.txt
blkverify.txt
block-coroutine-wrapper.rst
build-system.rst configure: improve error for ucontext coroutine backend 2022-09-01 07:42:37 +02:00
ci-definitions.rst.inc
ci-jobs.rst.inc docs/devel: clean-up the CI links in the docs 2022-06-01 18:55:04 +01:00
ci-runners.rst.inc
ci.rst docs/devel: clean-up the CI links in the docs 2022-06-01 18:55:04 +01:00
clocks.rst
code-of-conduct.rst
conflict-resolution.rst
control-flow-integrity.rst
decodetree.rst
ebpf_rss.rst
fuzzing.rst ui/cocoa: Run qemu_init in the main thread 2022-09-23 14:36:33 +02:00
index-api.rst docs/devel: drop :hidden: and :includehidden: tags 2022-04-20 16:04:20 +01:00
index-build.rst docs/devel: drop :hidden: and :includehidden: tags 2022-04-20 16:04:20 +01:00
index-internals.rst docs/devel: start documenting writing VirtIO devices 2022-05-16 04:38:40 -04:00
index-process.rst docs/devel: drop :hidden: and :includehidden: tags 2022-04-20 16:04:20 +01:00
index-tcg.rst docs: convert docs/devel/replay page to rst 2022-06-06 09:26:53 +02:00
index.rst docs/devel: drop :hidden: and :includehidden: tags 2022-04-20 16:04:20 +01:00
kconfig.rst * More Meson conversions (0.59.x now required rather than suggested) 2022-02-21 17:24:05 +00:00
loads-stores.rst Replace TARGET_WORDS_BIGENDIAN 2022-04-06 10:50:37 +02:00
lockcnt.txt
memory.rst
migration.rst migration: Remove load_state_old and minimum_version_id_old 2022-03-02 18:20:45 +00:00
modules.rst
multi-process.rst
multi-thread-tcg.rst
multiple-iothreads.txt
qapi-code-gen.rst docs/devel/qapi-code-gen: Belatedly document feature naming rules 2022-05-16 07:29:50 +02:00
qgraph.rst
qom.rst misc: fix commonly doubled up words 2022-08-01 11:58:02 +02:00
qtest.rst tests: move libqtest.h back under qtest/ 2022-05-03 15:16:51 +04:00
rcu.txt
replay.rst docs: move replay docs to docs/system/replay.rst 2022-06-06 09:26:54 +02:00
reset.rst hw/core/resettable: fix reset level counting 2022-10-27 10:27:23 +01:00
s390-dasd-ipl.rst
secure-coding-practices.rst
stable-process.rst
style.rst doc/style: CLang -> Clang 2022-04-21 17:03:51 +04:00
submitting-a-patch.rst Replace 'whitelist' with 'allow' 2022-07-18 20:24:36 +02:00
submitting-a-pull-request.rst
tcg-icount.rst
tcg-plugins.rst docs/devel: document the test plugins 2022-10-06 11:53:40 +01:00
tcg.rst
testing.rst docs/devel: testing: Document writing portable test cases 2022-09-27 20:51:21 +02:00
tracing.rst docs: trace-events-all is installed without renaming 2022-04-21 17:03:51 +04:00
trivial-patches.rst
ui.rst
vfio-migration.rst
virtio-backends.rst docs/devel: start documenting writing VirtIO devices 2022-05-16 04:38:40 -04:00
virtio-migration.txt
writing-monitor-commands.rst monitor: expose monitor_puts to rest of code 2022-10-06 11:53:40 +01:00