<feed xmlns='http://www.w3.org/2005/Atom'>
<title>bwlp/qemu.git/hw/scsi, branch spice_video_codecs</title>
<subtitle>Experimental fork of QEMU with video encoding patches</subtitle>
<id>https://git.openslx.org/bwlp/qemu.git/atom/hw/scsi?h=spice_video_codecs</id>
<link rel='self' href='https://git.openslx.org/bwlp/qemu.git/atom/hw/scsi?h=spice_video_codecs'/>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/'/>
<updated>2022-12-01T07:30:04+00:00</updated>
<entry>
<title>vhost: enable vrings in vhost_dev_start() for vhost-user devices</title>
<updated>2022-12-01T07:30:04+00:00</updated>
<author>
<name>Stefano Garzarella</name>
</author>
<published>2022-11-30T11:24:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=4daa5054c599c8aec70f1264a01341a15921c145'/>
<id>urn:sha1:4daa5054c599c8aec70f1264a01341a15921c145</id>
<content type='text'>
Commit 02b61f38d3 ("hw/virtio: incorporate backend features in features")
properly negotiates VHOST_USER_F_PROTOCOL_FEATURES with the vhost-user
backend, but we forgot to enable vrings as specified in
docs/interop/vhost-user.rst:

    If ``VHOST_USER_F_PROTOCOL_FEATURES`` has not been negotiated, the
    ring starts directly in the enabled state.

    If ``VHOST_USER_F_PROTOCOL_FEATURES`` has been negotiated, the ring is
    initialized in a disabled state and is enabled by
    ``VHOST_USER_SET_VRING_ENABLE`` with parameter 1.

Some vhost-user front-ends already did this by calling
vhost_ops.vhost_set_vring_enable() directly:
- backends/cryptodev-vhost.c
- hw/net/virtio-net.c
- hw/virtio/vhost-user-gpio.c

But most didn't do that, so we would leave the vrings disabled and some
backends would not work. We observed this issue with the rust version of
virtiofsd [1], which uses the event loop [2] provided by the
vhost-user-backend crate where requests are not processed if vring is
not enabled.

Let's fix this issue by enabling the vrings in vhost_dev_start() for
vhost-user front-ends that don't already do this directly. Same thing
also in vhost_dev_stop() where we disable vrings.

[1] https://gitlab.com/virtio-fs/virtiofsd
[2] https://github.com/rust-vmm/vhost/blob/240fc2966/crates/vhost-user-backend/src/event_loop.rs#L217

Fixes: 02b61f38d3 ("hw/virtio: incorporate backend features in features")
Reported-by: German Maglione &lt;gmaglione@redhat.com&gt;
Tested-by: German Maglione &lt;gmaglione@redhat.com&gt;
Signed-off-by: Stefano Garzarella &lt;sgarzare@redhat.com&gt;
Acked-by: Raphael Norwitz &lt;raphael.norwitz@nutanix.com&gt;
Message-Id: &lt;20221123131630.52020-1-sgarzare@redhat.com&gt;
Signed-off-by: Alex Bennée &lt;alex.bennee@linaro.org&gt;
Reviewed-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Message-Id: &lt;20221130112439.2527228-3-alex.bennee@linaro.org&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>vhost: mask VIRTIO_F_RING_RESET for vhost and vhost-user devices</title>
<updated>2022-11-22T10:19:00+00:00</updated>
<author>
<name>Stefano Garzarella</name>
</author>
<published>2022-11-21T10:11:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=562a7d23bf9a2f978cea799af40a1b2b0b4fc71b'/>
<id>urn:sha1:562a7d23bf9a2f978cea799af40a1b2b0b4fc71b</id>
<content type='text'>
Commit 69e1c14aa2 ("virtio: core: vq reset feature negotation support")
enabled VIRTIO_F_RING_RESET by default for all virtio devices.

This feature is not currently emulated by QEMU, so for vhost and
vhost-user devices we need to make sure it is supported by the offloaded
device emulation (in-kernel or in another process).
To do this we need to add VIRTIO_F_RING_RESET to the features bitmap
passed to vhost_get_features(). This way it will be masked if the device
does not support it.

