google / gvisor

Application Kernel for Containers
https://gvisor.dev
Apache License 2.0
15.86k stars 1.3k forks source link

Arm64: ring0 module must maintain independence and compatibility for different platforms #5039

Open lubinszARM opened 3 years ago

lubinszARM commented 3 years ago

According to my understanding, the ring0 module is acting as a thin guest kernel, it must maintain independence and compatibility for different platforms. Currently, on Arm64, it is only compatible with kvm. At present, I think there are some aspects need to be improved:

lubinszARM commented 3 years ago

image

lubinszARM commented 3 years ago

/cc @avagin @amscanne

amscanne commented 3 years ago

Totally agree, I have some patch sets that I will try to push for this shortly which can lay the foundation for this work. Can you clarify the improvements required with "halt()" ? ;)

lubinszARM commented 3 years ago

Hi @amscanne In my plan, halt() can be made into a trampoline, just like kernelSyscall()/kernelException(). For kvm platform, we can use mmio_exit in halt(). For other hypervisors, we can use WFI, and set HCR_TWI in hypervisor side :)

By the way, can you help to review https://github.com/google/gvisor/pull/5177 ? Later, I will submit 2 PR-s related to lazy-usr-fp and clean code to enhance the performance and stability. Thanks.