virtwl fails on ARM |
|||
Issue descriptionThe VIRTWL_IOCTL_NEW ioctl fails on ARM. This causes sommelier-x@0.service to crash, and no Wayland clients will work. sommelier.c:7451: int main(int, char **): Assertion `!rv' failed.
,
May 5 2018
zachr's test program, I built with gcc -lwayland-client -lrt -pthread -o virtwl virtwl.c And ran as ./virtwl -v -k
,
May 5 2018
I ran it without seccomp and with --disable-sandbox and got this error from crosvm when i started the container: [ERROR:devices/src/virtio/wl.rs:835] failed to recv from vfd: VmBadResponse
,
May 5 2018
I did some stracing and saw this: 10975 ioctl(8, KVM_SET_USER_MEMORY_REGION <unfinished ...> 10975 <... ioctl resumed> , 0xffceb430) = -1 EFAULT (Bad address) And I think what's happening is that wayland is inserting some memory at some invalid location in the memory map -- really the arch code needs to be involved somewhere because it knows what the guest memory map should look like
,
May 5 2018
also memfd_create seems to be getting an argument of 2 instead of 3 for some reason 10980 memfd_create(0x2, 0xd7c2714 /* MFD_??? */) = -1 EINVAL (Invalid argument)
,
May 6 2018
re #5 - 10980 memfd_create(0x2, 0xd7c2714 /* MFD_??? */) = -1 EINVAL (Invalid argument) That's likely a specific hugepage shift value. Either this is a pre-4.14 kernel where these flags are not supported or it's an invalid hugepage shift which could by explained by the missing arch code. (Sorry, I just saw this on accident.)
,
May 8 2018
Ok, well I found the cause of the VmBadResponse -- I had a bug in the aarch64 implementation that was returning an address instead of a pfn. So I corrected that and no longer get the VmBadResponse, however the test case is still failing with "failed ot allocate shared fd 19" So I'm currently trying to debug that.
,
May 9 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform/crosvm/+/5165cb7eece4e014fa4f3146591c20e8e4cc9c92 commit 5165cb7eece4e014fa4f3146591c20e8e4cc9c92 Author: Sonny Rao <sonnyrao@chromium.org> Date: Wed May 09 00:44:33 2018 crosvm: aarch64: fix lack of shifting for base_dev_pfn This is a pfn (page-frame number) not a raw address, so we need to shift it right by 12. BUG= chromium:840048 TEST=manual test on kevin with virtio wayland and --disable-sandbox, should not get "failed to recv from vfd: VmBadResponse" message Change-Id: I788712ec7b9b3e9b4ada481d62a5f2ae1624e929 Reviewed-on: https://chromium-review.googlesource.com/1049060 Commit-Ready: Sonny Rao <sonnyrao@chromium.org> Tested-by: Sonny Rao <sonnyrao@chromium.org> Reviewed-by: Stephen Barber <smbarber@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org> [modify] https://crrev.com/5165cb7eece4e014fa4f3146591c20e8e4cc9c92/aarch64/src/lib.rs
,
May 9 2018
Ok, it looks underlying failure is the call to memfd_create in the virtio_wl when it tries to create a shared memory segment. It looks like there's some custom code to define the call the memfd_create in sys_util/src/shm.rs that's only suitable for x86_64. I created a different version for arm and the virtwl test program seems to work, and incidentally it also seems to work on x86_64, so I'm going to put up a cL for that.
,
May 9 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform/crosvm/+/17bd06f65b51d1f5b484062ce3d994b576015fba commit 17bd06f65b51d1f5b484062ce3d994b576015fba Author: Sonny Rao <sonnyrao@chromium.org> Date: Wed May 09 11:33:14 2018 sys_util: SharedMemory: fix signature for memfd_create syscall The signature for this system call was wrong, but somehow managed to work on x86_64. This should fix it to work on all architectures. BUG= chromium:840048 TEST=build_test passes TEST=virtio wayland works on ARM Change-Id: I295548357f688be4772e65991fb65178ead3b1e8 Reviewed-on: https://chromium-review.googlesource.com/1050915 Commit-Ready: Sonny Rao <sonnyrao@chromium.org> Tested-by: Sonny Rao <sonnyrao@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org> [modify] https://crrev.com/17bd06f65b51d1f5b484062ce3d994b576015fba/sys_util/src/shm.rs
,
May 9 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform/crosvm/+/0ac9254f9ae496eba2e95d0c222071fe0bd07a26 commit 0ac9254f9ae496eba2e95d0c222071fe0bd07a26 Author: Sonny Rao <sonnyrao@chromium.org> Date: Wed May 09 11:33:14 2018 crosvm: aarch64: fix truncate on wayland policy Like block_device, also needs to use ftruncate64 instead of ftruncate. BUG= chromium:840048 TEST=manual test of graphics on kevin Change-Id: Ib24b12fd681c96ecc2fec796fe480e94a96a0626 Reviewed-on: https://chromium-review.googlesource.com/1050916 Commit-Ready: Sonny Rao <sonnyrao@chromium.org> Tested-by: Sonny Rao <sonnyrao@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org> [modify] https://crrev.com/0ac9254f9ae496eba2e95d0c222071fe0bd07a26/seccomp/aarch64/wl_device.policy
,
May 9 2018
virtwl should work after these two CLs land: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1050916 https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1050915 however, it looks like sommelier is still unhappy but maybe we should open another bug for that? |
|||
►
Sign in to add a comment |
|||
Comment 1 by smbar...@chromium.org
, May 5 2018