Live data from Hacker News

Writing a Hypervisor in 1k Lines

seiya.me

1–10 of 15 posts

Re: Writing a Hypervisor in 1k Lines

#3
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

#4
post #3

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.

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

#5
post #2

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.

I think you mean “…will be done in software…,” right?

Re: Writing a Hypervisor in 1k Lines

#6
post #4
post #3

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.

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 offici…

I find many manuals miss the big picture. Maybe read the VMware, Xen, and KVM papers first.

Re: Writing a Hypervisor in 1k Lines

#7
post #3

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.

theory: https://www.cs.cornell.edu/courses/cs6411/2018sp/papers/pope...

practice: https://www.cse.iitb.ac.in/~mythili/virtcc/papers/vmware.pdf

Re: Writing a Hypervisor in 1k Lines

#8
post #5
post #2

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.

I think you mean “…will be done in software…,” right?

Yes oops!

Re: Writing a Hypervisor in 1k Lines

#10
post #2

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.

Could you do page table walks in RVV?

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).
Post reply on HN