// initArchState initializes architecture-specific state.
initArchState initializes architecture-specific state.
// initArchState initializes architecture - specific state .
func (m *machine) initArchState() error {
	if _, _, errno := unix.RawSyscall(
		unix.SYS_IOCTL,
		uintptr(m.fd),
		_KVM_ARM_PREFERRED_TARGET,
		uintptr(unsafe.Pointer(&vcpuInit))); errno != 0 {
		panic(fmt.Sprintf("error setting KVM_ARM_PREFERRED_TARGET failed: %v", errno))
	}
	m.initialvCPUs = make(map[int]*vCPU)
	m.mu.Lock()
	for int(m.nextID) < m.maxVCPUs-1 {
		c := m.newVCPU()
		c.state = 0
		m.initialvCPUs[c.id] = c
	}
	m.mu.Unlock()
	return nil
}
func ( m * machine ) initArchState ( ) error { if _ , _ , errno := unix . RawSyscall ( unix . SYS_IOCTL , uintptr ( m . fd ) , _KVM_ARM_PREFERRED_TARGET , uintptr ( unsafe . Pointer ( & vcpuInit ) ) ) ; errno != 0 { panic ( fmt . Sprintf ( " " , errno ) ) } m . initialvCPUs = make ( map [ int ] * vCPU ) m . mu . Lock ( ) for int ( m . nextID ) < m . maxVCPUs - 1 { c := m . newVCPU ( ) c . state = 0 m . initialvCPUs [ c . id ] = c } m . mu . Unlock ( ) return nil }
initArchState initializes architecture-specific state.
initArchState initializes architecture - specific state .
// Initialize all vCPUs on ARM64, while this does not happen on x86_64. // The reason for the difference is that ARM64 and x86_64 have different KVM timer mechanisms. // If we create vCPU dynamically on ARM64, the timer for vCPU would mess up for a short time. // For more detail, please refer to https://github.com/google/gvisor/issues/5739