News for hackers. Stuff that matters.
Re:Writing a Hypervisor in 1k Lines by arjvik on Tuesday September 02, 2025 @02:22PM (#45107035)
RISC-V is fully trap-and-emulate-able and so you can even do this without the virtualization extension! Though page table walks and the like will be done in hardware and thus will be very slow.
Re:Writing a Hypervisor in 1k Lines by drob518 on Tuesday September 02, 2025 @02:49PM (#45107377)
I think you mean “…will be done in software…,” right?
Re:Writing a Hypervisor in 1k Lines by arjvik on Tuesday September 02, 2025 @04:48PM (#45108830)
Yes oops!
Re:Writing a Hypervisor in 1k Lines by nerpderp82 on Tuesday September 02, 2025 @05:14PM (#45109154)
Could you do page table walks in RVV?
Re:Writing a Hypervisor in 1k Lines by remexre on Tuesday September 02, 2025 @05:46PM (#45109512)
They're dependent loads, so probably not except for the last level of page tables (and that's just be "prefetching" -- doing 4/8/etc walks in parallel, not 1 walk in less time).
Re:Writing a Hypervisor in 1k Lines by anchovy_ on Tuesday September 02, 2025 @02:32PM (#45107168)
Tangentially related: can anyone here recommend some good resources (preferably even books) on hypervisors? Back in university we got a brief introduction into the topic but I was always interested in learning about it more in depth.
Re:Writing a Hypervisor in 1k Lines by dmitrygr on Tuesday September 02, 2025 @04:18PM (#45108450)
Re:Writing a Hypervisor in 1k Lines by farhanhubble on Wednesday September 10, 2025 @12:53AM (#45193433)
These are gold nuggets!
Re:Writing a Hypervisor in 1k Lines by TZubiri on Tuesday September 02, 2025 @02:43PM (#45107305)
It's one of those topics, that's so modern and based around ecosystem specifics, that you are better off learning from manufacturer manuals and source code, rather than academic theory books.

Like, uni books won't give you an x86 manual because that wouldn't be neutral, but that's precisely the foundation of virtualization, from both a host and guest perspective.

You can read books on x86, but why not use some official intel manual?

Re:Writing a Hypervisor in 1k Lines by wmf on Tuesday September 02, 2025 @04:16PM (#45108420)
I find many manuals miss the big picture. Maybe read the VMware, Xen, and KVM papers first.
Re:Writing a Hypervisor in 1k Lines by TZubiri on Tuesday September 02, 2025 @07:00PM (#45110229)
Oh for sure, you are seeing the small pictures, but those are objective facts.

Big picture for virtualization? There's many, it's a complex emerging phenomenon which placed a lot of asterisks on computation, is it used for security? Or to patch tech debt? or to provide backwards compatibility? Yes. What is the limit between isolation and efficiency? No one knows yet and there's many answers, you can activate shared cpu caching or disable Spectre mitigations for efficiency, or you can just forego virtualization as a whole and depend on application level multitenancy, which is not a separate topic at all in terms of virtualization, as you can see with tech like containers, and t1/t2 hybrids, it's a spectrum of virtualization, there is no hard line separating the virtualized from the bare metal.

Re:Writing a Hypervisor in 1k Lines by naasking on Wednesday September 03, 2025 @11:23AM (#45116877)
The first hypervisors were microkernels like L4. All of the fundamentals are in microkernel literature which stretches back to the 80s, though I don't think there's a need to read anything before L4 in the 90s.
Re:Writing a Hypervisor in 1k Lines by epilys on Wednesday September 03, 2025 @12:02AM (#45112152)
Seconding the other comments that recommend architecture manuals and guides.

For Aarch64, Arm's official guide is pretty good https://developer.arm.com/documentation/102142/latest/

Re:Writing a Hypervisor in 1k Lines by BobbyTables2 on Tuesday September 09, 2025 @11:21PM (#45192806)
Kudos for making a real hypervisor and not just writing a Linux application that drives /dev/kvm !