1. 15 6月, 2018 5 次提交
  2. 04 6月, 2018 1 次提交
    • C
      migration: discard non-migratable RAMBlocks · b895de50
      Cédric Le Goater 提交于
      On the POWER9 processor, the XIVE interrupt controller can control
      interrupt sources using MMIO to trigger events, to EOI or to turn off
      the sources. Priority management and interrupt acknowledgment is also
      controlled by MMIO in the presenter sub-engine.
      
      These MMIO regions are exposed to guests in QEMU with a set of 'ram
      device' memory mappings, similarly to VFIO, and the VMAs are populated
      dynamically with the appropriate pages using a fault handler.
      
      But, these regions are an issue for migration. We need to discard the
      associated RAMBlocks from the RAM state on the source VM and let the
      destination VM rebuild the memory mappings on the new host in the
      post_load() operation just before resuming the system.
      
      To achieve this goal, the following introduces a new RAMBlock flag
      RAM_MIGRATABLE which is updated in the vmstate_register_ram() and
      vmstate_unregister_ram() routines. This flag is then used by the
      migration to identify RAMBlocks to discard on the source. Some checks
      are also performed on the destination to make sure nothing invalid was
      sent.
      
      This change impacts the boston, malta and jazz mips boards for which
      migration compatibility is broken.
      Signed-off-by: NCédric Le Goater <clg@kaod.org>
      Reviewed-by: NJuan Quintela <quintela@redhat.com>
      Reviewed-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: NJuan Quintela <quintela@redhat.com>
      b895de50
  3. 01 6月, 2018 1 次提交
  4. 31 5月, 2018 12 次提交
  5. 09 5月, 2018 3 次提交
    • P
      exec: reintroduce MemoryRegion caching · 48564041
      Paolo Bonzini 提交于
      MemoryRegionCache was reverted to "normal" address_space_* operations
      for 2.9, due to lack of support for IOMMUs.  Reinstate the
      optimizations, caching only the IOMMU translation at address_cache_init
      but not the IOMMU lookup and target AddressSpace translation are not
      cached; now that MemoryRegionCache supports IOMMUs, it becomes more widely
      applicable too.
      
      The inlined fast path is defined in memory_ldst_cached.inc.h, while the
      slow path uses memory_ldst.inc.c as before.  The smaller fast path causes
      a little code size reduction in MemoryRegionCache users:
      
          hw/virtio/virtio.o text size before: 32373
          hw/virtio/virtio.o text size after: 31941
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      48564041
    • P
      exec: extract address_space_translate_iommu, fix page_mask corner case · a411c84b
      Paolo Bonzini 提交于
      This will be used to process IOMMUs in a MemoryRegionCache.  This
      includes a small bugfix, in that the returned page_mask is now
      correctly -1 if the IOMMU memory region maps the entire address
      space directly.  Previously, address_space_get_iotlb_entry would
      return ~TARGET_PAGE_MASK.
      Reviewed-by: NPeter Xu <peterx@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      a411c84b
    • P
      exec: small changes to flatview_do_translate · ad2804d9
      Paolo Bonzini 提交于
      Prepare for extracting the IOMMU part to a separate function.  Mostly
      cosmetic; the only semantic change is that, if there is more than one
      cascaded IOMMU and the second one fails to translate, *plen_out is now
      adjusted according to the page mask of the first IOMMU.
      Reviewed-by: NPeter Xu <peterx@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      ad2804d9
  6. 27 4月, 2018 2 次提交
  7. 03 4月, 2018 1 次提交
  8. 20 3月, 2018 4 次提交
  9. 09 3月, 2018 1 次提交
  10. 06 3月, 2018 5 次提交
  11. 19 2月, 2018 1 次提交
    • M
      mem: add share parameter to memory-backend-ram · 06329cce
      Marcel Apfelbaum 提交于
      Currently only file backed memory backend can
      be created with a "share" flag in order to allow
      sharing guest RAM with other processes in the host.
      
      Add the "share" flag also to RAM Memory Backend
      in order to allow remapping parts of the guest RAM
      to different host virtual addresses. This is needed
      by the RDMA devices in order to remap non-contiguous
      QEMU virtual addresses to a contiguous virtual address range.
      
      Moved the "share" flag to the Host Memory base class,
      modified phys_mem_alloc to include the new parameter
      and a new interface memory_region_init_ram_shared_nomigrate.
      
      There are no functional changes if the new flag is not used.
      Reviewed-by: NEduardo Habkost <ehabkost@redhat.com>
      Signed-off-by: NMarcel Apfelbaum <marcel@redhat.com>
      06329cce
  12. 07 2月, 2018 1 次提交
    • A
      tcg: Replace fprintf(stderr, "*\n" with error_report() · 493d89bf
      Alistair Francis 提交于
      Replace a large number of the fprintf(stderr, "*\n" calls with
      error_report(). The functions were renamed with these commands and then
      compiler issues where manually fixed.
      
      find ./* -type f -exec sed -i \
          'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      find ./* -type f -exec sed -i \
          'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      find ./* -type f -exec sed -i \
          'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      find ./* -type f -exec sed -i \
          'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      find ./* -type f -exec sed -i \
          'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      find ./* -type f -exec sed -i \
          'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      find ./* -type f -exec sed -i \
          'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      find ./* -type f -exec sed -i \
          'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      find ./* -type f -exec sed -i \
          'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      find ./* -type f -exec sed -i \
          'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      find ./* -type f -exec sed -i \
          'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      Signed-off-by: NAlistair Francis <alistair.francis@xilinx.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Peter Crosthwaite <crosthwaite.peter@gmail.com>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Stefan Weil <sw@weilnetz.de>
      
      Conversions that aren't followed by exit() dropped, because they might
      be inappropriate.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-Id: <20180203084315.20497-14-armbru@redhat.com>
      Reviewed-by: NThomas Huth <thuth@redhat.com>
      493d89bf
  13. 19 1月, 2018 1 次提交
    • H
      hostmem-file: add "align" option · 98376843
      Haozhong Zhang 提交于
      When mmap(2) the backend files, QEMU uses the host page size
      (getpagesize(2)) by default as the alignment of mapping address.
      However, some backends may require alignments different than the page
      size. For example, mmap a device DAX (e.g., /dev/dax0.0) on Linux
      kernel 4.13 to an address, which is 4K-aligned but not 2M-aligned,
      fails with a kernel message like
      
      [617494.969768] dax dax0.0: qemu-system-x86: dax_mmap: fail, unaligned vma (0x7fa37c579000 - 0x7fa43c579000, 0x1fffff)
      
      Because there is no common approach to get such alignment requirement,
      we add the 'align' option to 'memory-backend-file', so that users or
      management utils, which have enough knowledge about the backend, can
      specify a proper alignment via this option.
      Signed-off-by: NHaozhong Zhang <haozhong.zhang@intel.com>
      Message-Id: <20171211072806.2812-2-haozhong.zhang@intel.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      [ehabkost: fixed typo, fixed error_setg() format string]
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      98376843
  14. 16 1月, 2018 2 次提交
    • P
      cpu: flush TB cache when loading VMState · 15a356c4
      Pavel Dovgalyuk 提交于
      Flushing TB cache is required because TBs key in the cache may match
      different code which existed in the previous state.
      Signed-off-by: NPavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
      Signed-off-by: NMaria Klimushenkova <maria.klimushenkova@ispras.ru>
      Message-Id: <20180110134846.12940.99993.stgit@pasha-VirtualBox>
      [Add comment suggested by Peter Maydell. - Paolo]
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NPavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
      15a356c4
    • D
      find_ram_offset: Align ram_addr_t allocation on long boundaries · 801110ab
      Dr. David Alan Gilbert 提交于
      The dirty bitmaps are built from 'long's and there is fast-path code
      for synchronising the case where the RAMBlock is aligned to the start
      of a long boundary.  Align the allocation to this boundary
      to cause the fast path to be used.
      
      Offsets before change:
      11398@1515169675.018566:find_ram_offset size: 0x1e0000 @ 0x8000000
      11398@1515169675.020064:find_ram_offset size: 0x20000 @ 0x81e0000
      11398@1515169675.020244:find_ram_offset size: 0x20000 @ 0x8200000
      11398@1515169675.024343:find_ram_offset size: 0x1000000 @ 0x8220000
      11398@1515169675.025154:find_ram_offset size: 0x10000 @ 0x9220000
      11398@1515169675.027682:find_ram_offset size: 0x40000 @ 0x9230000
      11398@1515169675.032921:find_ram_offset size: 0x200000 @ 0x9270000
      11398@1515169675.033307:find_ram_offset size: 0x1000 @ 0x9470000
      11398@1515169675.033601:find_ram_offset size: 0x1000 @ 0x9471000
      
      after change:
      10923@1515169108.818245:find_ram_offset size: 0x1e0000 @ 0x8000000
      10923@1515169108.819410:find_ram_offset size: 0x20000 @ 0x8200000
      10923@1515169108.819587:find_ram_offset size: 0x20000 @ 0x8240000
      10923@1515169108.823708:find_ram_offset size: 0x1000000 @ 0x8280000
      10923@1515169108.824503:find_ram_offset size: 0x10000 @ 0x9280000
      10923@1515169108.827093:find_ram_offset size: 0x40000 @ 0x92c0000
      10923@1515169108.833045:find_ram_offset size: 0x200000 @ 0x9300000
      10923@1515169108.833504:find_ram_offset size: 0x1000 @ 0x9500000
      10923@1515169108.833787:find_ram_offset size: 0x1000 @ 0x9540000
      Suggested-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Message-Id: <20180105170138.23357-3-dgilbert@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      801110ab