1. 07 6月, 2016 1 次提交
  2. 02 6月, 2016 1 次提交
  3. 30 3月, 2016 2 次提交
    • S
      Revert "e1000: fix hang of win2k12 shutdown with flood ping" · 8e0f7dd2
      Sameeh Jubran 提交于
      This reverts commit 9596ef7c.
      
      This workaround in order to fix endless interrupts is no
      longer needed because it was superseded by the previous patch
      (e1000: Fixing interrupt pace).
      Signed-off-by: NSameeh Jubran <sameeh@daynix.com>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      8e0f7dd2
    • S
      e1000: Fixing interrupts pace. · 74004e8c
      Sameeh Jubran 提交于
      This patch introduces an upper bound for number of interrupts
      per second. Without this bound an interrupt storm can occur as
      it has been observed on Windows 10 when disabling the device.
      
      According to the SPEC - Intel PCI/PCI-X Family of Gigabit
      Ethernet Controllers Software Developer's Manual, section
      13.4.18 - the Ethernet controller guarantees a maximum
      observable interrupt rate of 7813 interrupts/sec. If there is
      no upper bound this could lead to an interrupt storm by e1000
      (when mit_delay < 500) causing interrupts to fire at a very high
      pace.
      Thus if mit_delay < 500 then the delay should be set to the
      minimum delay possible which is 500. This can be calculated
      easily as follows:
      
      Interval = 10^9 / (7813 * 256) = 500.
      Signed-off-by: NSameeh Jubran <sameeh@daynix.com>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      74004e8c
  4. 04 2月, 2016 1 次提交
    • L
      e1000: eliminate infinite loops on out-of-bounds transfer start · dd793a74
      Laszlo Ersek 提交于
      The start_xmit() and e1000_receive_iov() functions implement DMA transfers
      iterating over a set of descriptors that the guest's e1000 driver
      prepares:
      
      - the TDLEN and RDLEN registers store the total size of the descriptor
        area,
      
      - while the TDH and RDH registers store the offset (in whole tx / rx
        descriptors) into the area where the transfer is supposed to start.
      
      Each time a descriptor is processed, the TDH and RDH register is bumped
      (as appropriate for the transfer direction).
      
      QEMU already contains logic to deal with bogus transfers submitted by the
      guest:
      
      - Normally, the transmit case wants to increase TDH from its initial value
        to TDT. (TDT is allowed to be numerically smaller than the initial TDH
        value; wrapping at or above TDLEN bytes to zero is normal.) The failsafe
        that QEMU currently has here is a check against reaching the original
        TDH value again -- a complete wraparound, which should never happen.
      
      - In the receive case RDH is increased from its initial value until
        "total_size" bytes have been received; preferably in a single step, or
        in "s->rxbuf_size" byte steps, if the latter is smaller. However, null
        RX descriptors are skipped without receiving data, while RDH is
        incremented just the same. QEMU tries to prevent an infinite loop
        (processing only null RX descriptors) by detecting whether RDH assumes
        its original value during the loop. (Again, wrapping from RDLEN to 0 is
        normal.)
      
      What both directions miss is that the guest could program TDLEN and RDLEN
      so low, and the initial TDH and RDH so high, that these registers will
      immediately be truncated to zero, and then never reassume their initial
      values in the loop -- a full wraparound will never occur.
      
      The condition that expresses this is:
      
        xdh_start >= s->mac_reg[XDLEN] / sizeof(desc)
      
      i.e., TDH or RDH start out after the last whole rx or tx descriptor that
      fits into the TDLEN or RDLEN sized area.
      
      This condition could be checked before we enter the loops, but
      pci_dma_read() / pci_dma_write() knows how to fill in buffers safely for
      bogus DMA addresses, so we just extend the existing failsafes with the
      above condition.
      
      This is CVE-2016-1981.
      
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Petr Matousek <pmatouse@redhat.com>
      Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
      Cc: Prasad Pandit <ppandit@redhat.com>
      Cc: Michael Roth <mdroth@linux.vnet.ibm.com>
      Cc: Jason Wang <jasowang@redhat.com>
      Cc: qemu-stable@nongnu.org
      RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1296044Signed-off-by: NLaszlo Ersek <lersek@redhat.com>
      Reviewed-by: NJason Wang <jasowang@redhat.com>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      dd793a74
  5. 29 1月, 2016 1 次提交
  6. 07 12月, 2015 1 次提交
    • D
      e1000: fix hang of win2k12 shutdown with flood ping · 9596ef7c
      Denis V. Lunev 提交于
      e1000 driver in Win2k12 is really well rotten. It 100% hangs on shutdown
      of UP VM under flood ping. The guest checks card state and reinjects
      itself interrupt in a loop. This is fatal for UP machine.
      
      There is no good way to fix this misbehavior but to kludge it. The
      emulation has interrupt throttling register aka ITR which limits
      interrupt rate and allows the guest to proceed this phase.
      There is no problem with this kludge for Linux guests - it adjust the
      value of it itself.
      
      On the other hand according to the initial research in
          commit e9845f09
          Author: Vincenzo Maffione <v.maffione@gmail.com>
          Date:   Fri Aug 2 18:30:52 2013 +0200
      
          e1000: add interrupt mitigation support
      
          ...
      
          Interrupt mitigation boosts performance when the guest suffers from
          an high interrupt rate (i.e. receiving short UDP packets at high packet
          rate). For some numerical results see the following link
          http://info.iet.unipi.it/~luigi/papers/20130520-rizzo-vm.pdf
      
      this should also boost performance a bit.
      
      See https://bugzilla.redhat.com/show_bug.cgi?id=874406 for additional
      details.
      Signed-off-by: NDenis V. Lunev <den@openvz.org>
      CC: Vincenzo Maffione <v.maffione@gmail.com>
      CC: Stefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      9596ef7c
  7. 12 11月, 2015 9 次提交
  8. 12 10月, 2015 1 次提交
  9. 15 9月, 2015 1 次提交
  10. 07 7月, 2015 1 次提交
    • S
      e1000: flush packets when link comes up · 5df6a185
      Stefan Hajnoczi 提交于
      e1000_can_receive() checks the link up status register bit.  If the bit
      is clear, packets will be queued and the peer may disable receive to
      avoid wasting CPU reading packets that cannot be delivered.  The queue
      must be flushed once the link comes back up again.
      
      This patch fixes broken e1000 receive with Mac OS X Snow Leopard guests
      and tap networking.  Flushing the queue invokes the async send callback,
      which re-enables tap fd read.
      Reported-by: NJonathan Liu <net147@gmail.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NFam Zheng <famz@redhat.com>
      Message-id: 1435223885-12745-1-git-send-email-stefanha@redhat.com
      5df6a185
  11. 12 6月, 2015 1 次提交
    • J
      migration: Use normal VMStateDescriptions for Subsections · 5cd8cada
      Juan Quintela 提交于
      We create optional sections with this patch.  But we already have
      optional subsections.  Instead of having two mechanism that do the
      same, we can just generalize it.
      
      For subsections we just change:
      
      - Add a needed function to VMStateDescription
      - Remove VMStateSubsection (after removal of the needed function
        it is just a VMStateDescription)
      - Adjust the whole tree, moving the needed function to the corresponding
        VMStateDescription
      Signed-off-by: NJuan Quintela <quintela@redhat.com>
      5cd8cada
  12. 27 3月, 2015 1 次提交
  13. 26 2月, 2015 1 次提交
  14. 12 1月, 2015 1 次提交
    • P
      net: remove all cleanup methods from NIC NetClientInfos · 57407ea4
      Paolo Bonzini 提交于
      All NICs have a cleanup function that, in most cases, zeroes the pointer
      to the NICState.  In some cases, it frees data belonging to the NIC.
      
      However, this function is never called except when exiting from QEMU.
      It is not necessary to NULL pointers and free data here; the right place
      to do that would be in the device's unrealize function, after calling
      qemu_del_nic.  Zeroing the NIC multiple times is also wrong for multiqueue
      devices.
      
      This cleanup function gets in the way of making the NetClientStates for
      the NIC hold an object_ref reference to the object, so get rid of it.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      57407ea4
  15. 19 12月, 2014 1 次提交
  16. 15 10月, 2014 2 次提交
  17. 18 8月, 2014 1 次提交
  18. 14 8月, 2014 2 次提交
  19. 23 6月, 2014 5 次提交
  20. 16 6月, 2014 1 次提交
  21. 09 6月, 2014 2 次提交
  22. 21 11月, 2013 1 次提交
    • M
      Revert "e1000/rtl8139: update HMP NIC when every bit is written" · 90d131fb
      Michael S. Tsirkin 提交于
      This reverts commit cd5be582.
      Digging into hardware specs shows this does not
      actually make QEMU behave more like hardware:
      
      There are valid arguments backed by the spec to indicate why the version
      of e1000 prior to cd5be582 was more correct: the high byte actually
      includes a valid bit, this is why all guests write it last.
      
      For rtl8139 there's actually a separate undocumented valid bit, but we
      don't implement it yet.
      
      To summarize all the drivers we know about behave in one way
      that allows us to make an assumption about write order and avoid
      spurious, incorrect mac address updates to the monitor.
      
      Let's stick to the tried heuristic for 1.7 and
      possibly revisit for 1.8.
      Reported-by: NVlad Yasevich <vyasevic@redhat.com>
      Reviewed-by: NVlad Yasevich <vyasevic@redhat.com>
      Cc: Amos Kong <akong@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      90d131fb
  23. 07 11月, 2013 1 次提交
  24. 06 11月, 2013 1 次提交