1. 16 3月, 2016 9 次提交
    • P
      icount: decouple warp calls · e76d1798
      Pavel Dovgalyuk 提交于
      qemu_clock_warp function is called to update virtual clock when CPU
      is sleeping. This function includes replay checkpoint to make execution
      deterministic in icount mode.
      Record/replay module flushes async event queue at checkpoints.
      Some of the events (e.g., block devices operations) include interaction
      with hardware. E.g., APIC polled by block devices sets one of IRQ flags.
      Flag to be set depends on currently executed thread (CPU or iothread).
      Therefore in replay mode we have to process the checkpoints in the same thread
      as they were recorded.
      qemu_clock_warp function (and its checkpoint) may be called from different
      thread. This patch decouples two different execution cases of this function:
      call when CPU is sleeping from iothread and call from cpu thread to update
      virtual clock.
      First task is performed by qemu_start_warp_timer function. It sets warp
      timer event to the moment of nearest pending virtual timer.
      Second function (qemu_account_warp_timer) is called from cpu thread
      before execution of the code. It advances virtual clock by adding the length
      of period while CPU was sleeping.
      Signed-off-by: NPavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
      Message-Id: <20160310115609.4812.44986.stgit@PASHA-ISP>
      [Update docs. - Paolo]
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      e76d1798
    • P
      icount: remove obsolete warp call · 281b2201
      Pavel Dovgalyuk 提交于
      qemu_clock_warp call in qemu_tcg_wait_io_event function is not needed
      anymore, because it is called in every iteration of main_loop_wait.
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NPavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
      Message-Id: <20160310115603.4812.67559.stgit@PASHA-ISP>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      281b2201
    • P
      replay: character devices · 33577b47
      Pavel Dovgalyuk 提交于
      This patch implements record and replay of character devices.
      It records chardevs communication in replay mode. Recorded information
      include data read from backend and counter of bytes written
      from frontend to backend to preserve frontend internal state.
      If character device was configured through the command line in record mode,
      then in replay mode it should be also added to command line. Backend of
      the character device could be changed in replay mode.
      Replaying of devices that perform ioctl and get_msgfd operations is not
      supported.
      gdbstub which also acts as a backend is not recorded to allow controlling
      the replaying through gdb. Monitor backends are also not recorded.
      Signed-off-by: NPavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
      Message-Id: <20160314074436.4980.83856.stgit@PASHA-ISP>
      [Add stubs. - Paolo]
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      33577b47
    • P
      exec: fix early return from ram_block_add · 39c350ee
      Paolo Bonzini 提交于
      After reporting an error, ram_block_add was going on with the registration
      of the RAMBlock.  The visible effect is that it unlocked the ramlist
      mutex twice.
      
      Fixes: 528f46afReviewed-by: NFam Zheng <famz@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      39c350ee
    • M
      exec: Fix memory allocation when memory path isn't on hugetlbfs · e1fb6471
      Markus Armbruster 提交于
      gethugepagesize() works reliably only when its argument is on
      hugetlbfs.  When it's not, it returns the filesystem's "optimal
      transfer block size", which may or may not be the actual page size
      you'll get when you mmap().
      
      If the value is too small or not a power of two, we fail
      qemu_ram_mmap()'s assertions.  These were added in commit 794e8f30
      (v2.5.0).  The bug's impact before that is currently unknown.  Seems
      fairly unlikely at least when the normal page size is 4KiB.
      
      Else, if the value is too large, we align more strictly than
      necessary.
      
      gethugepagesize() goes back to commit c902760f (v0.13).  That commit
      clearly intended gethugepagesize() to be used on hugetlbfs only.  Not
      only was it named accordingly, it also printed a warning when used on
      anything else.  However, the commit neglected to spell out the
      restriction in user documentation of -mem-path.
      
      Commit bfc2a1a1 (v2.5.0) dropped the warning as bogus "because QEMU
      functions perfectly well with the path on a regular tmpfs filesystem".
      It sure does when you're sufficiently lucky.  In my testing, I was
      lucky, too.
      
      Fix by switching to qemu_fd_getpagesize().  Rename the variable
      holding its result from hpagesize to page_size.
      
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <1457378754-21649-3-git-send-email-armbru@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      e1fb6471
    • M
      exec: Fix memory allocation when memory path names new file · fd97fd44
      Markus Armbruster 提交于
      Commit 8d31d6b6 extended file_ram_alloc() to accept file names in
      addition to directory names.  Even though it passes O_CREAT to open(),
      it actually works only for existing files.  Reproducer adapted from
      the commit's qemu-doc.texi update:
      
          $ qemu-system-x86_64 -object memory-backend-file,size=2M,mem-path=/dev/hugepages/my-shmem-file,id=mb1
          qemu-system-x86_64: -object memory-backend-file,size=2M,mem-path=/dev/hugepages/my-shmem-file,id=mb1: failed to get page size of file /dev/hugepages/my-shmem-file: No such file or directory
      
      This is because we first get the page size for @path, then open the
      actual file.  Unwise even before the flawed commit, because the
      directory could change in between, invalidating the page size.
      Unlikely to bite in practice.
      
      Rearrange the code to create the file (if necessary) before getting
      its page size.  Carefully avoid TOCTTOU conditions with a method
      suggested by Paolo Bonzini.
      
      While there, replace "hugepages" by "guest RAM" in error messages,
      because host memory backends can be used for purposes other than huge
      pages, e.g. /dev/shm/ shared memory.  Help text of -mem-path agrees.
      
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <1457378754-21649-2-git-send-email-armbru@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      fd97fd44
    • A
      update-linux-headers: Add userfaultfd.h · 2ae823d4
      Alexey Kardashevskiy 提交于
      userfailtfd.h is used by post-copy migration so include it to
      the update-linux-headers.sh as we want it updated altogether with
      other kernel headers.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Message-Id: <1455512381-15271-1-git-send-email-aik@ozlabs.ru>
      Acked-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      2ae823d4
    • R
      kvm: x86: q35: Add support for -machine kernel_irqchip=split for q35 · b094f2e0
      Rita Sinha 提交于
      The split IRQ chip mode via KVM_CAP_SPLIT_IRQCHIP was introduced with commit
      15eafc2e but was broken for q35. This patch makes kernel_irqchip=split
      functional for q35.
      Signed-off-by: NRita Sinha <rita.sinha89@gmail.com>
      Message-Id: <1457378525-16455-1-git-send-email-rita.sinha89@gmail.com>
      Reviewed-by: NJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      b094f2e0
    • P
      Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging · a58a4cb1
      Peter Maydell 提交于
      vhost, virtio, pci, pc, acpi
      
      nvdimm work
      sparse cpu id rework
      ipmi enhancements
      fixes all over the place
      pxb option to tweak chassis number
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      
      # gpg: Signature made Tue 15 Mar 2016 14:33:10 GMT using RSA key ID D28D5469
      # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>"
      # gpg:                 aka "Michael S. Tsirkin <mst@redhat.com>"
      
      * remotes/mst/tags/for_upstream: (51 commits)
        hw/acpi: fix GSI links UID
        ipmi: add some local variables in ipmi_sdr_init
        ipmi: remove the need of an ending record in the SDR table
        ipmi: use a function to initialize the SDR table
        ipmi: add a realize function to the device class
        ipmi: add rsp_buffer_set_error() helper
        ipmi: remove IPMI_CHECK_RESERVATION() macro
        ipmi: replace IPMI_ADD_RSP_DATA() macro with inline helpers
        ipmi: remove IPMI_CHECK_CMD_LEN() macro
        MAINTAINERS: machine core
        MAINTAINERS: Add an entry for virtio header files
        pc: acpi: clarify why possible LAPIC entries must be present in MADT
        pc: acpi: drop cpu->found_cpus bitmap
        pc: acpi: create Processor and Notify objects only for valid lapics
        pc: acpi: create MADT.lapic entries only for valid lapics
        pc: acpi: SRAT: create only valid processor lapic entries
        pc: acpi: cleanup qdev_get_machine() calls
        machine: introduce MachineClass.possible_cpu_arch_ids() hook
        pc: init pcms->apic_id_limit once and use it throughout pc.c
        pc: acpi: remove NOP assignment
        ...
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      a58a4cb1
  2. 15 3月, 2016 27 次提交
  3. 14 3月, 2016 4 次提交