qom/cpu: move tlb_flush to cpu_common_reset

It is a common thing amongst the various cpu reset functions want to
flush the SoftMMU's TLB entries. This is done either by calling
tlb_flush directly or by way of a general memset of the CPU
structure (sometimes both).

This moves the tlb_flush call to the common reset function and
additionally ensures it is only done for the CONFIG_SOFTMMU case and
when tcg is enabled.

In some target cases we add an empty end_of_reset_fields structure to the
target vCPU structure so have a clear end point for any memset which
is resetting value in the structure before CPU_COMMON (where the TLB
structures are).

While this is a nice clean-up in general it is also a precursor for
changes coming to cputlb for MTTCG where the clearing of entries
can't be done arbitrarily across vCPUs. Currently the cpu_reset
function is usually called from the context of another vCPU as the
architectural power up sequence is run. By using the cputlb API
functions we can ensure the right behaviour in the future.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
29 files changed
tree: a2cdd1a75d613b7509e7968cd973c30d383c1186
  1. audio/
  2. backends/
  3. block/
  4. bsd-user/
  5. contrib/
  6. crypto/
  7. default-configs/
  8. disas/
  9. docs/
  10. fpu/
  11. fsdev/
  12. gdb-xml/
  13. hw/
  14. include/
  15. io/
  16. libdecnumber/
  17. linux-headers/
  18. linux-user/
  19. migration/
  20. nbd/
  21. net/
  22. pc-bios/
  23. po/
  24. qapi/
  25. qga/
  26. qobject/
  27. qom/
  28. replay/
  29. roms/
  30. scripts/
  31. slirp/
  32. stubs/
  33. target/
  34. tcg/
  35. tests/
  36. trace/
  37. ui/
  38. util/
  39. .dir-locals.el
  40. .exrc
  41. .gitignore
  42. .gitmodules
  43. .mailmap
  44. .travis.yml
  45. accel.c
  46. aio-posix.c
  47. aio-win32.c
  48. arch_init.c
  49. async.c
  50. atomic_template.h
  51. balloon.c
  52. block.c
  53. blockdev-nbd.c
  54. blockdev.c
  55. blockjob.c
  56. bootdevice.c
  57. bt-host.c
  58. bt-vhci.c
  59. Changelog
  60. CODING_STYLE
  61. configure
  62. COPYING
  63. COPYING.LIB
  64. cpu-exec-common.c
  65. cpu-exec.c
  66. cpus-common.c
  67. cpus.c
  68. cputlb.c
  69. device-hotplug.c
  70. device_tree.c
  71. disas.c
  72. dma-helpers.c
  73. dump.c
  74. exec.c
  75. gdbstub.c
  76. HACKING
  77. hmp-commands-info.hx
  78. hmp-commands.hx
  79. hmp.c
  80. hmp.h
  81. iohandler.c
  82. ioport.c
  83. iothread.c
  84. kvm-all.c
  85. kvm-stub.c
  86. LICENSE
  87. main-loop.c
  88. MAINTAINERS
  89. Makefile
  90. Makefile.objs
  91. Makefile.target
  92. memory.c
  93. memory_ldst.inc.c
  94. memory_mapping.c
  95. module-common.c
  96. monitor.c
  97. numa.c
  98. os-posix.c
  99. os-win32.c
  100. page_cache.c
  101. qapi-schema.json
  102. qdev-monitor.c
  103. qdict-test-data.txt
  104. qemu-bridge-helper.c
  105. qemu-char.c
  106. qemu-doc.texi
  107. qemu-ga.texi
  108. qemu-img-cmds.hx
  109. qemu-img.c
  110. qemu-img.texi
  111. qemu-io-cmds.c
  112. qemu-io.c
  113. qemu-nbd.c
  114. qemu-nbd.texi
  115. qemu-option-trace.texi
  116. qemu-options-wrapper.h
  117. qemu-options.h
  118. qemu-options.hx
  119. qemu-seccomp.c
  120. qemu-tech.texi
  121. qemu-timer.c
  122. qemu.nsi
  123. qemu.sasl
  124. qmp.c
  125. qtest.c
  126. README
  127. replication.c
  128. replication.h
  129. rules.mak
  130. softmmu_template.h
  131. spice-qemu-char.c
  132. tcg-runtime.c
  133. tci.c
  134. thread-pool.c
  135. thunk.c
  136. tpm.c
  137. trace-events
  138. translate-all.c
  139. translate-all.h
  140. translate-common.c
  141. user-exec.c
  142. VERSION
  143. version.rc
  144. vl.c
  145. xen-common-stub.c
  146. xen-common.c
  147. xen-hvm-stub.c
  148. xen-hvm.c
  149. xen-mapcache.c