New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 892342 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Closed: Jan 9
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug
Gfx



Sign in to add a comment

Non-deterministic virtio-gpio failures caused by VIRTWL_IOCTL_SEND failures

Project Member Reported by davidri...@chromium.org, Oct 4

Issue description

With virtio-gpu and Xwayland w/ glamor enabled, basic X apps appear to non-deterministically fail on startup.

Client side failure example:
davidriley@stretch-x:/opt/google/cros-containers/bin$ strace -f -o /tmp/st2 xeyes -geometry 256x256 -bg white
XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":0"
      after 68 requests (68 known processed) with 0 events remaining.

Logs from sommelier appear to show failure with an ioctl:
Oct 04 20:36:14 stretch-x sommelier[2959]: sommelier.elf: ../../../../../../../../../mnt/host/source/src/platform2/vm_tools/sommelier/sommelier.c:3069: int sl_handle_virtwl_socket_event(int, uint32_t, void *): Assertion `!rv' failed.
Oct 04 20:36:14 stretch-x sommelier[2959]: (EE) failed to read Wayland events: Broken pipe
 
This appears to be an ordering race with sometimes the resource_create_3d being processed by the VM first (good) and sometimes the vfd_send_foreign_id being processed by the VM first (bad). Likely due to the ioctl returning to userspace with a new call from Xwayland to make use of the returned id without a corresponding fence within the kernel to ensure that the create finishes before the send.
Status: Assigned (was: Untriaged)
Labels: -Grfx Gfx
Project Member

Comment 5 by bugdroid1@chromium.org, Jan 8

Labels: merge-merged-chromeos-4.19
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/11a93b73abe7df1fb77b5ec4ee151676457a3cd9

commit 11a93b73abe7df1fb77b5ec4ee151676457a3cd9
Author: Zach Reizner <zachr@google.com>
Date: Tue Jan 08 03:40:27 2019

CHROMIUM: virtwl: send foreign id support

This change is needed to support sending virtualized host resources
across virtio wayland connections. Initially, only virtio gpu resources
are supported.

Ensure that the host has processed the create request before trying
to send it otherwise there is a race where the send can occur before
the create is processed.

BUG=chromium:875998, chromium:892342 
TEST=wayland-simple-egl
     eyes repeatedly does not fail

Change-Id: I4f7ceff45f048cffcb87ce065feefd455578e6e3
Signed-off-by: Zach Reizner <zachr@google.com>
Signed-off-by: David Riley <davidriley@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1351812
Reviewed-by: Zach Reizner <zachr@chromium.org>

[modify] https://crrev.com/11a93b73abe7df1fb77b5ec4ee151676457a3cd9/drivers/virtio/virtio_wl.c
[modify] https://crrev.com/11a93b73abe7df1fb77b5ec4ee151676457a3cd9/include/uapi/linux/virtio_wl.h

Project Member

Comment 6 by bugdroid1@chromium.org, Jan 8

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/aeb585ad364dc59b3b7dd31b19063149edcfccb0

commit aeb585ad364dc59b3b7dd31b19063149edcfccb0
Author: David Riley <davidriley@chromium.org>
Date: Tue Jan 08 03:40:24 2019

CHROMIUM: drm/virtio: Add virtio specific dma_buf_ops.

BUG= chromium:892342 
TEST=xeyes repeatedly does not fail

Change-Id: Ic4ed0b2bd3a6cc3afe1bb563e7474f407f1de0ec
Signed-off-by: David Riley <davidriley@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1351814
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>

[modify] https://crrev.com/aeb585ad364dc59b3b7dd31b19063149edcfccb0/drivers/gpu/drm/virtio/virtgpu_prime.c
[modify] https://crrev.com/aeb585ad364dc59b3b7dd31b19063149edcfccb0/drivers/gpu/drm/virtio/virtgpu_drv.h
[modify] https://crrev.com/aeb585ad364dc59b3b7dd31b19063149edcfccb0/drivers/gpu/drm/virtio/virtgpu_drv.c

Project Member

Comment 7 by bugdroid1@chromium.org, Jan 8

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/cea7ac75b0485305ef7d58b47c67d4ab82e620a3

commit cea7ac75b0485305ef7d58b47c67d4ab82e620a3
Author: David Riley <davidriley@chromium.org>
Date: Tue Jan 08 03:40:26 2019

CHROMIUM: drm/virtio: Add interfaces to share dma bufs via virtwl.

BUG= chromium:892342 
TEST=xeyes repeatedly does not fail

Change-Id: Ib74f0992bd9ee2bde10097722c361cdd3e94b64f
Signed-off-by: David Riley <davidriley@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1351815
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>

[modify] https://crrev.com/cea7ac75b0485305ef7d58b47c67d4ab82e620a3/drivers/gpu/drm/virtio/virtgpu_object.c
[add] https://crrev.com/cea7ac75b0485305ef7d58b47c67d4ab82e620a3/include/drm/virtio_drm.h

Status: Fixed (was: Assigned)

Sign in to add a comment