Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ring0: set PhysicalAddressBits only when uninitialized
Currently ring0.PhysicalAddressBits will be set in ring0.Init() even if it has already been initialized elsewhere. For example, when compiling runsc with cgo enabled, function init() of the package kvm(machine_cgo.go) sets this variable. And this value would be updated by ring0.Init() when creating a new KVM context. If two values are inconsistent, the sandbox would panic during later memory region setting. This patch fixes it by checking the PhysicalAddressBits in ring0.Init() and setting the value only if it is uninitialized. Signed-off-by: Tianyu Zhou <[email protected]>
- Loading branch information