// Copyright (c) 2018 Intel Corporation // // SPDX-License-Identifier: Apache-2.0 // package main import ( "github.com/sirupsen/logrus" ) const ( cpuFlagsTag = genericCPUFlagsTag archCPUVendorField = genericCPUVendorField archCPUModelField = genericCPUModelField ) // archRequiredCPUFlags maps a CPU flag value to search for and a // human-readable description of that value. var archRequiredCPUFlags = map[string]string{ "vmx": "Virtualization support", "lm": "64Bit CPU", "sse4_1": "SSE4.1", } // archRequiredCPUAttribs maps a CPU (non-CPU flag) attribute value to search for // and a human-readable description of that value. var archRequiredCPUAttribs = map[string]string{ "GenuineIntel": "Intel Architecture CPU", } // archRequiredKernelModules maps a required module name to a human-readable // description of the modules functionality and an optional list of // required module parameters. var archRequiredKernelModules = map[string]kernelModule{ "kvm": { desc: "Kernel-based Virtual Machine", }, "kvm_intel": { desc: "Intel KVM", parameters: map[string]string{ "nested": "Y", // "VMX Unrestricted mode support". This is used // as a heuristic to determine if the system is // "new enough" to run a Kata Container // (atleast a Westmere). "unrestricted_guest": "Y", }, }, "vhost": { desc: "Host kernel accelerator for virtio", }, "vhost_net": { desc: "Host kernel accelerator for virtio network", }, } // kvmIsUsable determines if it will be possible to create a full virtual machine // by creating a minimal VM and then deleting it. func kvmIsUsable() error { return genericKvmIsUsable() } func archHostCanCreateVMContainer() error { return kvmIsUsable() } // hostIsVMContainerCapable checks to see if the host is theoretically capable // of creating a VM container. func hostIsVMContainerCapable(details vmContainerCapableDetails) error { return genericHostIsVMContainerCapable(details) } func archKernelParamHandler(onVMM bool, fields logrus.Fields, msg string) bool { return genericArchKernelParamHandler(onVMM, fields, msg) } func getCPUDetails() (vendor, model string, err error) { return genericGetCPUDetails() }