Skip to content
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

XHCI over EHCI for better performance as well as aarch64 support #497

Merged
merged 1 commit into from
Dec 27, 2021

Conversation

jwehrlich
Copy link

Update to use a more friendly version USB that works with aarch64

Notes:
https://qemu-project.gitlab.io/qemu/system/devices/usb.html

XHCI controller support
QEMU has XHCI host adapter support. The XHCI hardware design is much more virtualization-friendly when compared to EHCI and UHCI, thus XHCI emulation uses less resources (especially CPU). So if your guest supports XHCI (which should be the case for any operating system released around 2010 or later) we recommend using 

Signed-off-by: Jason W. Ehrlich jwehrlich@outlook.com

Signed-off-by: Jason W. Ehrlich <jwehrlich@outlook.com>
@jwehrlich
Copy link
Author

Resolves #499

args = append(args, "-device", "usb-ehci")
args = append(args, "-device", "usb-kbd")
args = append(args, "-device", "usb-mouse")
args = append(args, "-device", "qemu-xhci,id=usb-bus")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This requires QEMU >= 2.9.
I guess this is fine, but cc-ing @jandubois FYI
qemu/qemu@72a810f

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is fine, but cc-ing @jandubois FYI

Yes, seems fine, and works for me.

But as I mentioned in #499, I cannot repro the failure on macOS on aarch64 with the default.yaml config.

And I was also wondering why we need USB devices at all? What happens if we just drop them?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And I was also wondering why we need USB devices at all? What happens if we just drop them?

We will lose keyboard and mouse. Probably negligible for non-GUI mode though.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably negligible for non-GUI mode though.

Do we have a GUI mode? I know we can get a console (with horrible performance impact), but is there a way to actually run a GUI?

On the other hand, I would hope that performance impact from emulating a USB device that is not being used is really minimal as well (really only thinking about battery impact when running on a laptop).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By "GUI" I just meant setting .video.display = "cocoa"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By "GUI" I just meant setting .video.display = "cocoa"

So maybe we drop the USB devices with the display: none setting. I may try that when I'm bored. 😄

Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@AkihiroSuda AkihiroSuda merged commit 03b4ac1 into lima-vm:master Dec 27, 2021
@AkihiroSuda AkihiroSuda added this to the v0.8.1 milestone Dec 27, 2021
@AkihiroSuda AkihiroSuda linked an issue Dec 27, 2021 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

USB fails to correctly initialize in aarch64
3 participants