This issue was initially discovered with vhost-vsock and vhost-user-vsock,
and then also tested with vhost-user-rng which confirmed the same issue.
They fail when sending features through VHOST_SET_FEATURES ioctl or
VHOST_USER_SET_FEATURES message, since VIRTIO_F_RING_RESET is negotiated
by the guest (Linux &gt;= v6.0), but not supported by the device.

Fixes: 69e1c14aa2 ("virtio: core: vq reset feature negotation support")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1318
Signed-off-by: Stefano Garzarella &lt;sgarzare@redhat.com&gt;
Message-Id: &lt;20221121101101.29400-1-sgarzare@redhat.com&gt;
Reviewed-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Reviewed-by: Stefan Hajnoczi &lt;stefanha@redhat.com&gt;
Acked-by: Raphael Norwitz &lt;raphael.norwitz@nutanix.com&gt;
Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
</content>
</entry>
<entry>
<title>Fix several typos in documentation (found by codespell)</title>
<updated>2022-11-11T08:39:25+00:00</updated>
<author>
<name>Stefan Weil</name>
</author>
<published>2022-11-10T19:08:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=2cb40d446fac6a2aeccba7687448a9f48ec6b6c6'/>
<id>urn:sha1:2cb40d446fac6a2aeccba7687448a9f48ec6b6c6</id>
<content type='text'>
Those typos are in files which are used to generate the QEMU manual.

Signed-off-by: Stefan Weil &lt;sw@weilnetz.de&gt;
Message-Id: &lt;20221110190825.879620-1-sw@weilnetz.de&gt;
Reviewed-by: Philippe Mathieu-Daudé &lt;philmd@linaro.org&gt;
Reviewed-by: Ani Sinha &lt;ani@anisinha.ca&gt;
Reviewed-by: Peter Maydell &lt;peter.maydell@linaro.org&gt;
Acked-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
[thuth: update sentence in can.rst as suggested by Peter]
Signed-off-by: Thomas Huth &lt;thuth@redhat.com&gt;
</content>
</entry>
<entry>
<title>hw/scsi/vmw_pvscsi.c: Use device_cold_reset() to reset SCSI devices</title>
<updated>2022-10-18T11:58:04+00:00</updated>
<author>
<name>Peter Maydell</name>
</author>
<published>2022-10-13T16:06:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=8b5335e381e7fd7554a65c6d591875ade1cea062'/>
<id>urn:sha1:8b5335e381e7fd7554a65c6d591875ade1cea062</id>
<content type='text'>
Currently the vwm_pvscsi controller resets individual SCSI devices
with the device_legacy_reset() function.  The only difference between
this and device_cold_reset() is that device_legacy_reset() resets the
device but not any child qbuses it might have.

In this case, no SCSI device has a child qbus, so the functions have
the same behaviour.  Switch to device_cold_reset() to move away from
using the deprecated function, and bring this SCSI controller in to
line with what all the others do.

Signed-off-by: Peter Maydell &lt;peter.maydell@linaro.org&gt;
Message-Id: &lt;20221013160623.1296109-3-peter.maydell@linaro.org&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>scsi: Use device_cold_reset() and bus_cold_reset()</title>
<updated>2022-10-18T11:58:04+00:00</updated>
<author>
<name>Peter Maydell</name>
</author>
<published>2022-10-13T16:06:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=4a5fc890b1d3609f7b22d2094d094e80c24bcf40'/>
<id>urn:sha1:4a5fc890b1d3609f7b22d2094d094e80c24bcf40</id>
<content type='text'>
In the SCSI subsystem we currently use the legacy functions
qdev_reset_all() and qbus_reset_all().  These perform a recursive
reset, starting from either a qbus or a qdev.  However they do not
permit any of the devices in the tree to use three-phase reset,
because device reset goes through the device_legacy_reset() function
that only calls the single DeviceClass::reset method.

Switch to using the device_cold_reset() and bus_cold_reset()
functions.  These also perform a recursive reset, where first the
children are reset and then finally the parent, but they use the new
(...in 2020...) Resettable mechanism, which supports both the old
style single-reset method and also the new 3-phase reset handling.

Since no devices attached to SCSI buses currently try to use 3-phase
reset, this should be a no-behaviour-change commit which just reduces
the use of a deprecated API.

