gem5 v24.0.0.0
|
#include "arch/x86/kvm/x86_cpu.hh"
#include <linux/kvm.h>
#include <algorithm>
#include <cerrno>
#include <memory>
#include "arch/x86/cpuid.hh"
#include "arch/x86/faults.hh"
#include "arch/x86/interrupts.hh"
#include "arch/x86/isa.hh"
#include "arch/x86/regs/float.hh"
#include "arch/x86/regs/int.hh"
#include "arch/x86/regs/msr.hh"
#include "arch/x86/utility.hh"
#include "base/bitunion.hh"
#include "base/compiler.hh"
#include "cpu/kvm/base.hh"
#include "debug/Drain.hh"
#include "debug/Kvm.hh"
#include "debug/KvmContext.hh"
#include "debug/KvmIO.hh"
#include "debug/KvmInt.hh"
Go to the source code of this file.
Classes | |
struct | gem5::FXSave |
Namespaces | |
namespace | gem5 |
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved. | |
Macros | |
#define | MSR_TSC 0x10 |
#define | IO_PCI_CONF_ADDR 0xCF8 |
#define | IO_PCI_CONF_DATA_BASE 0xCFC |
#define | SEG_SYS_TYPE_TSS_AVAILABLE 9 |
#define | SEG_SYS_TYPE_TSS_BUSY 11 |
#define | SEG_CS_TYPE_ACCESSED 9 |
#define | SEG_CS_TYPE_READ_ACCESSED 11 |
#define | SEG_TYPE_BIT_ACCESSED 1 |
#define | BIT(nr) (1UL << (nr)) |
#define | FOREACH_IREG() |
#define | FOREACH_SREG() |
#define | FOREACH_DREG() |
#define | FOREACH_SEGMENT() |
#define | FOREACH_DTABLE() |
#define | APPLY_IREG(kreg, mreg) inform("\t" # kreg ": 0x%llx\n", regs.kreg) |
#define | APPLY_SREG(kreg, mreg) inform("\t" # kreg ": 0x%llx\n", sregs.kreg); |
#define | APPLY_SEGMENT(kreg, idx) dumpKvm(# kreg, sregs.kreg); |
#define | APPLY_DTABLE(kreg, idx) dumpKvm(# kreg, sregs.kreg); |
#define | APPLY_IREG(kreg, mreg) regs.kreg = tc->getReg(mreg) |
#define | APPLY_SREG(kreg, mreg) sregs.kreg = tc->readMiscRegNoEffect(mreg) |
#define | APPLY_SEGMENT(kreg, idx) setKvmSegmentReg(tc, sregs.kreg, idx) |
#define | APPLY_DTABLE(kreg, idx) setKvmDTableReg(tc, sregs.kreg, idx) |
#define | APPLY_SEGMENT(kreg, idx) checkSeg(# kreg, idx + misc_reg::SegSelBase, sregs.kreg, sregs) |
#define | APPLY_IREG(kreg, mreg) tc->setReg(mreg, regs.kreg) |
#define | APPLY_SREG(kreg, mreg) tc->setMiscRegNoEffect(mreg, sregs.kreg) |
#define | APPLY_SEGMENT(kreg, idx) setContextSegment(tc, sregs.kreg, idx) |
#define | APPLY_DTABLE(kreg, idx) setContextSegment(tc, sregs.kreg, idx) |
Functions | |
gem5::BitUnion64 (XStateBV) Bitfield< 0 > fpu | |
gem5::EndBitUnion (XStateBV) struct XSaveHeader | |
template<typename Struct , typename Entry > | |
static auto | gem5::newVarStruct (size_t entries) |
static void | gem5::dumpKvm (const struct kvm_regs ®s) |
static void | gem5::dumpKvm (const char *reg_name, const struct kvm_segment &seg) |
static void | gem5::dumpKvm (const char *reg_name, const struct kvm_dtable &dtable) |
static void | gem5::dumpKvm (const struct kvm_sregs &sregs) |
static void | gem5::dumpFpuSpec (const struct FXSave &xs) |
static void | gem5::dumpFpuSpec (const struct kvm_fpu &fpu) |
template<typename T > | |
static void | gem5::dumpFpuCommon (const T &fpu) |
static void | gem5::dumpKvm (const struct kvm_fpu &fpu) |
static void | gem5::dumpKvm (const struct kvm_xsave &xsave) |
static void | gem5::dumpKvm (const struct kvm_msrs &msrs) |
static void | gem5::dumpKvm (const struct kvm_xcrs ®s) |
static void | gem5::dumpKvm (const struct kvm_vcpu_events &events) |
static bool | gem5::isCanonicalAddress (uint64_t addr) |
static void | gem5::checkSeg (const char *name, const int idx, const struct kvm_segment &seg, struct kvm_sregs sregs) |
static void | gem5::setKvmSegmentReg (ThreadContext *tc, struct kvm_segment &kvm_seg, const int index) |
static void | gem5::setKvmDTableReg (ThreadContext *tc, struct kvm_dtable &kvm_dtable, const int index) |
static void | gem5::forceSegAccessed (struct kvm_segment &seg) |
template<typename T > | |
static void | gem5::updateKvmStateFPUCommon (ThreadContext *tc, T &fpu) |
void | gem5::setContextSegment (ThreadContext *tc, const struct kvm_segment &kvm_seg, const int index) |
void | gem5::setContextSegment (ThreadContext *tc, const struct kvm_dtable &kvm_dtable, const int index) |
template<typename T > | |
static void | gem5::updateThreadContextFPUCommon (ThreadContext *tc, const T &fpu) |
static struct kvm_cpuid_entry2 | gem5::makeKvmCpuid (uint32_t function, uint32_t index, CpuidResult &result, uint32_t flags=0) |
Variables | |
Bitfield< 1 > | gem5::sse |
Bitfield< 2 > | gem5::avx |
Bitfield< 4, 3 > | gem5::mpx |
Bitfield< 7, 5 > | gem5::avx512 |
Bitfield< 8 > | gem5::pt |
Bitfield< 9 > | gem5::pkru |
Bitfield< 10 > | gem5::pasid |
Bitfield< 12, 11 > | gem5::cet |
Bitfield< 13 > | gem5::hdc |
Bitfield< 14 > | gem5::uintr |
Bitfield< 15 > | gem5::lbr |
Bitfield< 16 > | gem5::hwp |
Bitfield< 18, 17 > | gem5::amx |
Bitfield< 63, 19 > | gem5::reserved |
#define APPLY_DTABLE | ( | kreg, | |
idx ) dumpKvm(# kreg, sregs.kreg); |
#define APPLY_DTABLE | ( | kreg, | |
idx ) setKvmDTableReg(tc, sregs.kreg, idx) |
#define APPLY_DTABLE | ( | kreg, | |
idx ) setContextSegment(tc, sregs.kreg, idx) |
#define APPLY_IREG | ( | kreg, | |
mreg ) inform("\t" # kreg ": 0x%llx\n", regs.kreg) |
#define APPLY_IREG | ( | kreg, | |
mreg ) regs.kreg = tc->getReg(mreg) |
#define APPLY_IREG | ( | kreg, | |
mreg ) tc->setReg(mreg, regs.kreg) |
#define APPLY_SEGMENT | ( | kreg, | |
idx ) dumpKvm(# kreg, sregs.kreg); |
#define APPLY_SEGMENT | ( | kreg, | |
idx ) setKvmSegmentReg(tc, sregs.kreg, idx) |
#define APPLY_SEGMENT | ( | kreg, | |
idx ) checkSeg(# kreg, idx + misc_reg::SegSelBase, sregs.kreg, sregs) |
#define APPLY_SEGMENT | ( | kreg, | |
idx ) setContextSegment(tc, sregs.kreg, idx) |
#define APPLY_SREG | ( | kreg, | |
mreg ) inform("\t" # kreg ": 0x%llx\n", sregs.kreg); |
#define APPLY_SREG | ( | kreg, | |
mreg ) sregs.kreg = tc->readMiscRegNoEffect(mreg) |
#define APPLY_SREG | ( | kreg, | |
mreg ) tc->setMiscRegNoEffect(mreg, sregs.kreg) |
#define BIT | ( | nr | ) | (1UL << (nr)) |
Definition at line 81 of file x86_cpu.cc.
#define FOREACH_DREG | ( | ) |
Definition at line 178 of file x86_cpu.cc.
#define FOREACH_DTABLE | ( | ) |
Definition at line 200 of file x86_cpu.cc.
Referenced by gem5::dumpKvm(), gem5::X86KvmCPU::updateKvmStateSRegs(), and gem5::X86KvmCPU::updateThreadContextSRegs().
#define FOREACH_IREG | ( | ) |
Definition at line 147 of file x86_cpu.cc.
Referenced by gem5::dumpKvm(), gem5::X86KvmCPU::updateKvmStateRegs(), and gem5::X86KvmCPU::updateThreadContextRegs().
#define FOREACH_SEGMENT | ( | ) |
Definition at line 188 of file x86_cpu.cc.
Referenced by gem5::dumpKvm(), gem5::X86KvmCPU::updateKvmStateSRegs(), and gem5::X86KvmCPU::updateThreadContextSRegs().
#define FOREACH_SREG | ( | ) |
Definition at line 167 of file x86_cpu.cc.
Referenced by gem5::dumpKvm(), gem5::X86KvmCPU::updateKvmStateSRegs(), and gem5::X86KvmCPU::updateThreadContextSRegs().
#define IO_PCI_CONF_ADDR 0xCF8 |
Definition at line 61 of file x86_cpu.cc.
Referenced by gem5::X86KvmCPU::handleKvmExitIO().
#define IO_PCI_CONF_DATA_BASE 0xCFC |
Definition at line 62 of file x86_cpu.cc.
Referenced by gem5::X86KvmCPU::handleKvmExitIO().
#define MSR_TSC 0x10 |
Definition at line 59 of file x86_cpu.cc.
Referenced by gem5::X86KvmCPU::getHostCycles().
#define SEG_CS_TYPE_ACCESSED 9 |
Definition at line 70 of file x86_cpu.cc.
Referenced by gem5::X86KvmCPU::updateKvmStateSRegs().
#define SEG_CS_TYPE_READ_ACCESSED 11 |
Definition at line 72 of file x86_cpu.cc.
Referenced by gem5::X86KvmCPU::updateKvmStateSRegs().
#define SEG_SYS_TYPE_TSS_AVAILABLE 9 |
Definition at line 65 of file x86_cpu.cc.
Referenced by gem5::X86KvmCPU::updateKvmStateSRegs().
#define SEG_SYS_TYPE_TSS_BUSY 11 |
Definition at line 67 of file x86_cpu.cc.
Referenced by gem5::X86KvmCPU::updateKvmStateSRegs().
#define SEG_TYPE_BIT_ACCESSED 1 |
Definition at line 76 of file x86_cpu.cc.
Referenced by gem5::forceSegAccessed().