qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] ef72f7: qed: refuse unaligned zero writes wit


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] ef72f7: qed: refuse unaligned zero writes with a backing f...
Date: Fri, 31 Aug 2012 09:00:09 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: ef72f76e58107bd4096018c3db2912d28249308e
      
https://github.com/qemu/qemu/commit/ef72f76e58107bd4096018c3db2912d28249308e
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2012-08-29 (Wed, 29 Aug 2012)

  Changed paths:
    M block/qed.c

  Log Message:
  -----------
  qed: refuse unaligned zero writes with a backing file

Zero writes have cluster granularity in QED.  Therefore they can only be
used to zero entire clusters.

If the zero write request leaves sectors untouched, zeroing the entire
cluster would obscure the backing file.  Instead return -ENOTSUP, which
is handled by block.c:bdrv_co_do_write_zeroes() and falls back to a
regular write.

The qemu-iotests 034 test cases covers this scenario.

Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 571cd9dcc7f2fee59e47913365ced7781f33c2d3
      
https://github.com/qemu/qemu/commit/571cd9dcc7f2fee59e47913365ced7781f33c2d3
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2012-08-29 (Wed, 29 Aug 2012)

  Changed paths:
    M block/stream.c

  Log Message:
  -----------
  stream: complete early if end of backing file is reached

It is possible to create an image that is larger than its backing file.
Reading beyond the end of the backing file produces zeroes if no writes
have been made to those sectors in the image file.

This patch finishes streaming early when the end of the backing file is
reached.  Without this patch the block job hangs and continually tries
to stream the first sectors beyond the end of the backing file.

To reproduce the hung block job bug:

  $ qemu-img create -f qcow2 backing.qcow2 128M
  $ qemu-img create -f qcow2 -o backing_file=backing.qcow2 image.qcow2 6G
  $ qemu -drive if=virtio,cache=none,file=image.qcow2
  (qemu) block_stream virtio0
  (qemu) info block-jobs

The qemu-iotests 030 streaming test still passes.

Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 774a8850d708aeb6dd6de493c28b374098c1a4c3
      
https://github.com/qemu/qemu/commit/774a8850d708aeb6dd6de493c28b374098c1a4c3
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2012-08-29 (Wed, 29 Aug 2012)

  Changed paths:
    M tests/qemu-iotests/030
    M tests/qemu-iotests/030.out

  Log Message:
  -----------
  qemu-iotests: add backing file smaller than image test case

This new test case checks that streaming completes successfully when the
backing file is smaller than the image file.

Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: da9fbe76a0639c529f9678aabcc052dfe4cd9cc4
      
https://github.com/qemu/qemu/commit/da9fbe76a0639c529f9678aabcc052dfe4cd9cc4
  Author: Gerd Hoffmann <address@hidden>
  Date:   2012-08-31 (Fri, 31 Aug 2012)

  Changed paths:
    M hw/qdev-monitor.c

  Log Message:
  -----------
  fix info qtree indention

Without the patch bus properties are are not in line with the other
properties:

[ ... ]
  dev: fw_cfg, id ""
    ctl_iobase = 0x510
    data_iobase = 0x511
      irq 0
      mmio ffffffffffffffff/0000000000000002
      mmio ffffffffffffffff/0000000000000001
[ ... ]

With the patch applied everything is lined up properly:

[ ... ]
  dev: fw_cfg, id ""
    ctl_iobase = 0x510
    data_iobase = 0x511
    irq 0
    mmio ffffffffffffffff/0000000000000002
    mmio ffffffffffffffff/0000000000000001
[ ... ]

Needed to make the autotest qtree parser happy.

Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: 0132b4b6595423c92f54d7e0b172b5d73aaa8375
      
https://github.com/qemu/qemu/commit/0132b4b6595423c92f54d7e0b172b5d73aaa8375
  Author: Hans de Goede <address@hidden>
  Date:   2012-08-31 (Fri, 31 Aug 2012)

  Changed paths:
    M hw/usb.h
    M hw/usb/core.c
    M hw/usb/hcd-ehci.c
    M hw/usb/hcd-uhci.c

  Log Message:
  -----------
  usb: Halt ep queue en cancel pending packets on a packet error

