Jan Kiszka ea375f9ab8 KVM: Rework VCPU state writeback API
This grand cleanup drops all reset and vmsave/load related
synchronization points in favor of four(!) generic hooks:

- cpu_synchronize_all_states in qemu_savevm_state_complete
  (initial sync from kernel before vmsave)
- cpu_synchronize_all_post_init in qemu_loadvm_state
  (writeback after vmload)
- cpu_synchronize_all_post_init in main after machine init
- cpu_synchronize_all_post_reset in qemu_system_reset
  (writeback after system reset)

These writeback points + the existing one of VCPU exec after
cpu_synchronize_state map on three levels of writeback:

- KVM_PUT_RUNTIME_STATE (during runtime, other VCPUs continue to run)
- KVM_PUT_RESET_STATE   (on synchronous system reset, all VCPUs stopped)
- KVM_PUT_FULL_STATE    (on init or vmload, all VCPUs stopped as well)

This level is passed to the arch-specific VCPU state writing function
that will decide which concrete substates need to be written. That way,
no writer of load, save or reset functions that interact with in-kernel
KVM states will ever have to worry about synchronization again. That
also means that a lot of reasons for races, segfaults and deadlocks are
eliminated.

cpu_synchronize_state remains untouched, just as Anthony suggested. We
continue to need it before reading or writing of VCPU states that are
also tracked by in-kernel KVM subsystems.

Consequently, this patch removes many cpu_synchronize_state calls that
are now redundant, just like remaining explicit register syncs.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2010-03-04 00:29:28 -03:00
..
2010-02-20 08:29:17 +00:00
2009-11-19 16:45:21 +00:00
2009-12-23 16:35:00 +02:00
2009-12-23 16:35:00 +02:00
2009-10-01 16:12:16 -05:00
2010-02-22 21:23:11 +00:00
2010-03-04 00:29:28 -03:00
2009-11-19 16:45:21 +00:00
2009-11-19 16:45:21 +00:00
2009-11-19 16:45:21 +00:00
2009-11-13 04:04:18 +00:00
2009-10-01 16:12:16 -05:00
2009-11-19 16:45:21 +00:00
2009-10-07 08:54:54 -05:00
2009-12-02 08:57:42 -06:00
2009-11-22 21:27:40 +00:00
2009-11-22 21:27:40 +00:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-12-02 08:57:42 -06:00
2009-10-01 16:12:16 -05:00
2009-11-09 08:43:03 -06:00
2010-02-14 09:01:14 +00:00
2010-02-07 19:28:32 +00:00
2009-10-27 12:28:41 -05:00
2009-11-16 17:06:43 +00:00
2009-10-01 16:12:16 -05:00
2009-11-22 21:27:40 +00:00
2009-10-01 16:12:16 -05:00
2010-01-19 16:31:02 -06:00
2009-12-04 20:44:44 +00:00
2009-10-01 16:12:16 -05:00
2010-02-07 08:05:47 +00:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-12-03 09:41:32 -06:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-12 09:42:31 -05:00
2009-10-01 16:12:16 -05:00
2010-02-07 09:13:51 +00:00
2010-02-07 09:01:18 +00:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2010-02-07 09:15:26 +00:00
2010-02-07 09:15:26 +00:00
2009-10-01 16:12:16 -05:00
2010-02-05 18:48:36 +00:00
2010-02-07 02:03:50 +03:00
2009-10-01 16:12:16 -05:00
2009-09-10 19:48:00 +04:00
2010-02-07 02:03:50 +03:00
2009-12-02 17:26:19 +01:00
2009-10-05 09:32:39 -05:00
2009-09-11 11:10:06 -05:00
2009-10-01 16:12:16 -05:00
2009-10-07 08:54:54 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-12-21 15:06:59 +00:00
2010-02-07 08:05:03 +00:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-12-03 09:41:32 -06:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-11-09 08:43:03 -06:00
2010-02-07 09:01:18 +00:00
2009-11-14 01:11:27 +01:00
2009-11-15 23:04:20 +01:00
2009-10-01 16:12:16 -05:00
2009-12-03 09:41:33 -06:00
2009-11-19 16:45:21 +00:00
2009-12-23 16:35:00 +02:00
2009-09-11 10:19:48 -05:00
2009-09-11 10:19:48 -05:00
2009-10-01 16:12:16 -05:00
2010-01-15 00:06:16 +01:00
2009-12-04 20:44:44 +00:00
2009-12-03 09:41:31 -06:00
2009-12-02 08:57:42 -06:00
2010-02-07 08:05:03 +00:00
2009-11-22 21:27:40 +00:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-12-19 16:04:52 +01:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2010-03-04 00:28:41 -03:00
2010-03-01 03:29:21 +00:00
2010-02-14 16:10:53 +02:00
2010-02-14 16:10:53 +02:00
2010-02-14 16:10:54 +02:00
2009-12-23 16:35:00 +02:00
2010-02-13 07:37:11 +00:00
2010-02-14 16:10:53 +02:00
2009-12-04 20:44:44 +00:00
2009-12-03 09:41:31 -06:00
2010-01-27 13:01:53 +01:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2010-02-22 20:42:51 +00:00
2009-10-01 16:12:16 -05:00
2009-12-21 16:03:03 +01:00
2009-10-01 16:12:16 -05:00
2009-12-21 16:03:03 +01:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2010-02-14 16:10:54 +02:00
2009-12-21 16:03:03 +01:00
2009-10-01 16:12:16 -05:00
2009-11-13 04:04:18 +00:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-05 09:32:38 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2010-02-19 15:53:54 -06:00
2010-02-03 12:39:01 -06:00
2010-02-08 12:21:03 +01:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-12-21 20:19:12 +00:00
2009-12-03 09:41:40 -06:00
2010-02-10 16:53:54 -06:00
2010-02-10 16:53:25 -06:00
2009-12-18 23:23:56 +01:00
2009-10-01 16:12:16 -05:00
2010-02-09 21:07:03 +01:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2010-01-24 14:28:21 +00:00
2010-01-14 16:15:50 +01:00
2009-09-20 14:58:02 +00:00
2009-12-03 09:41:33 -06:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-07 08:54:54 -05:00
2010-02-07 08:05:03 +00:00
2009-10-01 16:12:16 -05:00
2010-02-07 08:05:03 +00:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-07 08:54:54 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-12-04 20:44:44 +00:00
2010-02-14 16:10:54 +02:00
2010-02-25 13:29:06 +00:00
2010-02-19 15:32:16 -06:00
2009-12-18 23:23:56 +01:00
2010-02-25 13:29:06 +00:00
2010-02-25 13:29:06 +00:00
2010-02-07 02:03:50 +03:00
2010-02-25 13:29:06 +00:00
2010-02-10 12:45:11 -06:00
2009-12-18 11:26:28 -06:00
2010-02-14 16:10:54 +02:00
2009-10-27 12:28:55 -05:00
2010-01-13 17:14:15 -06:00
2010-02-10 16:53:54 -06:00
2010-02-10 16:53:54 -06:00
2010-02-10 16:53:25 -06:00
2010-02-03 19:47:34 -02:00
2009-09-12 07:36:22 +00:00
2009-09-20 08:02:28 +00:00
2009-12-02 08:57:43 -06:00
2010-01-26 14:59:20 -06:00
2009-10-01 16:12:16 -05:00
2009-12-03 09:41:34 -06:00
2009-06-13 16:18:31 +03:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00