95 points · by codetrotter · 5y ago · 39 comments
It was explained to me that there are 2 different instructions on ARM to say "i'm idle, wake me up if something happens" (like x86 mwait), and Apple M1 uses one, while everybody else uses the other. Is this fixed in either FreeBSD or Qemu at this point?
BTW, I'm super impressed that a 4-core VM on my M1 13" MBP can build world in about 130% of the time of a 32-core Ampere EMAG.
That had me curious, so I searched around a bit.
And I found one QEMU patch that seems like the right one: https://patchew.org/QEMU/20210120224444.71840-1-agraf@csgraf...
This appears to be his latest/greatest bundle: https://patchew.org/QEMU/20210120224444.71840-1-agraf@csgraf...
This says more about the eMAG than the M1, to be honest :D The APM X-Gene derived cores in the eMAG are far behind current cores from everyone else. The new Ampere Altra is using stock Arm Neoverse cores. (Which makes me wonder if all they got out of the APM acquisition was just one dead-end generation of product…)
> Is this fixed in either FreeBSD or Qemu at this point?
Not in FreeBSD for sure, as an obsessive commit watcher I can say I haven't seen any M1 quirks land.
> 2 different instructions on ARM to say "i'm idle, wake me up if something happens" (like x86 mwait), and Apple M1 uses one, while everybody else uses the other
Everybody should use both in different circumstances: https://community.arm.com/developer/ip-products/processors/f...
But according to Corellium's Linux work "the CPU tends to lose state" when using WFI for system idle: https://github.com/corellium/linux-m1/commit/b8ecd5924678f1c...
Not sure why this would have an impact on VM idling… (upd: yeah it's QEMU-side stuff, see other comments)
That leaves just the firewire one as possibly an issue.
Though I get the general point that hardware drivers could be an issue. Perhaps, though, the upside of the M1 is sufficient incentive for people to figure it out.
What I now have is just a boot to console. I haven't decided on a login manager yet, so I just run `sway` to get to the desktop. I run sway window manager on wayland. I installed rust, emacs, vim, a music player ncmpcpp and firefox. It feels like this old laptop got lots of energy from this new setup.
[link redacted]
Would it be possible to run FreeBSD similarly without qemu?
As far as I could tell, the Virtualization framework is Linux specific(?)
https://developer.apple.com/documentation/virtualization
And in the guide in the OP, we are using some patches that someone wrote so that QEMU uses the Hypervisor framework.
https://developer.apple.com/documentation/hypervisor
And from what I understand but please correct me if I am wrong, the Virtualization framework is actually a layer on top of the Hypervisor framework. So if I am correct in my understanding the way that the QEMU patches do it should in theory be comparable in performance to the way that the Virtualization framework does it.
I would like to do some benchmarking of Linux on the Virtualization framework versus Linux on QEMU to see if there is a difference. However, good benchmarking is no easy feat. So ideally someone else who is really good at benchmarking Linux would do this and write about it.
https://news.ycombinator.com/from?site=gist.github.com
Learn to live in attention economy with HTTP.
If it’s not useful to anyone then I know not to spend time on that. Short though as the guide is, and even though it is based on much hard work of others, it still took time to make, much in part because when I write stuff like this I spend a lot of time actually redoing steps to ensure to the best of my ability that what I am writing will work for others too. So I like to know that people find it useful.
GitHub stars and HN upvotes are two different unrelated things.