gem5
|
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. More... | |
int | getVCPUMMapSize () const |
Get the size of the MMAPed parameter area used to communicate vCPU parameters between the kernel and userspace. More... | |
bool | capUserMemory () const |
Support for KvmVM::setUserMemoryRegion() More... | |
bool | capSetTSSAddress () const |
Support for KvmVM::setTSSAddress() More... | |
bool | capExtendedCPUID () const |
Support for BaseKvmCPU::setCPUID2 and getSupportedCPUID(). More... | |
bool | capUserNMI () const |
Support for BaseKvmCPU::kvmNonMaskableInterrupt(). More... | |
int | capCoalescedMMIO () const |
Check if coalesced MMIO is supported and which page in the MMAP'ed structure it stores requests in. More... | |
int | capNumMemSlots () const |
Attempt to determine how many memory slots are available. More... | |
bool | capOneReg () const |
Support for reading and writing single registers. More... | |
bool | capIRQChip () const |
Support for creating an in-kernel IRQ chip model. More... | |
bool | capVCPUEvents () const |
Support for getting and setting the kvm_vcpu_events structure. More... | |
bool | capDebugRegs () const |
Support for getting and setting the kvm_debugregs structure. More... | |
bool | capXCRs () const |
Support for getting and setting the x86 XCRs. More... | |
bool | capXSave () const |
Support for getting and setting the kvm_xsave structure. More... | |
Protected Member Functions | |
int | checkExtension (int extension) const |
Check for the presence of an extension to the KVM API. More... | |
int | ioctl (int request, long p1) const |
Main VM ioctl interface. More... | |
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. More... | |
Private Attributes | |
int | kvmFD |
KVM VM file descriptor. More... | |
int | apiVersion |
KVM API version. More... | |
int | vcpuMMapSize |
Size of the MMAPed vCPU parameter area. More... | |
Static Private Attributes | |
static Kvm * | instance = NULL |
Singleton instance. More... | |
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 66 of file vm.cc.
References apiVersion, EXPECTED_KVM_API_VERSION, fatal, ioctl(), kvmFD, panic, and vcpuMMapSize.
Referenced by create().
|
private |
int Kvm::capCoalescedMMIO | ( | ) | const |
Check if coalesced MMIO is supported and which page in the MMAP'ed structure it stores requests in.
Definition at line 125 of file vm.cc.
References checkExtension().
Referenced by BaseKvmCPU::startup().
bool Kvm::capDebugRegs | ( | ) | const |
Support for getting and setting the kvm_debugregs structure.
Definition at line 167 of file vm.cc.
References checkExtension().
Referenced by X86KvmCPU::X86KvmCPU().
bool Kvm::capExtendedCPUID | ( | ) | const |
Support for BaseKvmCPU::setCPUID2 and getSupportedCPUID().
Definition at line 109 of file vm.cc.
References checkExtension().
Referenced by X86KvmCPU::X86KvmCPU().
bool Kvm::capIRQChip | ( | ) | const |
Support for creating an in-kernel IRQ chip model.
Definition at line 151 of file vm.cc.
References checkExtension().
int 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 131 of file vm.cc.
References checkExtension().
Referenced by KvmVM::KvmVM().
bool Kvm::capOneReg | ( | ) | const |
Support for reading and writing single registers.
Definition at line 141 of file vm.cc.
References checkExtension().
bool Kvm::capSetTSSAddress | ( | ) | const |
Support for KvmVM::setTSSAddress()
Definition at line 103 of file vm.cc.
References checkExtension().
Referenced by X86KvmCPU::X86KvmCPU().
bool Kvm::capUserMemory | ( | ) | const |
Support for KvmVM::setUserMemoryRegion()
Definition at line 97 of file vm.cc.
References checkExtension().
bool Kvm::capUserNMI | ( | ) | const |
Support for BaseKvmCPU::kvmNonMaskableInterrupt().
Definition at line 115 of file vm.cc.
References checkExtension().
Referenced by X86KvmCPU::X86KvmCPU().
bool Kvm::capVCPUEvents | ( | ) | const |
Support for getting and setting the kvm_vcpu_events structure.
Definition at line 157 of file vm.cc.
References checkExtension().
Referenced by X86KvmCPU::X86KvmCPU().
bool Kvm::capXCRs | ( | ) | const |
Support for getting and setting the x86 XCRs.
Definition at line 177 of file vm.cc.
References checkExtension().
Referenced by X86KvmCPU::X86KvmCPU().
bool Kvm::capXSave | ( | ) | const |
Support for getting and setting the kvm_xsave structure.
Definition at line 187 of file vm.cc.
References checkExtension().
Referenced by X86KvmCPU::X86KvmCPU().
|
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 265 of file vm.cc.
References ioctl(), and panic.
Referenced by capCoalescedMMIO(), capDebugRegs(), capExtendedCPUID(), capIRQChip(), 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 84 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 90 of file vm.hh.
References vcpuMMapSize.
Referenced by BaseKvmCPU::startup().
|
private |
|
staticprivate |
|
private |
|
private |
Size of the MMAPed vCPU parameter area.
Definition at line 259 of file vm.hh.
Referenced by getVCPUMMapSize(), and Kvm().