general high-level discussion about spectrum
 help / color / mirror / Atom feed
From: Thomas Leonard <talex5@gmail.com>
To: Alyssa Ross <hi@alyssa.is>
Cc: discuss@spectrum-os.org
Subject: Re: Using virtio-gpu instead of virtwl
Date: Sun, 5 Jun 2022 16:29:10 +0000	[thread overview]
Message-ID: <CAG4opy_=Vh9h2DSBEuA2SufyoeY-MnyQDgS8Me5vLduAe+OiNQ@mail.gmail.com> (raw)
In-Reply-To: <CAG4opy9fYoNyS+Fo+aD3U3dhrgf6MpCHPx-hj0a=pdFv5sqa2g@mail.gmail.com>

On Wed, 18 May 2022 at 09:55, Thomas Leonard <talex5@gmail.com> wrote:
>
> On Mon, 16 May 2022 at 11:55, Alyssa Ross <hi@alyssa.is> wrote:
[...]
> > Do you have a Nix expression somewhere for crosvm with all this stuff
> > fixed?  I'd like to integrate it into my draft Nixpkgs PR.  (If you
> > didn't do it with Nix, I can make the changes myself.)
>
> No, sorry. I've just been hacking on it in nix-shell.

I've now collected things together and pushed all my scripts here:

  https://gitlab.com/talex5/qubes-lite

I've got quite a few patches to crosvm now (and NixOS 22.05 brought
some new problems), but they're hacks and not suitable for
upstreaming. They might be a useful starting point for someone else
though. They're in the crosvm subdirectory:

fix-gui-jail:

Adds some Nix paths to the jail to allow virtio-gpu to start.
Otherwise, the mesa libraries can't be loaded. Note that mesa
libraries are loaded dynamically by glvnd using dlopen. If that
returns NULL to indicate an error, glvnd just ignores the error and
doesn't load any drivers, causing crosvm to segfault later on a NULL
pointer. That also hit me when I was accidentally compiling crosvm
with a different version of glibc.

fix-keymaps:

Sway/wlroots now sends read-only keymaps, but crosvm wants to map them
read/write, which fails. This hack gets crosvm to try a read-only mmap
if a read/write one fails. A better solution would be to remember that
the resource is a keymap and map it read-only first.

fix-suspend:

After the host resumes from suspend, the disk driver gets EINTR from
uring and stops handling disk requests. My previous trick of setting
the locked memory limit to zero no longer works for some reason, so
this stops uring in the source. A better fix would be to get crosvm to
retry on EINTR.

no-gpu-window:

When using virtio-gpu, crosvm opens a pointless console window. This
patch forces the use of the Stub backend, which hides it. Possibly
this still wastes resources though; maybe disabling the display
completely would be better.

share-as-user:

The shared filesystem driver runs in a jail where everything appears
to be owned by root, and so this is how it appears in the Linux guest.
This patch makes all files appear to be owned by user 1000, and
performs all operations as user 0. This allows the regular user in the
VM to access shared files. A better fix might be to stop using user
namespaces here, but I'm not sure how to make that work.

slow-fences:

While there are GPU operations outstanding, crosvm wakes up 1000 times
a second to check whether they're done, which is very wasteful. This
patch makes it wake only once per second, which doesn't seem to have
any ill effects. I'm not sure why there are outstanding requests all
the time - possibly "wait for a user action" counts as an in-progress
request?


-- 
talex5 (GitHub/Twitter)
http://roscidus.com/blog/


  reply	other threads:[~2022-06-05 15:29 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-05 19:27 New user getting started questions Thomas Leonard
2021-01-05 20:09 ` Michael Raskin
2021-01-06  7:04   ` Alyssa's break Alyssa Ross
2021-01-06  9:11     ` Michał "rysiek" Woźniak
2021-01-06  7:00 ` New user getting started questions Alyssa Ross
2021-01-06 15:56   ` Thomas Leonard
2021-01-07 11:38     ` Thomas Leonard
2021-01-07 15:33     ` Thomas Leonard
2021-01-14 12:29     ` Alyssa Ross
2021-01-14 12:51       ` Alyssa Ross
2021-01-20 13:04         ` Thomas Leonard
2021-01-27 17:31           ` Thomas Leonard
2021-03-07 12:52             ` Thomas Leonard
2021-03-09 16:59               ` Qubes-lite With KVM and Wayland Alyssa Ross
2021-03-10 14:19                 ` Thomas Leonard
2021-03-10 22:34                   ` Alyssa Ross
2021-03-09 16:25             ` New user getting started questions Alyssa Ross
2021-03-13  7:21               ` Thomas Leonard
2021-03-13 13:52                 ` Alyssa Ross
2021-10-30 12:58                 ` Thomas Leonard
2021-11-03 11:36                   ` Alyssa Ross
2021-11-03 18:27                     ` Thomas Leonard
2021-11-10 12:58                       ` Alyssa Ross
2021-11-10 12:00                         ` Thomas Leonard
2021-11-11 11:09                           ` Alyssa Ross
2021-11-11 16:12                             ` Thomas Leonard
2021-11-12 10:47                               ` Alyssa Ross
2022-03-13 15:08                         ` Thomas Leonard
2022-03-15 14:06                           ` Alyssa Ross
2022-03-15 20:23                             ` Alyssa Ross
2022-03-16 16:18                               ` Using virtio-gpu instead of virtwl Thomas Leonard
2022-03-16 16:54                                 ` Alyssa Ross
2022-03-21 12:10                                 ` Thomas Leonard
2022-03-21 16:05                                   ` Alyssa Ross
2022-03-22 11:08                                     ` Thomas Leonard
2022-03-22 11:16                                       ` Alyssa Ross
2022-03-22 20:05                                         ` Thomas Leonard
2022-04-06 12:19                                           ` Thomas Leonard
2022-04-13 17:12                                             ` Thomas Leonard
2022-04-14 13:57                                               ` Alyssa Ross
2022-04-19 12:58                                                 ` Thomas Leonard
2022-04-19 12:01                                                   ` Alyssa Ross
2022-05-15 15:20                                                 ` Thomas Leonard
2022-05-16 11:55                                                   ` Alyssa Ross
2022-05-18  9:55                                                     ` Thomas Leonard
2022-06-05 16:29                                                       ` Thomas Leonard [this message]
2022-08-09 12:00                                     ` Alyssa Ross
2022-10-10 15:16                                       ` Thomas Leonard
2022-10-10 16:53                                         ` Alyssa Ross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAG4opy_=Vh9h2DSBEuA2SufyoeY-MnyQDgS8Me5vLduAe+OiNQ@mail.gmail.com' \
    --to=talex5@gmail.com \
    --cc=discuss@spectrum-os.org \
    --cc=hi@alyssa.is \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).