gem5
|
#include "arch/arm/kvm/arm_cpu.hh"
#include <linux/kvm.h>
#include <algorithm>
#include <cerrno>
#include <memory>
#include "arch/registers.hh"
#include "cpu/kvm/base.hh"
#include "debug/Kvm.hh"
#include "debug/KvmContext.hh"
#include "debug/KvmInt.hh"
#include "sim/pseudo_inst.hh"
Go to the source code of this file.
Macros | |
#define | EXTRACT_FIELD(val, mask, shift) (((val) & (mask)) >> (shift)) |
#define | REG_IS_ARM(id) (((id) & KVM_REG_ARCH_MASK) == KVM_REG_ARM) |
#define | REG_IS_32BIT(id) (((id) & KVM_REG_SIZE_MASK) == KVM_REG_SIZE_U32) |
#define | REG_IS_64BIT(id) (((id) & KVM_REG_SIZE_MASK) == KVM_REG_SIZE_U64) |
#define | REG_IS_CP(id, cp) (((id) & KVM_REG_ARM_COPROC_MASK) == (cp)) |
#define | REG_IS_CORE(id) REG_IS_CP((id), KVM_REG_ARM_CORE) |
#define | REG_IS_VFP(id) REG_IS_CP((id), KVM_REG_ARM_VFP) |
#define | REG_VFP_REG(id) ((id) & KVM_REG_ARM_VFP_MASK) |
#define | REG_IS_VFP_REG(id) (REG_VFP_REG(id) < 0x100) |
#define | REG_IS_VFP_CTRL(id) (REG_VFP_REG(id) >= 0x100) |
#define | REG_IS_DEMUX(id) REG_IS_CP((id), KVM_REG_ARM_DEMUX) |
#define | REG_CORE_IDX(id) (~(KVM_REG_ARCH_MASK | KVM_REG_SIZE_MASK | KVM_REG_ARM_CORE)) |
#define | REG_CP(id) EXTRACT_FIELD(id, KVM_REG_ARM_COPROC_MASK, KVM_REG_ARM_COPROC_SHIFT) |
#define | REG_CRN(id) EXTRACT_FIELD(id, KVM_REG_ARM_32_CRN_MASK, KVM_REG_ARM_32_CRN_SHIFT) |
#define | REG_OPC1(id) EXTRACT_FIELD(id, KVM_REG_ARM_OPC1_MASK, KVM_REG_ARM_OPC1_SHIFT) |
#define | REG_CRM(id) EXTRACT_FIELD(id, KVM_REG_ARM_CRM_MASK, KVM_REG_ARM_CRM_SHIFT) |
#define | REG_OPC2(id) EXTRACT_FIELD(id, KVM_REG_ARM_32_OPC2_MASK, KVM_REG_ARM_32_OPC2_SHIFT) |
#define | REG_CP32(cpnum, crn, opc1, crm, opc2) |
#define | REG_CP64(cpnum, opc1, crm) |
#define | REG_CORE32(kname) |
#define | REG_VFP32(regno) |
#define | REG_VFP64(regno) |
#define | REG_DEMUX32(dmxid, val) |
#define | INTERRUPT_ID(type, vcpu, irq) |
#define | INTERRUPT_VCPU_IRQ(vcpu) INTERRUPT_ID(KVM_ARM_IRQ_TYPE_CPU, vcpu, KVM_ARM_IRQ_CPU_IRQ) |
#define | INTERRUPT_VCPU_FIQ(vcpu) INTERRUPT_ID(KVM_ARM_IRQ_TYPE_CPU, vcpu, KVM_ARM_IRQ_CPU_FIQ) |
#define | COUNT_OF(l) (sizeof(l) / sizeof(*l)) |
Functions | |
static const uint64_t | KVM_REG64_TTBR0 (REG_CP64(15, 0, 2)) |
static const uint64_t | KVM_REG64_TTBR1 (REG_CP64(15, 1, 2)) |
Variables | |
static uint64_t | invariant_reg_vector [] |
#define COUNT_OF | ( | l | ) | (sizeof(l) / sizeof(*l)) |
Definition at line 188 of file arm_cpu.cc.
Definition at line 57 of file arm_cpu.cc.
Referenced by ArmKvmCPU::dumpKvmStateCoProc(), and ArmKvmCPU::dumpKvmStateMisc().
#define INTERRUPT_ID | ( | type, | |
vcpu, | |||
irq | |||
) |
Definition at line 176 of file arm_cpu.cc.
#define INTERRUPT_VCPU_FIQ | ( | vcpu | ) | INTERRUPT_ID(KVM_ARM_IRQ_TYPE_CPU, vcpu, KVM_ARM_IRQ_CPU_FIQ) |
Definition at line 184 of file arm_cpu.cc.
Referenced by ArmKvmCPU::kvmRun().
#define INTERRUPT_VCPU_IRQ | ( | vcpu | ) | INTERRUPT_ID(KVM_ARM_IRQ_TYPE_CPU, vcpu, KVM_ARM_IRQ_CPU_IRQ) |
Definition at line 181 of file arm_cpu.cc.
Referenced by ArmKvmCPU::kvmRun().
#define REG_CORE32 | ( | kname | ) |
Definition at line 119 of file arm_cpu.cc.
Referenced by ArmKvmCPU::dumpKvmStateCore(), ArmKvmCPU::onKvmExitHypercall(), ArmKvmCPU::updateKvmStateCore(), and ArmKvmCPU::updateTCStateCore().
#define REG_CORE_IDX | ( | id | ) | (~(KVM_REG_ARCH_MASK | KVM_REG_SIZE_MASK | KVM_REG_ARM_CORE)) |
Definition at line 87 of file arm_cpu.cc.
#define REG_CP | ( | id | ) | EXTRACT_FIELD(id, KVM_REG_ARM_COPROC_MASK, KVM_REG_ARM_COPROC_SHIFT) |
Definition at line 90 of file arm_cpu.cc.
Referenced by ArmKvmCPU::decodeCoProcReg(), ArmKvmCPU::dumpKvmStateCoProc(), ArmKvmCPU::dumpKvmStateMisc(), ArmKvmCPU::updateKvmStateCoProc(), ArmKvmCPU::updateKvmStateMisc(), ArmKvmCPU::updateTCStateCoProc(), and ArmKvmCPU::updateTCStateMisc().
#define REG_CP32 | ( | cpnum, | |
crn, | |||
opc1, | |||
crm, | |||
opc2 | |||
) |
Definition at line 105 of file arm_cpu.cc.
#define REG_CP64 | ( | cpnum, | |
opc1, | |||
crm | |||
) |
Definition at line 113 of file arm_cpu.cc.
#define REG_CRM | ( | id | ) | EXTRACT_FIELD(id, KVM_REG_ARM_CRM_MASK, KVM_REG_ARM_CRM_SHIFT) |
Definition at line 99 of file arm_cpu.cc.
Referenced by ArmKvmCPU::decodeCoProcReg(), ArmKvmCPU::dumpKvmStateCoProc(), ArmKvmCPU::updateKvmStateCoProc(), and ArmKvmCPU::updateTCStateCoProc().
#define REG_CRN | ( | id | ) | EXTRACT_FIELD(id, KVM_REG_ARM_32_CRN_MASK, KVM_REG_ARM_32_CRN_SHIFT) |
Definition at line 93 of file arm_cpu.cc.
Referenced by ArmKvmCPU::decodeCoProcReg(), ArmKvmCPU::dumpKvmStateCoProc(), ArmKvmCPU::updateKvmStateCoProc(), and ArmKvmCPU::updateTCStateCoProc().
#define REG_DEMUX32 | ( | dmxid, | |
val | |||
) |
Definition at line 132 of file arm_cpu.cc.
#define REG_IS_32BIT | ( | id | ) | (((id) & KVM_REG_SIZE_MASK) == KVM_REG_SIZE_U32) |
Definition at line 63 of file arm_cpu.cc.
Referenced by ArmKvmCPU::decodeCoProcReg(), ArmKvmCPU::dumpKvmStateCoProc(), ArmKvmCPU::updateKvmStateVFP(), and ArmKvmCPU::updateTCStateVFP().
#define REG_IS_64BIT | ( | id | ) | (((id) & KVM_REG_SIZE_MASK) == KVM_REG_SIZE_U64) |
Definition at line 66 of file arm_cpu.cc.
Referenced by ArmKvmCPU::decodeCoProcReg(), ArmKvmCPU::updateKvmStateCoProc(), ArmKvmCPU::updateKvmStateVFP(), ArmKvmCPU::updateTCStateCoProc(), and ArmKvmCPU::updateTCStateVFP().
#define REG_IS_ARM | ( | id | ) | (((id) & KVM_REG_ARCH_MASK) == KVM_REG_ARM) |
Definition at line 60 of file arm_cpu.cc.
Referenced by ArmKvmCPU::decodeVFPCtrlReg(), ArmKvmCPU::dumpKvmStateCoProc(), ArmKvmCPU::dumpKvmStateMisc(), ArmKvmCPU::dumpKvmStateVFP(), ArmKvmCPU::isInvariantReg(), ArmKvmCPU::updateKvmStateCoProc(), ArmKvmCPU::updateKvmStateMisc(), ArmKvmCPU::updateKvmStateVFP(), ArmKvmCPU::updateTCStateCoProc(), ArmKvmCPU::updateTCStateMisc(), and ArmKvmCPU::updateTCStateVFP().
#define REG_IS_CORE | ( | id | ) | REG_IS_CP((id), KVM_REG_ARM_CORE) |
Definition at line 72 of file arm_cpu.cc.
Referenced by ArmKvmCPU::dumpKvmStateMisc(), ArmKvmCPU::updateKvmStateMisc(), and ArmKvmCPU::updateTCStateMisc().
#define REG_IS_CP | ( | id, | |
cp | |||
) | (((id) & KVM_REG_ARM_COPROC_MASK) == (cp)) |
Definition at line 69 of file arm_cpu.cc.
#define REG_IS_DEMUX | ( | id | ) | REG_IS_CP((id), KVM_REG_ARM_DEMUX) |
Definition at line 81 of file arm_cpu.cc.
Referenced by ArmKvmCPU::dumpKvmStateMisc(), and ArmKvmCPU::isInvariantReg().
#define REG_IS_VFP | ( | id | ) | REG_IS_CP((id), KVM_REG_ARM_VFP) |
Definition at line 74 of file arm_cpu.cc.
Referenced by ArmKvmCPU::decodeVFPCtrlReg(), ArmKvmCPU::dumpKvmStateMisc(), ArmKvmCPU::dumpKvmStateVFP(), ArmKvmCPU::updateKvmStateMisc(), ArmKvmCPU::updateKvmStateVFP(), ArmKvmCPU::updateTCStateMisc(), and ArmKvmCPU::updateTCStateVFP().
#define REG_IS_VFP_CTRL | ( | id | ) | (REG_VFP_REG(id) >= 0x100) |
Definition at line 79 of file arm_cpu.cc.
Referenced by ArmKvmCPU::decodeVFPCtrlReg(), ArmKvmCPU::dumpKvmStateVFP(), ArmKvmCPU::updateKvmStateVFP(), and ArmKvmCPU::updateTCStateVFP().
#define REG_IS_VFP_REG | ( | id | ) | (REG_VFP_REG(id) < 0x100) |
Definition at line 78 of file arm_cpu.cc.
Referenced by ArmKvmCPU::dumpKvmStateVFP(), ArmKvmCPU::updateKvmStateVFP(), and ArmKvmCPU::updateTCStateVFP().
#define REG_OPC1 | ( | id | ) | EXTRACT_FIELD(id, KVM_REG_ARM_OPC1_MASK, KVM_REG_ARM_OPC1_SHIFT) |
Definition at line 96 of file arm_cpu.cc.
Referenced by ArmKvmCPU::decodeCoProcReg(), ArmKvmCPU::dumpKvmStateCoProc(), ArmKvmCPU::updateKvmStateCoProc(), and ArmKvmCPU::updateTCStateCoProc().
#define REG_OPC2 | ( | id | ) | EXTRACT_FIELD(id, KVM_REG_ARM_32_OPC2_MASK, KVM_REG_ARM_32_OPC2_SHIFT) |
Definition at line 102 of file arm_cpu.cc.
Referenced by ArmKvmCPU::decodeCoProcReg(), ArmKvmCPU::dumpKvmStateCoProc(), ArmKvmCPU::updateKvmStateCoProc(), and ArmKvmCPU::updateTCStateCoProc().
#define REG_VFP32 | ( | regno | ) |
Definition at line 124 of file arm_cpu.cc.
#define REG_VFP64 | ( | regno | ) |
Definition at line 128 of file arm_cpu.cc.
#define REG_VFP_REG | ( | id | ) | ((id) & KVM_REG_ARM_VFP_MASK) |
Definition at line 75 of file arm_cpu.cc.
Referenced by ArmKvmCPU::decodeVFPCtrlReg().
|
static |
Referenced by ArmKvmCPU::updateKvmStateCoProc(), and ArmKvmCPU::updateTCStateCoProc().
|
static |
Referenced by ArmKvmCPU::updateKvmStateCoProc(), and ArmKvmCPU::updateTCStateCoProc().
|
static |
Definition at line 139 of file arm_cpu.cc.