-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC] Add X11 cross domain channel type. #213
[RFC] Add X11 cross domain channel type. #213
Conversation
This is an interesting approach, indeed. Please consider rebasing it on top of #212 and providing some instructions on how to test it. |
I have attempted to rebase it on the specified branch, however if i try to enable dax with it, the vm crashes with the following trace:
|
This means the descriptor address, sent by the guest, is pointing to a location that's not registered in GuestMemory. I can't reproduce that here, could you please give me some info about your test system (architecture, OS and amount of RAM)? |
Arm64 (m1 pro), Linux, 32 gb |
I suspect virtio-fs will sometimes be asked to operate on the window from the host side, which is something I hadn't anticipated. I'll verify this and, if that's case, I'll update #212 to cover the SHM regions for virtio-fs under the GuestMemory umbrella. |
@WhatAmISupposedToPutHere I'm still unable to reproduce the issue here. I could implement the changes to cover the range in GuestMemory anyway, but I'd like to be able to test it properly first. Could you please launch |
The M1/M2 Pro/Max series have physical RAM mapped at a higher address and a larger physical and virtual address space size (including for VMs) than baseline M1/M2 chips (42 bits vs 36 bits I think?). @slp if you are testing on the baseline chips then that's probably the difference...
…On August 26, 2024 2:14:19 PM GMT+02:00, "Sergio López" ***@***.***> wrote:
@WhatAmISupposedToPutHere I'm still unable to reproduce the issue here. I could implement the changes to cover the range in GuestMemory anyway, but I'd like to be able to test it properly first. Could you please launch `krun` with `RUST_LOG=devices::virtio::fs=debug`?
--
Reply to this email directly or view it on GitHub:
#213 (comment)
You are receiving this because you were mentioned.
Message ID: ***@***.***>
|
Link to the log: https://pastebin.com/XMGbr1cG |
Thanks a lot for the logs. With that info, I was able to reproduce the issue here. As suspected, virtio-fs is being asked to read directly from a mapped region. I'll update #212 to cover those regions under GuestMemory. |
Signed-off-by: Sergio Lopez <[email protected]>
Remove broken and useless kvm_context test. Signed-off-by: Sergio Lopez <[email protected]>
In a future commit we need to extend the functionality of create_guest_memory, so take this opportunity to unify it across flavors/variants. Signed-off-by: Sergio Lopez <[email protected]>
We have multiple devices (fs and gpu) that can use SHM regions. So far, we were creating a single SHM region so only one device could make use of it. In this commit, we implement SHM region management so multiple devices can request their own regions. For the moment, we're hardcoding the SHM region sizes for gpu and fs. A future commit will extend the API so users can configure those sizes as desired. Signed-off-by: Sergio Lopez <[email protected]>
After splitting the functionality into a worker, the SHM region was left behind. Plumb it now to re-enable DAX support. Signed-off-by: Sergio Lopez <[email protected]>
Bring virtiofs DAX support into macOS relying on the mechanisms added for supporting virtio-gpu blobs, which allow us to request HVF the injection of memory regions. Signed-off-by: Sergio Lopez <[email protected]>
Introduce krun_add_virtiofs2 and krun_set_gpu_options2 as variants of krun_add_virtiofs and krun_set_gpu_options respectively, to allow users to specify the DAX/host SHM window size for the device. We're adding variants of existing functions to avoid breaking existing consumers of the library. This isn't great, but we'll do a huge clean up of the API in 2.0. Signed-off-by: Sergio Lopez <[email protected]>
@WhatAmISupposedToPutHere Could you please try again with the latest version of #212 ? |
This adds the X11 cross domain channel and an ability to share futexes between the vm and the host. Signed-off-by: Sasha Finkelstein <[email protected]>
bcd82b0
to
7dd245f
Compare
I can confirm that it works with the latest version of dax patches. The test setup right now is a bit involved, but here are the steps:
|
Thanks for the instructions. Got it working here, successfully running some apps like glxgears and Xonotic. Seems to struggle with others like xeyes, firefox or steam. Seems promising nevertheless. Should it be possible to support roughly every x11 app there or are there any intrinsic limitations of this approach? |
In my testing steam actually worked fine, aside from popup windows showing as black on first draw. Firefox also seems to be fine (i am sending this comment from a copy of firefox running under this thing.) Xeyes does in fact crash and will need further investigation. This approach should support nearly every x11 app, expect those that hard-require mit-shm or xvideo and do not have fallbacks. Supporting those protocols would require adding new linux syscalls both on the host and the guest os. EDIT: you are testing it on arm64, right? x112virtgpu only supports that architecture for now. (it does code injecion into a client) |
This can be closed in favor of #232 |
Closing. |
This adds the X11 cross domain channel and an ability to share futexes between the vm and the host. Since it requires dax to work, the commits are now on top of @asahilina's branch that enables dax, but it should be possible to rebase it on top of whatever solution will be used for it.