Commit created with:
  sed -i -e 's/qdev_reset_all/device_cold_reset/g;s/qbus_reset_all/bus_cold_reset/g' hw/scsi/*.c

Signed-off-by: Peter Maydell &lt;peter.maydell@linaro.org&gt;
Message-Id: &lt;20221013160623.1296109-2-peter.maydell@linaro.org&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>virtio-scsi: Send "REPORTED LUNS CHANGED" sense data upon disk hotplug events</title>
<updated>2022-10-13T21:38:33+00:00</updated>
<author>
<name>Venu Busireddy</name>
</author>
<published>2022-10-06T19:49:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=8cc5583abe6419e7faaebc9fbd109f34f4c850f2'/>
<id>urn:sha1:8cc5583abe6419e7faaebc9fbd109f34f4c850f2</id>
<content type='text'>
Section 5.6.6.3 of VirtIO specification states, "Events will also
be reported via sense codes..." However, no sense data is sent when
VIRTIO_SCSI_EVT_RESET_RESCAN or VIRTIO_SCSI_EVT_RESET_REMOVED events
are reported (when disk hotplug/hotunplug events occur). SCSI layer
on Solaris depends on this sense data, and hence does not handle disk
hotplug/hotunplug events.

When the disk inventory changes, use the bus unit attention mechanism
to return a CHECK_CONDITION status with sense data of 0x06/0x3F/0x0E
(sense code REPORTED_LUNS_CHANGED).  The first device on the bus to
execute a command successfully will report and consume the unit
attention status.

Signed-off-by: Venu Busireddy &lt;venu.busireddy@oracle.com&gt;
Message-Id: &lt;20221006194946.24134-1-venu.busireddy@oracle.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging</title>
<updated>2022-10-13T17:55:03+00:00</updated>
<author>
<name>Stefan Hajnoczi</name>
</author>
<published>2022-10-13T17:55:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=bb76f8e27570337f87f01414fb303d760753c587'/>
<id>urn:sha1:bb76f8e27570337f87f01414fb303d760753c587</id>
<content type='text'>
* scsi-disk: support setting CD-ROM block size via device options
* target/i386: Implement MSR_CORE_THREAD_COUNT MSR
* target/i386: notify VM exit support
* target/i386: PC-relative translation block support
* target/i386: support for XSAVE state in signal frames (linux-user)

# -----BEGIN PGP SIGNATURE-----
#
# iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmNFKP4UHHBib256aW5p
# QHJlZGhhdC5jb20ACgkQv/vSX3jHroNJnwgAgCcOOxmY4Qem0Gd1L+SJKpEtGMOd
# 4LY7443vT36pMpvqFNSfp5GBjDT1MgTD8BIY28miLMq959LT89LyM9g/H7IKOT82
# uyCsW3jW+6F19EZVkNvzTt+3USn/kaHn50zA4Ss9kvdNZr31b2LYqtglVCznfZwH
# oI1rDhvsXubq8oWvwkqH7IwduK8mw+EB5Yz7AjYQ6eiYjenTrQBObpwQNbb4rlUf
# oRm8dk/YJ2gfI2HQkoznGEbgpngy2tIU1vHNEpIk5NpwXxrulOyui3+sWaG4pH8f
# oAOrSDC23M5A6jBJJAzDJ1q6M677U/kwJypyGQ7IyvyhECXE3tR+lHX1eA==
# =tqeJ
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 11 Oct 2022 04:27:42 EDT
# gpg:                using RSA key F13338574B662389866C7682BFFBD25F78C7AE83
# gpg:                issuer "pbonzini@redhat.com"
# gpg: Good signature from "Paolo Bonzini &lt;bonzini@gnu.org&gt;" [full]
# gpg:                 aka "Paolo Bonzini &lt;pbonzini@redhat.com&gt;" [full]
# Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
#      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83

* tag 'for-upstream' of https://gitlab.com/bonzini/qemu: (37 commits)
  linux-user: i386/signal: support XSAVE/XRSTOR for signal frame fpstate
  linux-user: i386/signal: support FXSAVE fpstate on 32-bit emulation
  linux-user: i386/signal: move fpstate at the end of the 32-bit frames
  KVM: x86: Implement MSR_CORE_THREAD_COUNT MSR
  i386: kvm: Add support for MSR filtering
  x86: Implement MSR_CORE_THREAD_COUNT MSR
  target/i386: Enable TARGET_TB_PCREL
  target/i386: Inline gen_jmp_im
  target/i386: Add cpu_eip
  target/i386: Create eip_cur_tl
  target/i386: Merge gen_jmp_tb and gen_goto_tb into gen_jmp_rel
  target/i386: Remove MemOp argument to gen_op_j*_ecx
  target/i386: Use gen_jmp_rel for DISAS_TOO_MANY
  target/i386: Use gen_jmp_rel for gen_jcc
  target/i386: Use gen_jmp_rel for loop, repz, jecxz insns
  target/i386: Create gen_jmp_rel
  target/i386: Use DISAS_TOO_MANY to exit after gen_io_start
  target/i386: Create eip_next_*
  target/i386: Truncate values for lcall_real to i32
  target/i386: Introduce DISAS_JUMP
  ...

Signed-off-by: Stefan Hajnoczi &lt;stefanha@redhat.com&gt;
</content>
</entry>
<entry>
<title>scsi-disk: support setting CD-ROM block size via device options</title>
<updated>2022-10-10T07:23:16+00:00</updated>
<author>
<name>John Millikin</name>
</author>
<published>2022-08-04T12:29:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=298c31de9871b971b86356164633b9a5861af3db'/>
<id>urn:sha1:298c31de9871b971b86356164633b9a5861af3db</id>
<content type='text'>
SunOS expects CD-ROM devices to have a block size of 512, and will
fail to mount or install using QEMU's default block size of 2048.

When initializing the SCSI device, allow the `physical_block_size'
block device option to override the default block size.

Signed-off-by: John Millikin &lt;john@john-millikin.com&gt;
Message-Id: &lt;20220804122950.1577012-1-john@john-millikin.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>hw/virtio: move vhd-&gt;started check into helper and add FIXME</title>
<updated>2022-10-07T13:41:51+00:00</updated>
<author>
<name>Alex Bennée</name>
</author>
<published>2022-08-02T09:49:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=b8f3e6a18de6ad5cb668c5430b4933f1e40783cf'/>
<id>urn:sha1:b8f3e6a18de6ad5cb668c5430b4933f1e40783cf</id>
<content type='text'>
The `started` field is manipulated internally within the vhost code
except for one place, vhost-user-blk via f5b22d06fb (vhost: recheck
dev state in the vhost_migration_log routine). Mark that as a FIXME
because it introduces a potential race. I think the referenced fix
should be tracking its state locally.

Signed-off-by: Alex Bennée &lt;alex.bennee@linaro.org&gt;
Message-Id: &lt;20220802095010.3330793-12-alex.bennee@linaro.org&gt;
Reviewed-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Reviewed-by: Raphael Norwitz &lt;raphael.norwittz@nutanix.com&gt;
</content>
</entry>
<entry>
<title>scsi: Reject commands if the CDB length exceeds buf_len</title>
<updated>2022-09-01T05:42:37+00:00</updated>
<author>
<name>John Millikin</name>
</author>
<published>2022-08-17T05:35:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=6d1511cea0fb536f2df7b6c31bb745d80b98d82e'/>
<id>urn:sha1:6d1511cea0fb536f2df7b6c31bb745d80b98d82e</id>
<content type='text'>
In scsi_req_parse_cdb(), if the CDB length implied by the command type
exceeds the initialized portion of the command buffer, reject the request.

Rejected requests are recorded by the `scsi_req_parse_bad` trace event.

On example of a bug detected by this check is SunOS's use of interleaved
DMA and non-DMA commands. This guest behavior currently causes QEMU to
parse uninitialized memory as a SCSI command, with unpredictable
outcomes.

With the new check in place:

  * QEMU consistently creates a trace event and rejects the request.

  * SunOS retries the request(s) and is able to successfully boot from
    disk.

Signed-off-by: John Millikin &lt;john@john-millikin.com&gt;
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1127
Message-Id: &lt;20220817053458.698416-2-john@john-millikin.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
</feed>