For controllers which queue up more then 1 packet at a time, we must halt the
ep queue, and inside the controller code cancel all pending packets on an
error.

There are multiple reasons for this:
1) Guests expect the controllers to halt ep queues on error, so that they
get the opportunity to cancel transfers which the scheduled after the failing
one, before processing continues

2) Not cancelling queued up packets after a failed transfer also messes up
the controller state machine, in the case of EHCI causing the following
assert to trigger: "assert(p->qtdaddr == q->qtdaddr)" at hcd-ehci.c:2075

3) For bulk endpoints with pipelining enabled (redirection to a real USB
device), we must cancel all the transfers after this a failed one so that:
a) If they've completed already, they are not processed further causing more
   stalls to be reported, originating from the same failed transfer
b) If still in flight, they are cancelled before the guest does
   a clear stall, otherwise the guest and device can loose sync!

Note this patch only touches the ehci and uhci controller changes, since AFAIK
no other controllers actually queue up multiple transfer. If I'm wrong on this
other controllers need to be updated too!

Also note that this patch was heavily tested with the ehci code, where I had
a reproducer for a device causing a transfer to fail. The uhci code is not
tested with actually failing transfers and could do with a thorough review!

Signed-off-by: Hans de Goede <address@hidden>
Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: e983395d30d1d5bfa0ed3ae9c028c130f7c498cc
      
https://github.com/qemu/qemu/commit/e983395d30d1d5bfa0ed3ae9c028c130f7c498cc
  Author: Gerd Hoffmann <address@hidden>
  Date:   2012-08-31 (Fri, 31 Aug 2012)

  Changed paths:
    M hw/usb.h
    M hw/usb/core.c
    M hw/usb/hcd-ehci.c
    M hw/usb/hcd-musb.c
    M hw/usb/hcd-ohci.c
    M hw/usb/hcd-uhci.c
    M hw/usb/hcd-xhci.c

  Log Message:
  -----------
  usb: unique packet ids

This patch adds IDs to usb packets.  Those IDs are (a) supposed to be
unique for the lifecycle of a packet (from packet setup until the packet
is either completed or canceled) and (b) stable across migration.

uhci, ohci, ehci and xhci use the guest physical address of the transfer
descriptor for this.

musb needs a different approach because there is no transfer descriptor.
But musb also doesn't support pipelining, so we have never more than one
packet per endpoint in flight.  So we go create an ID based on endpoint
and device address.

Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: 7ce86aa1aafaa65e7d3e572873bdf37bdb896f49
      
https://github.com/qemu/qemu/commit/7ce86aa1aafaa65e7d3e572873bdf37bdb896f49
  Author: Hans de Goede <address@hidden>
  Date:   2012-08-31 (Fri, 31 Aug 2012)

  Changed paths:
    M hw/usb/hcd-ehci.c

  Log Message:
  -----------
  ehci: Fix NULL ptr deref when unplugging an USB dev with an iso stream active

Signed-off-by: Hans de Goede <address@hidden>


  Commit: a1c3e4b839f8e7ec7f1792b8a11c63ca845aa021
      
https://github.com/qemu/qemu/commit/a1c3e4b839f8e7ec7f1792b8a11c63ca845aa021
  Author: Hans de Goede <address@hidden>
  Date:   2012-08-31 (Fri, 31 Aug 2012)

  Changed paths:
    M hw/usb/hcd-ehci.c

  Log Message:
  -----------
  ehci: Schedule async-bh when IAAD bit gets set

After the "ehci: Print a warning when a queue unexpectedly contains packets
on cancel" commit. Under certain reproducable conditions I was getting the
following message: "EHCI: Warning queue not empty on queue reset".

