patches and low-level development discussion
 help / color / mirror / code / Atom feed
* This Week in Spectrum, 2020-W24
@ 2020-06-14 23:42 Alyssa Ross
  0 siblings, 0 replies; only message in thread
From: Alyssa Ross @ 2020-06-14 23:42 UTC (permalink / raw)
  To: discuss, devel; +Cc: Cole Helbling, Puck Meerburg

[-- Attachment #1: Type: text/plain, Size: 3252 bytes --]

An interesting week.  Didn't go quite in the direction I expected it to.


Documentation
-------------

Cole kindly provided[1] some documentation[2] for spectrum-vm for the
developer manual.  This was especially nice, because it marked the first
time I was able to remove[3] an item from the Contribution Ideas page[4]
because somebody had done the contribution!  Thanks Cole!

[1]: https://spectrum-os.org/lists/archives/spectrum-devel/87zh97coks.fsf@alyssa.is/T/#t
[2]: https://spectrum-os.org/doc/developer-manual.html#_spectrum_vm
[3]: https://spectrum-os.org/git/www/commit/?id=bf7cde0ddd06455f212fb39092b87313cee8a7c1
[4]: https://spectrum-os.org/todo.html


crosvm
------

My main goal for this week was to start modifying libwayland-server to
use a virtio_wl socket as the display socket, as described last week[5].

So, in pursuit of this goal, I started the week by trying to write a
test program that would start a VM running a compositor, create a
socket, attach one end to that VM, and then start another VM running a
Wayland client, and attach the other end of the socket to that VM.
Then, in theory, all I had to do was the libwayland-server
modifications, and then the compositor and client would be able to talk
to each other.

Unfortunately, I didn't get that far.  The program froze after starting
the first VM.  I assumed I must have done something wrong, so I rewrote
it, and had the same problem.  I did it again, and same problem.

Some further debugging revealed that the command to add the socket to
the first VM was hanging.  And also, crosvm was hanging.  Running the
command outside this program worked fine, though.  It returned
immediately, and crosvm kept running with the new socket added.

What I eventually realised was that the crosvm hang only happened if the
command was sent to it early enough.  After some intense staring at the
crosvm code, I realised that there was a deadlock resulting from trying
to wait for a response from a virtual device before the device had been
initialized.  Despite this issue manifesting with adding Wayland
sockets, which is a feature unique to crosvm, a lot of the code for that
is adapted from the code for resizing virtual block devices, which is an
upstream feature.  And that had the same issue, so this is actually an
upstream bug.

The fix was not easy, and required some fairly substantial refactoring.
It's described in detail in the patch message[6].  I think it's probably
a pretty interesting read.

I also merged in the latest upstream crosvm changes.

[5]: https://spectrum-os.org/lists/archives/spectrum-discuss/87tuzm287b.fsf@alyssa.is/
[6]: https://spectrum-os.org/lists/archives/spectrum-devel/20200614114344.22642-3-hi@alyssa.is/


Nixpkgs
-------

I spent a few more hours trying to get libvda (an optional dependency of
crosvm; required for virtio-video) to build, and I got it to work,
thanks to some help from Puck.  There's still a hack in there I'll tidy
up before I push it, but it's cool to have this packaged for future
experimentation with this crosvm feature.


With the crosvm issue out of the way, which ended up taking most of the
week to identify and fix, hopefully next week I'll be able to actually
get going on those libwayland-server changes.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-06-14 23:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-14 23:42 This Week in Spectrum, 2020-W24 Alyssa Ross

Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/crosvm
	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/nixpkgs
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock
	https://spectrum-os.org/git/www

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).