31 #ifndef __CPU_KVM_X86_CPU_HH__
32 #define __CPU_KVM_X86_CPU_HH__
36 #include "params/X86KvmCPU.hh"
50 void dump()
const override;
103 void setMSRs(
const struct kvm_msrs &msrs);
105 void getMSRs(
struct kvm_msrs &msrs)
const;
127 void getXCRs(
struct kvm_xcrs ®s)
const;
128 void setXCRs(
const struct kvm_xcrs ®s);
129 void getXSave(
struct kvm_xsave &xsave)
const;
130 void setXSave(
const struct kvm_xsave &xsave);
213 const struct kvm_sregs &sregs);
void handleIOMiscReg32(int miscreg)
Handle a 32-bit IO access that should be mapped to a MiscReg.
void setXCRs(const struct kvm_xcrs ®s)
void setMSRs(const struct kvm_msrs &msrs)
Methods to access MSRs in the guest.
void setDebugRegisters(const struct kvm_debugregs ®s)
void deliverInterrupts()
Inject pending interrupts from gem5 into the virtual CPU.
bool haveXSave
Kvm::capXSave() available?
void updateKvmStateFPUXSave()
Update FPU and SIMD registers using the XSave API.
Tick handleKvmExitIRQWindowOpen() override
The guest exited because an interrupt window was requested.
void updateKvmStateRegs()
Support routines to update the state of the KVM CPU from gem5's state representation.
void setVCpuEvents(const struct kvm_vcpu_events &events)
void updateThreadContextFPU(const struct kvm_fpu &fpu)
Update FPU and SIMD registers using the legacy API.
uint64_t getMSR(uint32_t index) const
void dumpDebugRegs() const
void setCPUID(const struct kvm_cpuid2 &cpuid)
Methods to access CPUID information using the extended API.
void updateThreadContextSRegs(const struct kvm_sregs &sregs)
Update control registers (CRx, segments, etc.)
Base class for KVM based CPU models.
void getMSRs(struct kvm_msrs &msrs) const
void updateKvmState() override
Update the KVM state from the current thread context.
void getVCpuEvents(struct kvm_vcpu_events &events) const
void dump() const override
Dump the internal state to the terminal.
bool archIsDrained() const override
Check if there are pending events in the vCPU that prevents it from being drained.
uint64_t Tick
Tick count type.
void updateCPUID()
Transfer gem5's CPUID values into the virtual CPU.
const Kvm::MSRIndexVector & getMsrIntersection() const
Get a list of MSRs supported by both gem5 and KVM.
void dumpVCpuEvents() const
void updateKvmStateFPU()
Update FPU and SIMD registers.
void updateThreadContextMSRs()
Update MSR registers.
void updateThreadContextRegs(const struct kvm_regs ®s, const struct kvm_sregs &sregs)
Support routines to update the state of gem5's thread context from KVM's state representation.
void setMSR(uint32_t index, uint64_t value)
void updateKvmStateSRegs()
Update control registers (CRx, segments, etc.)
Tick handleKvmExitIO() override
Handle x86 legacy IO (in/out)
bool useXSave
Should the XSave interface be used to sync the FPU and SIMD registers?
void getXSave(struct kvm_xsave &xsave) const
void getDebugRegisters(struct kvm_debugregs ®s) const
Wrappers around KVM's state transfer methods.
void setXSave(const struct kvm_xsave &xsave)
std::vector< struct kvm_msr_entry > KvmMSRVector
uint64_t getHostCycles() const override
Get the value of the hardware cycle counter in the guest.
void getXCRs(struct kvm_xcrs ®s) const
Tick kvmRunDrain() override
Run the virtual CPU until draining completes.
void updateThreadContext() override
Update the current thread context with the KVM state.
Tick kvmRunWrapper(Tick ticks)
Wrapper that synchronizes state in kvm_run.
void updateKvmStateMSRs()
Update MSR registers.
Tick kvmRun(Tick ticks) override
Request KVM to run the guest for a given number of ticks.
void updateKvmStateFPULegacy()
Update FPU and SIMD registers using the legacy API.
void updateThreadContextXSave(const struct kvm_xsave &kxsave)
Update FPU and SIMD registers using the XSave API.
bool haveXCRs
Kvm::capXCRs() available?
X86KvmCPU(X86KvmCPUParams *params)
void dumpSpecRegs() const
bool haveDebugRegs
Kvm::capDebugRegs() available?
x86 implementation of a KVM-based hardware virtualized CPU.
Kvm::MSRIndexVector cachedMsrIntersection
Cached intersection of supported MSRs.