1. 09 3月, 2010 5 次提交
  2. 08 3月, 2010 1 次提交
  3. 07 3月, 2010 24 次提交
  4. 06 3月, 2010 1 次提交
  5. 05 3月, 2010 2 次提交
  6. 04 3月, 2010 7 次提交
    • A
      f374e826
    • J
      x86: Extend validity of bsp_to_cpu · 6cb2996c
      Jan Kiszka 提交于
      As we hard-wire the BSP to CPU 0 anyway and cpuid_apic_id equals
      cpu_index, bsp_to_cpu can also be based on the latter directly. This
      will help an early user of it: KVM while initializing mp_state.
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      6cb2996c
    • J
      KVM: x86: Restrict writeback of VCPU state · ea643051
      Jan Kiszka 提交于
      Do not write nmi_pending, sipi_vector, and mpstate unless we at least go
      through a reset. And TSC as well as KVM wallclocks should only be
      written on full sync, otherwise we risk to drop some time on state
      read-modify-write.
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      ea643051
    • J
      KVM: Rework VCPU state writeback API · ea375f9a
      Jan Kiszka 提交于
      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: NJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      ea375f9a
    • J
      KVM: Rework of guest debug state writing · b0b1d690
      Jan Kiszka 提交于
      So far we synchronized any dirty VCPU state back into the kernel before
      updating the guest debug state. This was a tribute to a deficite in x86
      kernels before 2.6.33. But as this is an arch-dependent issue, it is
      better handle in the x86 part of KVM and remove the writeback point for
      generic code. This also avoids overwriting the flushed state later on if
      user space decides to change some more registers before resuming the
      guest.
      
      We furthermore need to reinject guest exceptions via the appropriate
      mechanism. That is KVM_SET_GUEST_DEBUG for older kernels and
      KVM_SET_VCPU_EVENTS for recent ones. Using both mechanisms at the same
      time will cause state corruptions.
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      b0b1d690
    • M
      Add option to use file backed guest memory · c902760f
      Marcelo Tosatti 提交于
      Port qemu-kvm's -mem-path and -mem-prealloc options. These are useful
      for backing guest memory with huge pages via hugetlbfs.
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      CC: john cooper <john.cooper@redhat.com>
      c902760f
    • A
      Allocate memory below 4GB as one chunk · 60e4c631
      Avi Kivity 提交于
      Instead of allocating a separate chunk for the first 640KB and another
      for 1MB+, allocate one large chunk.  This plays well in terms of alignment
      and size with large pages.
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      60e4c631