qemu-patch-raspberry4/scripts
Peter Maydell 781c67ca55 cpu: Use DeviceClass reset instead of a special CPUClass reset
The CPUClass has a 'reset' method.  This is a legacy from when
TYPE_CPU used not to inherit from TYPE_DEVICE.  We don't need it any
more, as we can simply use the TYPE_DEVICE reset.  The 'cpu_reset()'
function is kept as the API which most places use to reset a CPU; it
is now a wrapper which calls device_cold_reset() and then the
tracepoint function.

This change should not cause CPU objects to be reset more often
than they are at the moment, because:
 * nobody is directly calling device_cold_reset() or
   qdev_reset_all() on CPU objects
 * no CPU object is on a qbus, so they will not be reset either
   by somebody calling qbus_reset_all()/bus_cold_reset(), or
   by the main "reset sysbus and everything in the qbus tree"
   reset that most devices are reset by

Note that this does not change the need for each machine or whatever
to use qemu_register_reset() to arrange to call cpu_reset() -- that
is necessary because CPU objects are not on any qbus, so they don't
get reset when the qbus tree rooted at the sysbus bus is reset, and
this isn't being changed here.

All the changes to the files under target/ were made using the
included Coccinelle script, except:

(1) the deletion of the now-inaccurate and not terribly useful
"CPUClass::reset" comments was done with a perl one-liner afterwards:
  perl -n -i -e '/ CPUClass::reset/ or print' target/*/*.c

(2) this bit of the s390 change was done by hand, because the
Coccinelle script is not sophisticated enough to handle the
parent_reset call being inside another function:

| @@ -96,8 +96,9 @@ static void s390_cpu_reset(CPUState *s, cpu_reset_type type)
|     S390CPU *cpu = S390_CPU(s);
|     S390CPUClass *scc = S390_CPU_GET_CLASS(cpu);
|     CPUS390XState *env = &cpu->env;
|+    DeviceState *dev = DEVICE(s);
|
|-    scc->parent_reset(s);
|+    scc->parent_reset(dev);
|     cpu->env.sigp_order = 0;
|     s390_cpu_set_state(S390_CPU_STATE_STOPPED, cpu);

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20200303100511.5498-1-peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2020-03-17 19:48:10 -04:00
..
coccinelle cpu: Use DeviceClass reset instead of a special CPUClass reset 2020-03-17 19:48:10 -04:00
kvm drop "from __future__ import print_function" 2020-02-07 15:15:16 +01:00
modules drop "from __future__ import print_function" 2020-02-07 15:15:16 +01:00
qapi qemu-storage-daemon: Add --monitor option 2020-03-06 17:21:28 +01:00
qemu-guest-agent qemu-guest-agent: freeze-hook to ignore dpkg files as well 2018-08-23 18:46:25 +02:00
qemugdb scripts/qemugdb: re-license timers.py to GPLv2 or later 2019-03-12 08:04:22 +01:00
qmp drop "from __future__ import print_function" 2020-02-07 15:15:16 +01:00
tracetool scripts/tracetool: Remove shebang header 2020-02-07 15:12:48 +01:00
travis travis: add gcovr summary for GCOV build 2018-07-05 15:59:41 +01:00
analyse-9p-simpletrace.py drop "from __future__ import print_function" 2020-02-07 15:15:16 +01:00
analyse-locks-simpletrace.py drop "from __future__ import print_function" 2020-02-07 15:15:16 +01:00
analyze-inclusions Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
analyze-migration.py analyze-migration.py: replace numpy with python 3.2 2019-12-16 10:59:50 -05:00
archive-source.sh archive-source: also create a stash for submodules 2019-07-23 15:53:25 +01:00
checkpatch.pl softmmu: move vl.c to softmmu/ 2020-02-22 08:26:47 +00:00
clean-header-guards.pl scripts/clean-header-guards: Fix handling of trailing comments 2019-06-12 13:20:20 +02:00
clean-includes scripts/clean-includes: added duplicate #include check 2016-10-28 18:17:23 +03:00
cleanup-trace-events.pl scripts/cleanup-trace-events: Update for current practice 2019-03-22 16:18:07 +00:00
cocci-macro-file.h QEMU_PACKED: Remove gcc_struct attribute in Windows non x86 targets 2019-05-07 12:55:02 +01:00
coverity-model.c coverity-model: Fix replay_get_byte() 2018-07-05 15:09:52 +02:00
create_config create_config: remove $(CONFIG_SOFTMMU) hack 2019-07-15 20:58:37 +02:00
decodetree.py scripts: Explicit usage of Python 3 (scripts with __main__) 2020-02-07 15:12:48 +01:00
device-crash-test drop "from __future__ import print_function" 2020-02-07 15:15:16 +01:00
disas-objdump.pl scripts: Switch to more portable Perl shebang 2017-05-10 10:19:24 +03:00
dump-guest-memory.py drop "from __future__ import print_function" 2020-02-07 15:15:16 +01:00
extract-vsssdk-headers Add a script to extract VSS SDK headers on POSIX system 2013-09-09 14:17:56 -05:00
feature_to_c.sh scripts: Use $(..) instead of deprecated .. 2016-06-07 18:19:23 +03:00
fix-multiline-comments.sh scripts: add script to convert multiline comments into 4-line format 2019-01-11 15:46:55 +01:00
get_maintainer.pl softmmu: move vl.c to softmmu/ 2020-02-22 08:26:47 +00:00
git-submodule.sh git: Make submodule check only needed modules 2020-02-13 11:31:58 +01:00
git.orderfile maint: Include top-level *.rst files early in git diff 2020-03-09 15:59:31 +01:00
hxtool hxtool: Remove Texinfo generation support 2020-03-12 11:14:05 +00:00
hxtool-conv.pl scripts/hxtool-conv: Archive script used in qemu-options.hx conversion 2020-03-06 10:05:24 +00:00
kernel-doc docs: tweak kernel-doc for QEMU coding standards 2019-12-17 19:36:57 +01:00
make-release make-release: pull in edk2 submodules so we can build it from tarballs 2019-10-07 14:54:45 +02:00
minikconf.py * various small fixes and cleanups 2020-02-13 13:40:59 +00:00
qapi-gen.py drop "from __future__ import print_function" 2020-02-07 15:15:16 +01:00
qemu-binfmt-conf.sh scripts/qemu-binfmt-conf: Update for sparc64 2019-11-06 13:28:27 +01:00
qemu-gdb.py qemugdb: fix licensing 2019-03-11 16:55:52 +01:00
qemu-trace-stap trace: update qemu-trace-stap to Python 3 2020-01-13 16:42:20 +00:00
refresh-pxe-roms.sh roms: rewrite scripts/refresh-pxe-roms.sh 2013-09-30 09:44:35 +02:00
render_block_graph.py scripts: Explicit usage of Python 3 (scripts with __main__) 2020-02-07 15:12:48 +01:00
replay-dump.py drop "from __future__ import print_function" 2020-02-07 15:15:16 +01:00
shaderinclude.pl scripts: Switch to more portable Perl shebang 2017-05-10 10:19:24 +03:00
show-fixed-bugs.sh show-fixed-bugs.sh: Modern shell scripting (use $() instead of ``) 2018-10-16 18:34:19 +02:00
signrom.py drop "from __future__ import print_function" 2020-02-07 15:15:16 +01:00
simpletrace.py drop "from __future__ import print_function" 2020-02-07 15:15:16 +01:00
switch-timer-api scripts: Switch to more portable Perl shebang 2017-05-10 10:19:24 +03:00
tap-driver.pl tap: flush STDOUT on newline 2019-02-05 16:50:16 +01:00
tap-merge.pl tap: flush STDOUT on newline 2019-02-05 16:50:16 +01:00
texi2pod.pl texi2pod: parse @include directives outside "@c man" blocks 2020-03-06 10:04:57 +00:00
tracetool.py scripts: Explicit usage of Python 3 (scripts with __main__) 2020-02-07 15:12:48 +01:00
update-linux-headers.sh virtiofsd: Pull in kernel's fuse.h 2020-01-23 16:41:36 +00:00
vmstate-static-checker.py drop "from __future__ import print_function" 2020-02-07 15:15:16 +01:00