kvm: Avoid COW if KVM MMU is asynchronous

Avi Kivity wrote:
> Suggest wrapping in a function and hiding it deep inside kvm-all.c.
>

Done in v2:

---------->

If the KVM MMU is asynchronous (kernel does not support MMU_NOTIFIER),
we have to avoid COW for the guest memory. Otherwise we risk serious
breakage when guest pages change there physical locations due to COW
after fork. Seen when forking smbd during runtime via -smb.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
3 files changed
tree: d761a5e3bf4b2c4075415c3f880e65baf33856d8
  1. audio/
  2. bsd-user/
  3. darwin-user/
  4. fpu/
  5. gdb-xml/
  6. hw/
  7. keymaps/
  8. linux-user/
  9. pc-bios/
  10. slirp/
  11. target-alpha/
  12. target-arm/
  13. target-cris/
  14. target-i386/
  15. target-m68k/
  16. target-mips/
  17. target-ppc/
  18. target-sh4/
  19. target-sparc/
  20. tcg/
  21. tests/
  22. .gitignore
  23. a.out.h
  24. acl.c
  25. acl.h
  26. aes.c
  27. aes.h
  28. aio.c
  29. alpha-dis.c
  30. alpha.ld
  31. arm-dis.c
  32. arm-semi.c
  33. arm.ld
  34. balloon.h
  35. block-bochs.c
  36. block-cloop.c
  37. block-cow.c
  38. block-dmg.c
  39. block-nbd.c
  40. block-parallels.c
  41. block-qcow.c
  42. block-qcow2.c
  43. block-raw-posix.c
  44. block-raw-win32.c
  45. block-vmdk.c
  46. block-vpc.c
  47. block-vvfat.c
  48. block.c
  49. block.h
  50. block_int.h
  51. bswap.h
  52. bt-host.c
  53. bt-host.h
  54. bt-vhci.c
  55. buffered_file.c
  56. buffered_file.h
  57. cache-utils.c
  58. cache-utils.h
  59. Changelog
  60. cmd.c
  61. cmd.h
  62. cocoa.m
  63. CODING_STYLE
  64. configure
  65. console.c
  66. console.h
  67. COPYING
  68. COPYING.LIB
  69. cpu-all.h
  70. cpu-defs.h
  71. cpu-exec.c
  72. cris-dis.c
  73. curses.c
  74. curses_keys.h
  75. cutils.c
  76. d3des.c
  77. d3des.h
  78. def-helper.h
  79. device_tree.c
  80. device_tree.h
  81. dis-asm.h
  82. disas.c
  83. disas.h
  84. dma-helpers.c
  85. dma.h
  86. dyngen-exec.h
  87. elf.h
  88. elf_ops.h
  89. exec-all.h
  90. exec.c
  91. feature_to_c.sh
  92. gdbstub.c
  93. gdbstub.h
  94. gen-icount.h
  95. host-utils.c
  96. host-utils.h
  97. hostregs_helper.h
  98. hpet.h
  99. hppa-dis.c
  100. hppa.ld
  101. hxtool
  102. i386-dis.c
  103. i386.ld
  104. ia64.ld
  105. keymaps.c
  106. keymaps.h
  107. kqemu.c
  108. kqemu.h
  109. kvm-all.c
  110. kvm.h
  111. libfdt_env.h
  112. LICENSE
  113. loader.c
  114. m68k-dis.c
  115. m68k-semi.c
  116. m68k.ld
  117. MAINTAINERS
  118. Makefile
  119. Makefile.target
  120. migration-exec.c
  121. migration-tcp.c
  122. migration.c
  123. migration.h
  124. mips-dis.c
  125. mips.ld
  126. mipsel.ld
  127. monitor.c
  128. monitor.h
  129. nbd.c
  130. nbd.h
  131. net-checksum.c
  132. net.c
  133. net.h
  134. osdep.c
  135. osdep.h
  136. pci-ids.txt
  137. posix-aio-compat.c
  138. posix-aio-compat.h
  139. ppc-dis.c
  140. ppc.ld
  141. ppc64.ld
  142. qemu-aio.h
  143. qemu-binfmt-conf.sh
  144. qemu-char.c
  145. qemu-char.h
  146. qemu-common.h
  147. qemu-doc.texi
  148. qemu-img.c
  149. qemu-img.texi
  150. qemu-io.c
  151. qemu-lock.h
  152. qemu-log.h
  153. qemu-malloc.c
  154. qemu-nbd.c
  155. qemu-nbd.texi
  156. qemu-options.hx
  157. qemu-sockets.c
  158. qemu-tech.texi
  159. qemu-thread.c
  160. qemu-thread.h
  161. qemu-timer.h
  162. qemu-tool.c
  163. qemu.sasl
  164. qemu_socket.h
  165. readline.c
  166. readline.h
  167. README
  168. rules.mak
  169. s390-dis.c
  170. s390.ld
  171. savevm.c
  172. sdl.c
  173. sdl_keysym.h
  174. sh4-dis.c
  175. softmmu-semi.h
  176. softmmu_defs.h
  177. softmmu_exec.h
  178. softmmu_header.h
  179. softmmu_template.h
  180. sparc-dis.c
  181. sparc.ld
  182. sparc64.ld
  183. sys-queue.h
  184. sysemu.h
  185. tap-win32.c
  186. texi2pod.pl
  187. thunk.c
  188. thunk.h
  189. TODO
  190. translate-all.c
  191. uboot_image.h
  192. usb-bsd.c
  193. usb-linux.c
  194. usb-stub.c
  195. VERSION
  196. vgafont.h
  197. vl.c
  198. vnc-auth-sasl.c
  199. vnc-auth-sasl.h
  200. vnc-auth-vencrypt.c
  201. vnc-auth-vencrypt.h
  202. vnc-tls.c
  203. vnc-tls.h
  204. vnc.c
  205. vnc.h
  206. vnc_keysym.h
  207. vnchextile.h
  208. x86_64.ld
  209. x_keymap.c
  210. x_keymap.h