1. 29 8月, 2014 1 次提交
  2. 25 8月, 2014 3 次提交
  3. 20 8月, 2014 3 次提交
  4. 19 8月, 2014 2 次提交
  5. 18 8月, 2014 4 次提交
  6. 15 8月, 2014 4 次提交
  7. 14 8月, 2014 4 次提交
  8. 12 8月, 2014 3 次提交
  9. 09 8月, 2014 2 次提交
  10. 07 8月, 2014 1 次提交
  11. 06 8月, 2014 5 次提交
    • S
      cpu-exec: Add sleeping algorithm · c2aa5f81
      Sebastian Tanase 提交于
      The goal is to sleep qemu whenever the guest clock
      is in advance compared to the host clock (we use
      the monotonic clocks). The amount of time to sleep
      is calculated in the execution loop in cpu_exec.
      
      At first, we tried to approximate at each for loop the real time elapsed
      while searching for a TB (generating or retrieving from cache) and
      executing it. We would then approximate the virtual time corresponding
      to the number of virtual instructions executed. The difference between
      these 2 values would allow us to know if the guest is in advance or delayed.
      However, the function used for measuring the real time
      (qemu_clock_get_ns(QEMU_CLOCK_REALTIME)) proved to be very expensive.
      We had an added overhead of 13% of the total run time.
      
      Therefore, we modified the algorithm and only take into account the
      difference between the 2 clocks at the begining of the cpu_exec function.
      During the for loop we try to reduce the advance of the guest only by
      computing the virtual time elapsed and sleeping if necessary. The overhead
      is thus reduced to 3%. Even though this method still has a noticeable
      overhead, it no longer is a bottleneck in trying to achieve a better
      guest frequency for which the guest clock is faster than the host one.
      
      As for the the alignement of the 2 clocks, with the first algorithm
      the guest clock was oscillating between -1 and 1ms compared to the host clock.
      Using the second algorithm we notice that the guest is 5ms behind the host, which
      is still acceptable for our use case.
      
      The tests where conducted using fio and stress. The host machine in an i5 CPU at
      3.10GHz running Debian Jessie (kernel 3.12). The guest machine is an arm versatile-pb
      built with buildroot.
      
      Currently, on our test machine, the lowest icount we can achieve that is suitable for
      aligning the 2 clocks is 6. However, we observe that the IO tests (using fio) are
      slower than the cpu tests (using stress).
      Signed-off-by: NSebastian Tanase <sebastian.tanase@openwide.fr>
      Tested-by: NCamille Bégué <camille.begue@openwide.fr>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      c2aa5f81
    • S
      icount: Add align option to icount · a8bfac37
      Sebastian Tanase 提交于
      The align option is used for activating the align algorithm
      in order to synchronise the host clock and the guest clock.
      Signed-off-by: NSebastian Tanase <sebastian.tanase@openwide.fr>
      Tested-by: NCamille Bégué <camille.begue@openwide.fr>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      a8bfac37
    • S
      icount: Add QemuOpts for icount · 1ad9580b
      Sebastian Tanase 提交于
      Make icount parameter use QemuOpts style options in order
      to easily add other suboptions.
      Signed-off-by: NSebastian Tanase <sebastian.tanase@openwide.fr>
      Tested-by: NCamille Bégué <camille.begue@openwide.fr>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      1ad9580b
    • K
      timer: add cpu_icount_to_ns function. · 3f031313
      KONRAD Frederic 提交于
      This adds cpu_icount_to_ns function which is needed for reverse execution.
      
      It returns the time for a specific instruction.
      Signed-off-by: NKONRAD Frederic <fred.konrad@greensocs.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      3f031313
    • P
      backends: Introduce chr-testdev · 5692399f
      Paolo Bonzini 提交于
      From: Paolo Bonzini <pbonzini@redhat.com>
      
      chr-testdev enables a virtio serial channel to be used for guest
      initiated qemu exits. hw/misc/debugexit already enables guest
      initiated qemu exits, but only for PC targets. chr-testdev supports
      any virtio-capable target. kvm-unit-tests/arm is already making use
      of this backend.
      
      Currently there is a single command implemented, "q".  It takes a
      (prefix) argument for the exit code, thus an exit is implemented by
      writing, e.g. "1q", to the virtio-serial port.
      
      It can be used as:
         $QEMU ... \
           -device virtio-serial-device \
           -device virtserialport,chardev=ctd -chardev testdev,id=ctd
      
      or, use:
         $QEMU ... \
           -device virtio-serial-device \
           -device virtconsole,chardev=ctd -chardev testdev,id=ctd
      
      to bind it to virtio-serial port0.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NAndrew Jones <drjones@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      5692399f
  12. 01 8月, 2014 1 次提交
  13. 29 7月, 2014 3 次提交
    • P
      scsi-block, scsi-generic: implement parse_cdb · 3e7e180a
      Paolo Bonzini 提交于
      The callback lets the bus provide the direction and transfer count
      for passthrough commands, enabling passthrough of vendor-specific
      commands.
      Reviewed-by: NFam Zheng <famz@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      3e7e180a
    • P
      scsi-bus: introduce parse_cdb in SCSIDeviceClass and SCSIBusInfo · ff34c32c
      Paolo Bonzini 提交于
      These callbacks will let devices do their own request parsing, or
      defer it to the bus.  If the bus does not provide an implementation,
      in turn, fall back to the default parsing routine.
      
      Swap the first two arguments to scsi_req_parse, and rename it to
      scsi_req_parse_cdb, for consistency.
      Reviewed-by: NFam Zheng <famz@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      ff34c32c
    • P
      pc: hack for migration compatibility from QEMU 2.0 · 07fb6176
      Paolo Bonzini 提交于
      Changing the ACPI table size causes migration to break, and the memory
      hotplug work opened our eyes on how horribly we were breaking things in
      2.0 already.
      
      The ACPI table size is rounded to the next 4k, which one would think
      gives some headroom.  In practice this is not the case, because the user
      can control the ACPI table size (each CPU adds 97 bytes to the SSDT and
      8 to the MADT) and so some "-smp" values will break the 4k boundary and
      fail to migrate.  Similarly, PCI bridges add ~1870 bytes to the SSDT.
      
      This patch concerns itself with fixing migration from QEMU 2.0.  It
      computes the payload size of QEMU 2.0 and always uses that one.
      The previous patch shrunk the ACPI tables enough that the QEMU 2.0 size
      should always be enough; non-AML tables can change depending on the
      configuration (especially MADT, SRAT, HPET) but they remain the same
      between QEMU 2.0 and 2.1, so we only compute our padding based on the
      sizes of the SSDT and DSDT.
      
      Migration from QEMU 1.7 should work for guests that have a number of CPUs
      other than 12, 13, 14, 54, 55, 56, 97, 98, 139, 140.  It was already
      broken from QEMU 1.7 to QEMU 2.0 in the same way, though.
      
      Even with this patch, QEMU 1.7 and 2.0 have two different ideas of
      "-M pc-i440fx-2.0" when there are PCI bridges.  Igor sent a patch to
      adopt the QEMU 1.7 definition.  I think distributions should apply
      it if they move directly from QEMU 1.7 to 2.1+ without ever packaging
      version 2.0.
      Reviewed-by: NLaszlo Ersek <lersek@redhat.com>
      Tested-by: NIgor Mammedov <imammedo@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      07fb6176
  14. 22 7月, 2014 1 次提交
    • P
      exec: fix migration with devices that use address_space_rw · 6886867e
      Paolo Bonzini 提交于
      Devices that use address_space_rw to write large areas to memory
      (as opposed to address_space_map/unmap) were broken with respect
      to migration since fe680d0d (exec: Limit translation limiting in
      address_space_translate to xen, 2014-05-07).  Such devices include
      IDE CD-ROMs.
      
      The reason is that invalidate_and_set_dirty (called by address_space_rw
      but not address_space_map/unmap) was only setting the dirty bit for
      the first page in the translation.
      
      To fix this, introduce cpu_physical_memory_set_dirty_range_nocode that
      is the same as cpu_physical_memory_set_dirty_range except it does not
      muck with the DIRTY_MEMORY_CODE bitmap.  This function can be used if
      the caller invalidates translations with tb_invalidate_phys_page_range.
      
      There is another difference between cpu_physical_memory_set_dirty_range
      and cpu_physical_memory_set_dirty_flag; the former includes a call
      to xen_modified_memory.  This is handled separately in
      invalidate_and_set_dirty, and is not needed in other callers of
      cpu_physical_memory_set_dirty_range_nocode, so leave it alone.
      
      Just one nit: now that invalidate_and_set_dirty takes care of handling
      multiple pages, there is no need for address_space_unmap to wrap it
      in a loop.  In fact that loop would now be O(n^2).
      Reported-by: NDave Gilbert <dgilbert@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Tested-by: NGerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      6886867e
  15. 18 7月, 2014 2 次提交
  16. 14 7月, 2014 1 次提交