1. 04 7月, 2017 1 次提交
    • W
      virtio-net: enable configurable tx queue size · 9b02e161
      Wei Wang 提交于
      This patch enables the virtio-net tx queue size to be configurable
      between 256 (the default queue size) and 1024 by the user when the
      vhost-user backend is used.
      
      Currently, the maximum tx queue size for other backends is 512 due
      to the following limitations:
      - QEMU backend: the QEMU backend implementation in some cases may
      send 1024+1 iovs to writev.
      - Vhost_net backend: there are possibilities that the guest sends
      a vring_desc of memory which crosses a MemoryRegion thereby
      generating more than 1024 iovs after translation from guest-physical
      address in the backend.
      Signed-off-by: NWei Wang <wei.w.wang@intel.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      9b02e161
  2. 03 7月, 2017 1 次提交
    • P
      Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20170603' into staging · fd479c60
      Peter Maydell 提交于
      Queued TCG patches
      
      # gpg: Signature made Fri 30 Jun 2017 20:03:53 BST
      # gpg:                using RSA key 0xAD1270CC4DD0279B
      # gpg: Good signature from "Richard Henderson <rth7680@gmail.com>"
      # gpg:                 aka "Richard Henderson <rth@redhat.com>"
      # gpg:                 aka "Richard Henderson <rth@twiddle.net>"
      # Primary key fingerprint: 9CB1 8DDA F8E8 49AD 2AFC  16A4 AD12 70CC 4DD0 279B
      
      * remotes/rth/tags/pull-tcg-20170603:
        tcg: consistently access cpu->tb_jmp_cache atomically
        gen-icount: use tcg_ctx.tcg_env instead of cpu_env
        gen-icount: add missing inline to gen_tb_end
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      fd479c60
  3. 01 7月, 2017 3 次提交
    • E
      tcg: consistently access cpu->tb_jmp_cache atomically · f3ced3c5
      Emilio G. Cota 提交于
      Some code paths can lead to atomic accesses racing with memset()
      on cpu->tb_jmp_cache, which can result in torn reads/writes
      and is undefined behaviour in C11.
      
      These torn accesses are unlikely to show up as bugs, but from code
      inspection they seem possible. For example, tb_phys_invalidate does:
          /* remove the TB from the hash list */
          h = tb_jmp_cache_hash_func(tb->pc);
          CPU_FOREACH(cpu) {
              if (atomic_read(&cpu->tb_jmp_cache[h]) == tb) {
                  atomic_set(&cpu->tb_jmp_cache[h], NULL);
              }
          }
      Here atomic_set might race with a concurrent memset (such as the
      ones scheduled via "unsafe" async work, e.g. tlb_flush_page) and
      therefore we might end up with a torn pointer (or who knows what,
      because we are under undefined behaviour).
      
      This patch converts parallel accesses to cpu->tb_jmp_cache to use
      atomic primitives, thereby bringing these accesses back to defined
      behaviour. The price to pay is to potentially execute more instructions
      when clearing cpu->tb_jmp_cache, but given how infrequently they happen
      and the small size of the cache, the performance impact I have measured
      is within noise range when booting debian-arm.
      
      Note that under "safe async" work (e.g. do_tb_flush) we could use memset
      because no other vcpus are running. However I'm keeping these accesses
      atomic as well to keep things simple and to avoid confusing analysis
      tools such as ThreadSanitizer.
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: NRichard Henderson <rth@twiddle.net>
      Signed-off-by: NEmilio G. Cota <cota@braap.org>
      Message-Id: <1497486973-25845-1-git-send-email-cota@braap.org>
      Signed-off-by: NRichard Henderson <rth@twiddle.net>
      f3ced3c5
    • E
      gen-icount: use tcg_ctx.tcg_env instead of cpu_env · 53f6672b
      Emilio G. Cota 提交于
      We are relying on cpu_env being defined as a global, yet most
      targets (i.e. all but arm/a64) have it defined as a local variable.
      Luckily all of them use the same "cpu_env" name, but really
      compilation shouldn't break if the name of that local variable
      changed.
      
      Fix it by using tcg_ctx.tcg_env, which all targets set in their
      translate_init function. This change also helps paving the way
      for the upcoming "translation loop common to all targets" work.
      Reviewed-by: NRichard Henderson <rth@twiddle.net>
      Signed-off-by: NEmilio G. Cota <cota@braap.org>
      Message-Id: <1497639397-19453-3-git-send-email-cota@braap.org>
      Signed-off-by: NRichard Henderson <rth@twiddle.net>
      53f6672b
    • E
      gen-icount: add missing inline to gen_tb_end · ae06cb46
      Emilio G. Cota 提交于
      Reviewed-by: NRichard Henderson <rth@twiddle.net>
      Signed-off-by: NEmilio G. Cota <cota@braap.org>
      Message-Id: <1497639397-19453-2-git-send-email-cota@braap.org>
      Signed-off-by: NRichard Henderson <rth@twiddle.net>
      ae06cb46
  4. 30 6月, 2017 35 次提交