After aprox. 8 hours of debugging I've finally found the cause. The Linux EHCI
driver has an IAAD watchdog, to work around certain EHCI hardware sometimes
not acknowledging the doorbell at all. This watchdog has a timeout of 10 ms,
which is less then the time between 2 runs through the async schedule when
async_stepdown is at its highest value.

Thus the watchdog can trigger, after which Linux clears the IAAD bit and
re-uses the QH. IOW we were not properly detecting the unlink of the qh, due
to us missing (ignoring for more then 10 ms) the IAAD command, which triggered
the warning.

Signed-off-by: Hans de Goede <address@hidden>


  Commit: 53dd6f7032ec4898ca8f95356df795a92cd27e09
      
https://github.com/qemu/qemu/commit/53dd6f7032ec4898ca8f95356df795a92cd27e09
  Author: Hans de Goede <address@hidden>
  Date:   2012-08-31 (Fri, 31 Aug 2012)

  Changed paths:
    M hw/usb/hcd-ehci.c

  Log Message:
  -----------
  ehci: Remove unnecessary ehci_flush_qh call

ehci_qh_do_overlay() already calls ehci_flush_qh() before it returns, calling
it twice is useless.

Signed-off-by: Hans de Goede <address@hidden>
Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: 574ef17191f5ec5a3cc4782c1f59dc5eb8279654
      
https://github.com/qemu/qemu/commit/574ef17191f5ec5a3cc4782c1f59dc5eb8279654
  Author: Hans de Goede <address@hidden>
  Date:   2012-08-31 (Fri, 31 Aug 2012)

  Changed paths:
    M hw/usb/hcd-ehci.c

  Log Message:
  -----------
  ehci: simplify ehci_state_executing

ehci_state_executing does not need to check for p->usb_status == USB_RET_ASYNC
or USB_RET_PROCERR, since ehci_execute_complete already does a similar check
and will trigger an assert if either value is encountered.

USB_RET_ASYNC should never be the packet status when execute_complete runs
for obvious reasons, and USB_RET_PROCERR is only used by ehci_state_execute /
ehci_execute not by ehci_state_executing / ehci_execute_complete.

Signed-off-by: Hans de Goede <address@hidden>
Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: c7cdca3b853eed0dd521c43098b6d07bcce24fd1
      
https://github.com/qemu/qemu/commit/c7cdca3b853eed0dd521c43098b6d07bcce24fd1
  Author: Gerd Hoffmann <address@hidden>
  Date:   2012-08-31 (Fri, 31 Aug 2012)

  Changed paths:
    M hw/usb/hcd-ehci.c

  Log Message:
  -----------
  ehci: add ehci_cancel_queue()

Factor out function to cancel all packets of a queue.
No behavior change.

Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: 287fd3f1dd0b2abbd69e58b402e5364b334e95bd
      
https://github.com/qemu/qemu/commit/287fd3f1dd0b2abbd69e58b402e5364b334e95bd
  Author: Gerd Hoffmann <address@hidden>
  Date:   2012-08-31 (Fri, 31 Aug 2012)

  Changed paths:
    M hw/usb/hcd-ehci.c

  Log Message:
  -----------
  ehci: handle TD deactivation of inflight packets

Check the TDs of inflight packets, cancel
packets in case the guest clears the active bit.

Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: adf478342b11cf9f540baf1f387b669210d3bea1
      
https://github.com/qemu/qemu/commit/adf478342b11cf9f540baf1f387b669210d3bea1
  Author: Hans de Goede <address@hidden>
  Date:   2012-08-31 (Fri, 31 Aug 2012)

  Changed paths:
    M hw/usb/hcd-ehci.c

  Log Message:
  -----------
  ehci: Fix interrupt endpoints no longer working

One of the recent changes (likely the addition of queuing support) has broken
interrupt endpoints, this patch fixes this.

Signed-off-by: Hans de Goede <address@hidden>


  Commit: 347e40ffe61b7cc8d4565be476c20acd00611669
      
