1. 21 6月, 2018 3 次提交
  2. 21 11月, 2017 1 次提交
    • P
      exec.c: Factor out before/after actions for notdirty memory writes · 27266271
      Peter Maydell 提交于
      The function notdirty_mem_write() has a sequence of actions
      it has to do before and after the actual business of writing
      data to host RAM to ensure that dirty flags are correctly
      updated and we flush any TCG translations for the region.
      We need to do this also in other places that write directly
      to host RAM, most notably the TCG atomic helper functions.
      Pull out the before and after pieces into their own functions.
      
      We use an API where the prepare function stashes the various
      bits of information about the write into a struct for the
      complete function to use, because in the calls for the atomic
      helpers the place where the complete function will be called
      doesn't have the information to hand.
      
      Cc: qemu-stable@nongnu.org
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-id: 1511201308-23580-2-git-send-email-peter.maydell@linaro.org
      27266271
  3. 15 11月, 2017 1 次提交
  4. 13 11月, 2017 1 次提交
  5. 25 10月, 2017 3 次提交
  6. 18 10月, 2017 2 次提交
  7. 12 10月, 2017 2 次提交
    • P
      exec: simplify address_space_get_iotlb_entry · 076a93d7
      Peter Xu 提交于
      This patch let address_space_get_iotlb_entry() to use the newly
      introduced page_mask parameter in flatview_do_translate(). Then we
      will be sure the IOTLB can be aligned to page mask, also we should
      nicely support huge pages now when introducing a764040c.
      
      Fixes: a764040c ("exec: abstract address_space_do_translate()")
      Signed-off-by: NPeter Xu <peterx@redhat.com>
      Signed-off-by: NMaxime Coquelin <maxime.coquelin@redhat.com>
      Acked-by: NMichael S. Tsirkin <mst@redhat.com>
      Message-Id: <20171010094247.10173-3-maxime.coquelin@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      076a93d7
    • P
      exec: add page_mask for flatview_do_translate · d5e5fafd
      Peter Xu 提交于
      The function is originally used for flatview_space_translate() and what
      we care about most is (xlat, plen) range. However for iotlb requests, we
      don't really care about "plen", but the size of the page that "xlat" is
      located on. While, plen cannot really contain this information.
      
      A simple example to show why "plen" is not good for IOTLB translations:
      
      E.g., for huge pages, it is possible that guest mapped 1G huge page on
      device side that used this GPA range:
      
        0x100000000 - 0x13fffffff
      
      Then let's say we want to translate one IOVA that finally mapped to GPA
      0x13ffffe00 (which is located on this 1G huge page). Then here we'll
      get:
      
        (xlat, plen) = (0x13fffe00, 0x200)
      
      So the IOTLB would be only covering a very small range since from
      "plen" (which is 0x200 bytes) we cannot tell the size of the page.
      
      Actually we can really know that this is a huge page - we just throw the
      information away in flatview_do_translate().
      
      This patch introduced "page_mask" optional parameter to capture that
      page mask info. Also, I made "plen" an optional parameter as well, with
      some comments for the whole function.
      
      No functional change yet.
      Signed-off-by: NPeter Xu <peterx@redhat.com>
      Signed-off-by: NMaxime Coquelin <maxime.coquelin@redhat.com>
      Message-Id: <20171010094247.10173-2-maxime.coquelin@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      d5e5fafd
  8. 11 10月, 2017 1 次提交
  9. 22 9月, 2017 8 次提交
  10. 20 9月, 2017 1 次提交
  11. 01 8月, 2017 1 次提交
    • A
      exec: Add lock parameter to qemu_ram_ptr_length · f5aa69bd
      Anthony PERARD 提交于
      Commit 04bf2526 (exec: use
      qemu_ram_ptr_length to access guest ram) start using qemu_ram_ptr_length
      instead of qemu_map_ram_ptr, but when used with Xen, the behavior of
      both function is different. They both call xen_map_cache, but one with
      "lock", meaning the mapping of guest memory is never released
      implicitly, and the second one without, which means, mapping can be
      release later, when needed.
      
      In the context of address_space_{read,write}_continue, the ptr to those
      mapping should not be locked because it is used immediatly and never
      used again.
      
      The lock parameter make it explicit in which context qemu_ram_ptr_length
      is called.
      Signed-off-by: NAnthony PERARD <anthony.perard@citrix.com>
      Message-Id: <20170726165326.10327-1-anthony.perard@citrix.com>
      Reviewed-by: NStefano Stabellini <sstabellini@kernel.org>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      f5aa69bd
  12. 14 7月, 2017 5 次提交
  13. 04 7月, 2017 2 次提交
  14. 15 6月, 2017 3 次提交
  15. 07 6月, 2017 1 次提交
  16. 26 5月, 2017 1 次提交
  17. 19 5月, 2017 2 次提交
  18. 18 5月, 2017 2 次提交
    • P
      exec: abstract address_space_do_translate() · a764040c
      Peter Xu 提交于
      This function is an abstraction helper for address_space_translate() and
      address_space_get_iotlb_entry(). It does the lookup of address into
      memory region section, then does proper IOMMU translation if necessary.
      Refactor the two existing functions to use it.
      
      This fixes vhost when IOMMU is disabled by guest.
      Tested-by: NMaxime Coquelin <maxime.coquelin@redhat.com>
      Signed-off-by: NPeter Xu <peterx@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      a764040c
    • P
      ramblock: add new hmp command "info ramblock" · be9b23c4
      Peter Xu 提交于
      To dump information about ramblocks. It looks like:
      
      (qemu) info ramblock
                    Block Name    PSize              Offset               Used              Total
                  /objects/mem    2 MiB  0x0000000000000000 0x0000000080000000 0x0000000080000000
                      vga.vram    4 KiB  0x0000000080060000 0x0000000001000000 0x0000000001000000
          /rom@etc/acpi/tables    4 KiB  0x00000000810b0000 0x0000000000020000 0x0000000000200000
                       pc.bios    4 KiB  0x0000000080000000 0x0000000000040000 0x0000000000040000
        0000:00:03.0/e1000.rom    4 KiB  0x0000000081070000 0x0000000000040000 0x0000000000040000
                        pc.rom    4 KiB  0x0000000080040000 0x0000000000020000 0x0000000000020000
          0000:00:02.0/vga.rom    4 KiB  0x0000000081060000 0x0000000000010000 0x0000000000010000
         /rom@etc/table-loader    4 KiB  0x00000000812b0000 0x0000000000001000 0x0000000000001000
            /rom@etc/acpi/rsdp    4 KiB  0x00000000812b1000 0x0000000000001000 0x0000000000001000
      
      Ramblock is something hidden internally in QEMU implementation, and this
      command should only be used by mostly QEMU developers on RAM stuff. It
      is not a command suitable for QMP interface. So only HMP interface is
      provided for it.
      Reviewed-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: NPeter Xu <peterx@redhat.com>
      Message-Id: <1494562661-9063-4-git-send-email-peterx@redhat.com>
      Signed-off-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      be9b23c4