gem5 v24.0.0.0
|
KVM parent interface. More...
#include <vm.hh>
Public Member Functions | |
virtual | ~Kvm () |
Kvm * | create () |
int | getAPIVersion () const |
Get the version of the KVM API implemented by the kernel. | |
int | getVCPUMMapSize () const |
Get the size of the MMAPed parameter area used to communicate vCPU parameters between the kernel and userspace. | |
bool | capUserMemory () const |
Support for KvmVM::setUserMemoryRegion() | |
bool | capSetTSSAddress () const |
Support for KvmVM::setTSSAddress() | |
bool | capExtendedCPUID () const |
Support for BaseKvmCPU::setCPUID2 and getSupportedCPUID(). | |
bool | capUserNMI () const |
Support for BaseKvmCPU::kvmNonMaskableInterrupt(). | |
int | capCoalescedMMIO () const |
Check if coalesced MMIO is supported and which page in the MMAP'ed structure it stores requests in. | |
int | capNumMemSlots () const |
Attempt to determine how many memory slots are available. | |
bool | capOneReg () const |
Support for reading and writing single registers. | |
bool | capIRQChip () const |
Support for creating an in-kernel IRQ chip model. | |
bool | capVCPUEvents () const |
Support for getting and setting the kvm_vcpu_events structure. | |
bool | capDebugRegs () const |
Support for getting and setting the kvm_debugregs structure. | |
bool | capXCRs () const |
Support for getting and setting the x86 XCRs. | |
bool | capXSave () const |
Support for getting and setting the kvm_xsave structure. | |
bool | capIRQLineLayout2 () const |
Support for ARM IRQ line layout 2. | |
Protected Member Functions | |
int | checkExtension (int extension) const |
Check for the presence of an extension to the KVM API. | |
int | ioctl (int request, long p1) const |
Main VM ioctl interface. | |
int | ioctl (int request, void *p1) const |
int | ioctl (int request) const |
Private Member Functions | |
Kvm () | |
Kvm (const Kvm &kvm) | |
Kvm & | operator= (const Kvm &kvm) |
int | createVM () |
Create a KVM Virtual Machine. | |
Private Attributes | |
int | kvmFD |
KVM VM file descriptor. | |
int | apiVersion |
KVM API version. | |
int | vcpuMMapSize |
Size of the MMAPed vCPU parameter area. | |
Static Private Attributes | |
static Kvm * | instance = NULL |
Singleton instance. | |
Friends | |
class | KvmVM |
KVM parent interface.
The main Kvm object is used to provide functionality that is not specific to a VM or CPU. For example, it allows checking of the optional features and creation of VM containers.
|
private |
Definition at line 71 of file vm.cc.
References apiVersion, fatal, ioctl(), kvmFD, panic, vcpuMMapSize, and warn_once.
Referenced by create().
|
private |
int gem5::Kvm::capCoalescedMMIO | ( | ) | const |
Check if coalesced MMIO is supported and which page in the MMAP'ed structure it stores requests in.
Definition at line 136 of file vm.cc.
References checkExtension().
Referenced by gem5::BaseKvmCPU::startup().
bool gem5::Kvm::capDebugRegs | ( | ) | const |
Support for getting and setting the kvm_debugregs structure.
Definition at line 178 of file vm.cc.
References checkExtension().
Referenced by gem5::X86KvmCPU::init().
bool gem5::Kvm::capExtendedCPUID | ( | ) | const |
Support for BaseKvmCPU::setCPUID2 and getSupportedCPUID().
Definition at line 120 of file vm.cc.
References checkExtension().
Referenced by gem5::X86KvmCPU::init().
bool gem5::Kvm::capIRQChip | ( | ) | const |
Support for creating an in-kernel IRQ chip model.
Definition at line 162 of file vm.cc.
References checkExtension().
bool gem5::Kvm::capIRQLineLayout2 | ( | ) | const |
Support for ARM IRQ line layout 2.
Definition at line 208 of file vm.cc.
References checkExtension().
Referenced by gem5::KvmKernelGic::setIntState().
int gem5::Kvm::capNumMemSlots | ( | ) | const |
Attempt to determine how many memory slots are available.
If it can't be determined, this function returns 0.
Definition at line 142 of file vm.cc.
References checkExtension().
Referenced by gem5::KvmVM::KvmVM().
bool gem5::Kvm::capOneReg | ( | ) | const |
Support for reading and writing single registers.
Definition at line 152 of file vm.cc.
References checkExtension().
bool gem5::Kvm::capSetTSSAddress | ( | ) | const |
Support for KvmVM::setTSSAddress()
Definition at line 114 of file vm.cc.
References checkExtension().
Referenced by gem5::X86KvmCPU::init().
bool gem5::Kvm::capUserMemory | ( | ) | const |
Support for KvmVM::setUserMemoryRegion()
Definition at line 108 of file vm.cc.
References checkExtension().
bool gem5::Kvm::capUserNMI | ( | ) | const |
Support for BaseKvmCPU::kvmNonMaskableInterrupt().
Definition at line 126 of file vm.cc.
References checkExtension().
Referenced by gem5::X86KvmCPU::init().
bool gem5::Kvm::capVCPUEvents | ( | ) | const |
Support for getting and setting the kvm_vcpu_events structure.
Definition at line 168 of file vm.cc.
References checkExtension().
Referenced by gem5::X86KvmCPU::init().
bool gem5::Kvm::capXCRs | ( | ) | const |
Support for getting and setting the x86 XCRs.
Definition at line 188 of file vm.cc.
References checkExtension().
Referenced by gem5::X86KvmCPU::init().
bool gem5::Kvm::capXSave | ( | ) | const |
Support for getting and setting the kvm_xsave structure.
Definition at line 198 of file vm.cc.
References checkExtension().
Referenced by gem5::X86KvmCPU::init().
|
protected |
Check for the presence of an extension to the KVM API.
The return value depends on the extension, but is always zero if it is unsupported or positive otherwise. Some extensions use the return value provide additional data about the extension.
Definition at line 287 of file vm.cc.
References ioctl(), and panic.
Referenced by capCoalescedMMIO(), capDebugRegs(), capExtendedCPUID(), capIRQChip(), capIRQLineLayout2(), capNumMemSlots(), capOneReg(), capSetTSSAddress(), capUserMemory(), capUserNMI(), capVCPUEvents(), capXCRs(), and capXSave().
|
private |
|
inline |
Get the version of the KVM API implemented by the kernel.
Definition at line 90 of file vm.hh.
References apiVersion.
|
inline |
Get the size of the MMAPed parameter area used to communicate vCPU parameters between the kernel and userspace.
This area, amongst other things, contains the kvm_run data structure.
Definition at line 96 of file vm.hh.
References vcpuMMapSize.
Referenced by gem5::BaseKvmCPU::startup().
|
private |
|
staticprivate |
|
private |
|
private |
Size of the MMAPed vCPU parameter area.
Definition at line 269 of file vm.hh.
Referenced by getVCPUMMapSize(), and Kvm().