1. 17 7月, 2020 11 次提交
  2. 16 7月, 2020 13 次提交
  3. 15 7月, 2020 16 次提交
    • E
      ftgmac100: fix dblac write test · a134321e
      erik-smit 提交于
      The test of the write of the dblac register was testing the old value
      instead of the new value. This would accept the write of an invalid value
      but subsequently refuse any following valid writes.
      Signed-off-by: Nerik-smit <erik.lucas.smit@gmail.com>
      Reviewed-by: NCédric Le Goater <clg@kaod.org>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      a134321e
    • D
      net: detect errors from probing vnet hdr flag for TAP devices · e7b347d0
      Daniel P. Berrange 提交于
      When QEMU sets up a tap based network device backend, it mostly ignores errors
      reported from various ioctl() calls it makes, assuming the TAP file descriptor
      is valid. This assumption can easily be violated when the user is passing in a
      pre-opened file descriptor. At best, the ioctls may fail with a -EBADF, but if
      the user passes in a bogus FD number that happens to clash with a FD number that
      QEMU has opened internally for another reason, a wide variety of errnos may
      result, as the TUNGETIFF ioctl number may map to a completely different command
      on a different type of file.
      
      By ignoring all these errors, QEMU sets up a zombie network backend that will
      never pass any data. Even worse, when QEMU shuts down, or that network backend
      is hot-removed, it will close this bogus file descriptor, which could belong to
      another QEMU device backend.
      
      There's no obvious guaranteed reliable way to detect that a FD genuinely is a
      TAP device, as opposed to a UNIX socket, or pipe, or something else. Checking
      the errno from probing vnet hdr flag though, does catch the big common cases.
      ie calling TUNGETIFF will return EBADF for an invalid FD, and ENOTTY when FD is
      a UNIX socket, or pipe which catches accidental collisions with FDs used for
      stdio, or monitor socket.
      
      Previously the example below where bogus fd 9 collides with the FD used for the
      chardev saw:
      
      $ ./x86_64-softmmu/qemu-system-x86_64 -netdev tap,id=hostnet0,fd=9 \
        -chardev socket,id=charchannel0,path=/tmp/qga,server,nowait \
        -monitor stdio -vnc :0
      qemu-system-x86_64: -netdev tap,id=hostnet0,fd=9: TUNGETIFF ioctl() failed: Inappropriate ioctl for device
      TUNSETOFFLOAD ioctl() failed: Bad address
      QEMU 2.9.1 monitor - type 'help' for more information
      (qemu) Warning: netdev hostnet0 has no peer
      
      which gives a running QEMU with a zombie network backend.
      
      With this change applied we get an error message and QEMU immediately exits
      before carrying on and making a bigger disaster:
      
      $ ./x86_64-softmmu/qemu-system-x86_64 -netdev tap,id=hostnet0,fd=9 \
        -chardev socket,id=charchannel0,path=/tmp/qga,server,nowait \
        -monitor stdio -vnc :0
      qemu-system-x86_64: -netdev tap,id=hostnet0,vhost=on,fd=9: Unable to query TUNGETIFF on FD 9: Inappropriate ioctl for device
      Reported-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Tested-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Message-id: 20171027085548.3472-1-berrange@redhat.com
      [lv: to simplify, don't check on EINVAL with TUNGETIFF as it exists since v2.6.27]
      Signed-off-by: NLaurent Vivier <lvivier@redhat.com>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      e7b347d0
    • L
      net: check if the file descriptor is valid before using it · 894022e6
      Laurent Vivier 提交于
      qemu_set_nonblock() checks that the file descriptor can be used and, if
      not, crashes QEMU. An assert() is used for that. The use of assert() is
      used to detect programming error and the coredump will allow to debug
      the problem.
      
      But in the case of the tap device, this assert() can be triggered by
      a misconfiguration by the user. At startup, it's not a real problem, but it
      can also happen during the hot-plug of a new device, and here it's a
      problem because we can crash a perfectly healthy system.
      
      For instance:
       # ip link add link virbr0 name macvtap0 type macvtap mode bridge
       # ip link set macvtap0 up
       # TAP=/dev/tap$(ip -o link show macvtap0 | cut -d: -f1)
       # qemu-system-x86_64 -machine q35 -device pcie-root-port,id=pcie-root-port-0 -monitor stdio 9<> $TAP
       (qemu) netdev_add type=tap,id=hostnet0,vhost=on,fd=9
       (qemu) device_add driver=virtio-net-pci,netdev=hostnet0,id=net0,bus=pcie-root-port-0
       (qemu) device_del net0
       (qemu) netdev_del hostnet0
       (qemu) netdev_add type=tap,id=hostnet1,vhost=on,fd=9
       qemu-system-x86_64: .../util/oslib-posix.c:247: qemu_set_nonblock: Assertion `f != -1' failed.
       Aborted (core dumped)
      
      To avoid that, add a function, qemu_try_set_nonblock(), that allows to report the
      problem without crashing.
      
      In the same way, we also update the function for vhostfd in net_init_tap_one() and
      for fd in net_init_socket() (both descriptors are provided by the user and can
      be wrong).
      Signed-off-by: NLaurent Vivier <lvivier@redhat.com>
      Reviewed-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      894022e6
    • Z
      qemu-options.hx: Clean up and fix typo for colo-compare · 2b28a7ef
      Zhang Chen 提交于
      Fix some typo and optimized some descriptions.
      Signed-off-by: NZhang Chen <chen.zhang@intel.com>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      2b28a7ef
    • Z
      net/colo-compare.c: Expose compare "max_queue_size" to users · a2e5cb7a
      Zhang Chen 提交于
      This patch allow users to set the "max_queue_size" according
      to their environment.
      Signed-off-by: NZhang Chen <chen.zhang@intel.com>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      a2e5cb7a
    • A
      hw/net: Added CSO for IPv6 · 9a8d9492
      Andrew 提交于
      Added fix for checksum offload for IPv6 if a backend doesn't
      have a virtual header.
      This patch is a part of IPv6 fragmentation.
      Signed-off-by: NAndrew Melnychenko <andrew@daynix.com>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      9a8d9492
    • J
      virtio-net: fix removal of failover device · 65018100
      Juan Quintela 提交于
      If you have a networking device and its virtio failover device, and
      you remove them in this order:
      - virtio device
      - the real device
      
      You get qemu crash.
      See bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1820120
      
      Bug exist on qemu 4.2 and 5.0.
      But in 5.0 don't shows because commit
      77b06bba
      
      somehow papers over it.
      
      CC: Jason Wang <jasowang@redhat.com>
      CC: Michael S. Tsirkin <mst@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Acked-by: NLaurent Vivier <lvivier@redhat.com>
      Signed-off-by: NJuan Quintela <quintela@redhat.com>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      65018100
    • P
      Merge remote-tracking branch 'remotes/philmd-gitlab/tags/mips-next-20200714' into staging · f1d59486
      Peter Maydell 提交于
      MIPS patches for 5.1
      
      - A pair of fixes,
      - Add Huacai Chen as MIPS KVM maintainer,
      - Add Jiaxun Yang as designated MIPS TCG reviewer.
      
      CI jobs results:
      . https://travis-ci.org/github/philmd/qemu/builds/708079271
      . https://gitlab.com/philmd/qemu/-/pipelines/166528104
      . https://cirrus-ci.com/build/6483996878045184
      
      # gpg: Signature made Tue 14 Jul 2020 20:59:58 BST
      # gpg:                using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE
      # gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" [full]
      # Primary key fingerprint: FAAB E75E 1291 7221 DCFD  6BB2 E3E3 2C2C DEAD C0DE
      
      * remotes/philmd-gitlab/tags/mips-next-20200714:
        MAINTAINERS: Adjust MIPS maintainership (add Huacai Chen & Jiaxun Yang)
        target/mips: Fix ADD.S FPU instruction
        target/mips: Remove identical if/else branches
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      f1d59486
    • P
      Merge remote-tracking branch 'remotes/philmd-gitlab/tags/python-next-20200714' into staging · 67320537
      Peter Maydell 提交于
      Python patches for 5.1
      
      - Reduce race conditions on QEMUMachine::shutdown()
      
       1. Remove the "bare except" pattern in the existing shutdown code,
          which can mask problems and make debugging difficult.
       2. Ensure that post-shutdown cleanup is always performed, even when
          graceful termination fails.
       3. Unify cleanup paths such that no matter how the VM is terminated,
          the same functions and steps are always taken to reset the object
          state.
       4. Rewrite shutdown() such that any error encountered when attempting
          a graceful shutdown will be raised as an AbnormalShutdown exception.
          The pythonic idiom is to allow the caller to decide if this is a
          problem or not.
      
      - Modify part of the python/qemu library to comply with:
      
        . mypy --strict
        . pylint
        . flake8
      
      - Script for the TCG Continuous Benchmarking project that uses
        callgrind to dissect QEMU execution into three main phases:
      
        . code generation
        . JIT execution
        . helpers execution
      
      CI jobs results:
      . https://cirrus-ci.com/build/5421349961203712
      . https://gitlab.com/philmd/qemu/-/pipelines/166556001
      . https://travis-ci.org/github/philmd/qemu/builds/708102347
      
      # gpg: Signature made Tue 14 Jul 2020 21:40:05 BST
      # gpg:                using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE
      # gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" [full]
      # Primary key fingerprint: FAAB E75E 1291 7221 DCFD  6BB2 E3E3 2C2C DEAD C0DE
      
      * remotes/philmd-gitlab/tags/python-next-20200714:
        python/qmp.py: add QMPProtocolError
        python/qmp.py: add casts to JSON deserialization
        python/qmp.py: Do not return None from cmd_obj
        python/qmp.py: re-absorb MonitorResponseError
        iotests.py: use qemu.qmp type aliases
        python/qmp.py: Define common types
        python/machine.py: change default wait timeout to 3 seconds
        python/machine.py: re-add sigkill warning suppression
        python/machine.py: split shutdown into hard and soft flavors
        tests/acceptance: Don't test reboot on cubieboard
        tests/acceptance: wait() instead of shutdown() where appropriate
        python/machine.py: Make wait() call shutdown()
        python/machine.py: Add a configurable timeout to shutdown()
        python/machine.py: Prohibit multiple shutdown() calls
        python/machine.py: Perform early cleanup for wait() calls, too
        python/machine.py: Add _early_cleanup hook
        python/machine.py: Close QMP socket in cleanup
        python/machine.py: consolidate _post_shutdown()
        scripts/performance: Add dissect.py script
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      67320537
    • A
      .travis.yml: skip ppc64abi32-linux-user with plugins · 0571d280
      Alex Bennée 提交于
      We actually see failures on threadcount running without plugins:
      
        retry.py -n 1000 -c -- \
          ./ppc64abi32-linux-user/qemu-ppc64abi32 \
          ./tests/tcg/ppc64abi32-linux-user/threadcount
      
      which reports:
      
        0: 978 times (97.80%), avg time 0.270 (0.01 varience/0.08 deviation)
        -6: 21 times (2.10%), avg time 0.336 (0.01 varience/0.12 deviation)
        -11: 1 times (0.10%), avg time 0.502 (0.00 varience/0.00 deviation)
        Ran command 1000 times, 978 passes
      
      But when running with plugins we hit the failure a lot more often:
      
        0: 91 times (91.00%), avg time 0.302 (0.04 varience/0.19 deviation)
        -11: 9 times (9.00%), avg time 0.558 (0.01 varience/0.11 deviation)
        Ran command 100 times, 91 passes
      
      The crash occurs in guest code which is the same in both pass and fail
      cases. However we see various messages reported on the console about
      corrupted memory lists which seems to imply the guest memory allocation
      is corrupted. This lines up with the seg fault being in the guest
      __libc_free function. So we think this is a guest bug which is
      exacerbated by various modes of translation. If anyone has access to
      real hardware to soak test the test case we could prove this properly.
      Signed-off-by: NAlex Bennée <alex.bennee@linaro.org>
      Acked-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Tested-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-Id: <20200714175516.5475-1-alex.bennee@linaro.org>
      0571d280
    • A
      plugins: expand the bb plugin to be thread safe and track per-cpu · 406b53c9
      Alex Bennée 提交于
      While there isn't any easy way to make the inline counts thread safe
      we can ensure the callback based ones are. While we are at it we can
      reduce introduce a new option ("idle") to dump a report of the current
      bb and insn count each time a vCPU enters the idle state.
      Signed-off-by: NAlex Bennée <alex.bennee@linaro.org>
      Reviewed-by: NRobert Foley <robert.foley@linaro.org>
      Cc: Dave Bort <dbort@dbort.com>
      
      Message-Id: <20200713200415.26214-8-alex.bennee@linaro.org>
      406b53c9
    • A
      cputlb: ensure we save the IOTLB data in case of reset · 2f3a57ee
      Alex Bennée 提交于
      Any write to a device might cause a re-arrangement of memory
      triggering a TLB flush and potential re-size of the TLB invalidating
      previous entries. This would cause users of qemu_plugin_get_hwaddr()
      to see the warning:
      
        invalid use of qemu_plugin_get_hwaddr
      
      because of the failed tlb_lookup which should always succeed. To
      prevent this we save the IOTLB data in case it is later needed by a
      plugin doing a lookup.
      Signed-off-by: NAlex Bennée <alex.bennee@linaro.org>
      Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
      Message-Id: <20200713200415.26214-7-alex.bennee@linaro.org>
      2f3a57ee
    • A
      tests/plugins: don't unconditionally add -Wpsabi · 777dddc5
      Alex Bennée 提交于
      Not all compilers support the -Wpsabi (clang-9 in my case). To handle
      this gracefully we pare back the shared build machinery so the
      Makefile is relatively "standalone". We still take advantage of
      config-host.mak as configure has done a bunch of probing for us but
      that is it.
      
      Fixes: bac8d222Signed-off-by: NAlex Bennée <alex.bennee@linaro.org>
      Reviewed-by: NThomas Huth <thuth@redhat.com>
      Message-Id: <20200713200415.26214-6-alex.bennee@linaro.org>
      777dddc5
    • L
      fpu/softfloat: fix up float16 nan recognition · 8cdf9124
      LIU Zhiwei 提交于
      Signed-off-by: NLIU Zhiwei <zhiwei_liu@c-sky.com>
      Signed-off-by: NAlex Bennée <alex.bennee@linaro.org>
      Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
      Message-Id: <20200712234521.3972-2-zhiwei_liu@c-sky.com>
      Message-Id: <20200713200415.26214-5-alex.bennee@linaro.org>
      8cdf9124
    • T
      gitlab-ci/containers: Add missing wildcard where we should look for changes · 6f60a240
      Thomas Huth 提交于
      The tests/docker/* wildcard seems to only match the files that are directly
      in the tests/docker folder - but changes to the files in the directory
      tests/docker/dockerfiles are currently ignored. Seems like we need a
      separate entry to match the files in that folder. With this wildcard added,
      the stages now get re-run successfully when something in the dockerfiles
      has been changed.
      Signed-off-by: NThomas Huth <thuth@redhat.com>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Signed-off-by: NAlex Bennée <alex.bennee@linaro.org>
      Message-Id: <20200713182235.30379-1-thuth@redhat.com>
      6f60a240
    • A
      docker.py: fix fetching of FROM layers · f73e4852
      Alex Bennée 提交于
      This worked on a system that was already bootstrapped because the
      stage 2 images already existed even if they wouldn't be used. What we
      should have pulled down was the FROM line containers first because
      building on gitlab doesn't have the advantage of using our build
      system to build the pre-requisite bits.
      
      We still pull the image we want to build just in case we can use the
      cached data.
      Signed-off-by: NAlex Bennée <alex.bennee@linaro.org>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      Tested-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-Id: <20200713200415.26214-4-alex.bennee@linaro.org>
      f73e4852