https://github.com/qemu/qemu/commit/347e40ffe61b7cc8d4565be476c20acd00611669
  Author: Gerd Hoffmann <address@hidden>
  Date:   2012-08-31 (Fri, 31 Aug 2012)

  Changed paths:
    M hw/usb/dev-uas.c

  Log Message:
  -----------
  uas: move transfer kickoff

Kick next scsi transfer from request release callback instead of command
completion callback, otherwise we might get stuck in case scsi_req_unref()
doesn't release the request instantly due to someone else holding a
reference too.

Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: cdedd9d867f2e955e022f07808b10a4a5d383841
      
https://github.com/qemu/qemu/commit/cdedd9d867f2e955e022f07808b10a4a5d383841
  Author: Anthony Liguori <address@hidden>
  Date:   2012-08-31 (Fri, 31 Aug 2012)

  Changed paths:
    M block/qed.c
    M block/stream.c
    M tests/qemu-iotests/030
    M tests/qemu-iotests/030.out

  Log Message:
  -----------
  Merge remote-tracking branch 'kwolf/for-anthony' into staging

* kwolf/for-anthony:
  qemu-iotests: add backing file smaller than image test case
  stream: complete early if end of backing file is reached
  qed: refuse unaligned zero writes with a backing file


  Commit: 23aec6005af30e29180496b434edcc51660ce94e
      
https://github.com/qemu/qemu/commit/23aec6005af30e29180496b434edcc51660ce94e
  Author: Anthony Liguori <address@hidden>
  Date:   2012-08-31 (Fri, 31 Aug 2012)

  Changed paths:
    M hw/qdev-monitor.c
    M hw/usb.h
    M hw/usb/core.c
    M hw/usb/dev-uas.c
    M hw/usb/hcd-ehci.c
    M hw/usb/hcd-musb.c
    M hw/usb/hcd-ohci.c
    M hw/usb/hcd-uhci.c
    M hw/usb/hcd-xhci.c

  Log Message:
  -----------
  Merge remote-tracking branch 'kraxel/usb.61' into staging

* kraxel/usb.61:
  uas: move transfer kickoff
  ehci: Fix interrupt endpoints no longer working
  ehci: handle TD deactivation of inflight packets
  ehci: add ehci_cancel_queue()
  ehci: simplify ehci_state_executing
  ehci: Remove unnecessary ehci_flush_qh call
  ehci: Schedule async-bh when IAAD bit gets set
  ehci: Fix NULL ptr deref when unplugging an USB dev with an iso stream active
  usb: unique packet ids
  usb: Halt ep queue en cancel pending packets on a packet error
  fix info qtree indention


  Commit: 8bd6b06d7b718b3e595aab279699ef3651ce2e48
      
https://github.com/qemu/qemu/commit/8bd6b06d7b718b3e595aab279699ef3651ce2e48
  Author: Stefan Weil <address@hidden>
  Date:   2012-08-31 (Fri, 31 Aug 2012)

  Changed paths:
    M console.c

  Log Message:
  -----------
  console: Fix warning from clang (and potential crash)

ccc-analyzer reports this warning:

console.c:1090:29: warning: Dereference of null pointer
  if (active_console->cursor_timer) {
                      ^

Function console_select allows active_console to be NULL,
but would crash when accessing cursor_timer. Fix this.

Reviewed-by: Jan Kiszka <address@hidden>
Signed-off-by: Stefan Weil <address@hidden>
Signed-off-by: Anthony Liguori <address@hidden>


  Commit: 0232cd355d37e1ef938c3636a0e934da87f3bcc8
      
https://github.com/qemu/qemu/commit/0232cd355d37e1ef938c3636a0e934da87f3bcc8
  Author: Anthony Liguori <address@hidden>
  Date:   2012-08-31 (Fri, 31 Aug 2012)

  Changed paths:
    M VERSION

  Log Message:
  -----------
  Update version to 1.2.0-rc3

Signed-off-by: Anthony Liguori <address@hidden>


Compare: https://github.com/qemu/qemu/compare/b834b5081d62...0232cd355d37

reply via email to

[Prev in Thread] Current Thread [Next in Thread]