Go to the documentation of this file.
39 #ifndef __CPU_KVM_KVMVM_HH__
40 #define __CPU_KVM_KVMVM_HH__
142 #if defined(__i386__) || defined(__x86_64__)
159 bool getSupportedCPUID(
struct kvm_cpuid2 &
cpuid)
const;
171 const CPUIDVector &getSupportedCPUID()
const;
178 bool getSupportedMSRs(
struct kvm_msr_list &msrs)
const;
188 const MSRIndexVector &getSupportedMSRs()
const;
192 mutable CPUIDVector supportedCPUIDCache;
195 mutable MSRIndexVector supportedMSRCache;
227 int ioctl(
int request,
long p1)
const;
228 int ioctl(
int request,
void *p1)
const {
229 return ioctl(request, (
long)p1);
232 return ioctl(request, 0
L);
421 #if defined(__aarch64__)
434 void kvmArmPreferredTarget(
struct kvm_vcpu_init &target)
const;
474 void *host_addr,
Addr guest_addr,
475 uint64_t
len, uint32_t flags);
509 int ioctl(
int request,
long p1)
const;
510 int ioctl(
int request,
void *p1)
const {
511 return ioctl(request, (
long)p1);
514 return ioctl(request, 0
L);
Kvm * kvm
Global KVM interface.
static Kvm * instance
Singleton instance.
bool capUserMemory() const
Support for KvmVM::setUserMemoryRegion()
bool capXCRs() const
Support for getting and setting the x86 XCRs.
int getVCPUMMapSize() const
Get the size of the MMAPed parameter area used to communicate vCPU parameters between the kernel and ...
int ioctl(int request, void *p1) const
int capNumMemSlots() const
Attempt to determine how many memory slots are available.
int ioctl(int request) const
bool _hasKernelIRQChip
Do we have in-kernel IRQ-chip emulation enabled?
Kvm & operator=(const Kvm &kvm)
int ContextID
Globally unique thread context ID.
void freeMemSlot(const MemSlot slot)
Free a previously allocated memory slot.
int ioctl(int request, void *p1) const
const MemSlot allocMemSlot(uint64_t size)
Allocate a memory slot within the VM.
bool capDebugRegs() const
Support for getting and setting the kvm_debugregs structure.
void delayedStartup()
Delayed initialization, executed once before the first CPU starts.
int checkExtension(int extension) const
Check for the presence of an extension to the KVM API.
void enableKernelIRQChip()
Tell the VM and VCPUs to use an in-kernel IRQ chip for interrupt delivery.
long contextIdToVCpuId(ContextID ctx) const
Get the VCPUID for a given context.
void cpuStartup()
VM CPU initialization code.
bool capSetTSSAddress() const
Support for KvmVM::setTSSAddress()
Structures tracking memory slots.
KvmVM(KvmVMParams *params)
int vcpuMMapSize
Size of the MMAPed vCPU parameter area.
long nextVCPUID
Next unallocated vCPU ID.
int createVCPU(long vcpuID)
Create a new vCPU within a VM.
void coalesceMMIO(Addr start, int size)
Request coalescing MMIO for a memory range.
Base class for KVM based CPU models.
int ioctl(int request) const
int ioctl(int request, long p1) const
Main VM ioctl interface.
bool capOneReg() const
Support for reading and writing single registers.
The AddrRange class encapsulates an address range, and supports a number of tests to check if two ran...
int kvmFD
KVM VM file descriptor.
void setSystem(System *s)
Initialize system pointer.
int createDevice(uint32_t type, uint32_t flags=0)
Create an in-kernel device model.
void setUserMemoryRegion(uint32_t slot, void *host_addr, Addr guest_addr, uint64_t len, uint32_t flags)
Setup a region of physical memory in the guest.
int apiVersion
KVM API version.
int getAPIVersion() const
Get the version of the KVM API implemented by the kernel.
int capCoalescedMMIO() const
Check if coalesced MMIO is supported and which page in the MMAP'ed structure it stores requests in.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
const Params * params() const
int createVM()
Create a KVM Virtual Machine.
void createIRQChip()
Create an in-kernel interrupt controller.
bool started
Has delayedStartup() already been called?
bool capUserNMI() const
Support for BaseKvmCPU::kvmNonMaskableInterrupt().
void disableMemSlot(const MemSlot slot)
Disable a memory slot.
void setIRQLine(uint32_t irq, bool high)
Set the status of an IRQ line using KVM_IRQ_LINE.
int vmFD
KVM VM file descriptor.
void setTSSAddress(Addr tss_address)
Setup a shared three-page memory region used by the internals of KVM.
bool hasKernelIRQChip() const
Is in-kernel IRQ chip emulation enabled?
int ioctl(int request, long p1) const
KVM VM ioctl interface.
void setupMemSlot(const MemSlot slot, void *host_addr, Addr guest_addr, uint32_t flags)
Setup a region of physical memory in the guest.
bool capXSave() const
Support for getting and setting the kvm_xsave structure.
bool capExtendedCPUID() const
Support for BaseKvmCPU::setCPUID2 and getSupportedCPUID().
KvmVM & operator=(const KvmVM &vm)
long allocVCPUID()
Allocate a new vCPU ID within the VM.
std::vector< MemorySlot > memorySlots
void notifyFork()
Notify a child process of a fork.
bool capIRQChip() const
Support for creating an in-kernel IRQ chip model.
Abstract superclass for simulation objects.
bool capVCPUEvents() const
Support for getting and setting the kvm_vcpu_events structure.
Generated on Wed Sep 30 2020 14:02:08 for gem5 by doxygen 1.8.17