gem5  v22.0.0.2
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
gem5::KvmKernelGicV2 Class Reference

#include <gic.hh>

Inheritance diagram for gem5::KvmKernelGicV2:
gem5::KvmKernelGic gem5::GicV2Registers

Public Member Functions

 KvmKernelGicV2 (KvmVM &vm, const MuxingKvmGicV2Params &params)
 Instantiate a KVM in-kernel GICv2 model. More...
 
uint32_t readDistributor (ContextID ctx, Addr daddr) override
 
uint32_t readCpu (ContextID ctx, Addr daddr) override
 
void writeDistributor (ContextID ctx, Addr daddr, uint32_t data) override
 
void writeCpu (ContextID ctx, Addr daddr, uint32_t data) override
 
- Public Member Functions inherited from gem5::KvmKernelGic
 KvmKernelGic (KvmVM &vm, uint32_t dev, unsigned it_lines)
 Instantiate a KVM in-kernel GIC model. More...
 
virtual ~KvmKernelGic ()
 
 KvmKernelGic (const KvmKernelGic &other)=delete
 
 KvmKernelGic (const KvmKernelGic &&other)=delete
 
KvmKernelGicoperator= (const KvmKernelGic &&rhs)=delete
 
KvmKernelGicoperator= (const KvmKernelGic &rhs)=delete
 
virtual void init ()
 
void setSPI (unsigned spi)
 Raise a shared peripheral interrupt. More...
 
void clearSPI (unsigned spi)
 Clear a shared peripheral interrupt. More...
 
void setPPI (unsigned vcpu, unsigned ppi)
 Raise a private peripheral interrupt. More...
 
void clearPPI (unsigned vcpu, unsigned ppi)
 Clear a private peripheral interrupt. More...
 

Protected Member Functions

uint32_t getGicReg (unsigned group, unsigned vcpu, unsigned offset)
 Get value of GIC register "from" a cpu. More...
 
void setGicReg (unsigned group, unsigned vcpu, unsigned offset, unsigned value)
 Set value of GIC register "from" a cpu. More...
 
- Protected Member Functions inherited from gem5::KvmKernelGic
void setIntState (unsigned type, unsigned vcpu, unsigned irq, bool high)
 Update the kernel's VGIC interrupt state. More...
 

Private Attributes

const AddrRange cpuRange
 Address range for the CPU interfaces. More...
 
const AddrRange distRange
 Address range for the distributor. More...
 

Additional Inherited Members

- Static Protected Member Functions inherited from gem5::GicV2Registers
static void copyDistRegister (GicV2Registers *from, GicV2Registers *to, ContextID ctx, Addr daddr)
 
static void copyCpuRegister (GicV2Registers *from, GicV2Registers *to, ContextID ctx, Addr daddr)
 
static void copyBankedDistRange (System *sys, GicV2Registers *from, GicV2Registers *to, Addr daddr, size_t size)
 
static void clearBankedDistRange (System *sys, GicV2Registers *to, Addr daddr, size_t size)
 
static void copyDistRange (GicV2Registers *from, GicV2Registers *to, Addr daddr, size_t size)
 
static void clearDistRange (GicV2Registers *to, Addr daddr, size_t size)
 
- Protected Attributes inherited from gem5::KvmKernelGic
KvmVMvm
 KVM VM in the parent system. More...
 
KvmDevice kdev
 Kernel interface to the GIC. More...
 

Detailed Description

Definition at line 140 of file gic.hh.

Constructor & Destructor Documentation

◆ KvmKernelGicV2()

gem5::KvmKernelGicV2::KvmKernelGicV2 ( KvmVM vm,
const MuxingKvmGicV2Params &  params 
)

Instantiate a KVM in-kernel GICv2 model.

This constructor instantiates an in-kernel GICv2 model and wires it up to the virtual memory system.

Parameters
vmKVM VM representing this system
paramsMuxingKvmGicV2 params

Definition at line 115 of file gic.cc.

References gem5::KvmKernelGic::kdev, gem5::VegaISA::p, and gem5::KvmDevice::setAttr().

Member Function Documentation

◆ getGicReg()

uint32_t gem5::KvmKernelGicV2::getGicReg ( unsigned  group,
unsigned  vcpu,
unsigned  offset 
)
protected

Get value of GIC register "from" a cpu.

Parameters
groupDistributor or CPU (KVM_DEV_ARM_VGIC_GRP_{DIST,CPU}_REGS)
vcpuCPU id within KVM
offsetregister offset

Definition at line 128 of file gic.cc.

References gem5::ArmISA::attr, gem5::KvmDevice::getAttrPtr(), gem5::KvmKernelGic::kdev, gem5::ArmISA::offset, and gem5::X86ISA::reg.

Referenced by readCpu(), and readDistributor().

◆ readCpu()

uint32_t gem5::KvmKernelGicV2::readCpu ( ContextID  ctx,
Addr  daddr 
)
overridevirtual

Implements gem5::GicV2Registers.

Definition at line 163 of file gic.cc.

References gem5::KvmVM::contextIdToVCpuId(), getGicReg(), and gem5::KvmKernelGic::vm.

◆ readDistributor()

uint32_t gem5::KvmKernelGicV2::readDistributor ( ContextID  ctx,
Addr  daddr 
)
overridevirtual

Implements gem5::GicV2Registers.

Definition at line 156 of file gic.cc.

References gem5::KvmVM::contextIdToVCpuId(), getGicReg(), and gem5::KvmKernelGic::vm.

◆ setGicReg()

void gem5::KvmKernelGicV2::setGicReg ( unsigned  group,
unsigned  vcpu,
unsigned  offset,
unsigned  value 
)
protected

Set value of GIC register "from" a cpu.

Parameters
groupDistributor or CPU (KVM_DEV_ARM_VGIC_GRP_{DIST,CPU}_REGS)
vcpuCPU id within KVM
offsetregister offset
valuevalue to set register to

Definition at line 142 of file gic.cc.

References gem5::ArmISA::attr, gem5::KvmKernelGic::kdev, gem5::ArmISA::offset, gem5::X86ISA::reg, and gem5::KvmDevice::setAttrPtr().

Referenced by writeCpu(), and writeDistributor().

◆ writeCpu()

void gem5::KvmKernelGicV2::writeCpu ( ContextID  ctx,
Addr  daddr,
uint32_t  data 
)
overridevirtual

Implements gem5::GicV2Registers.

Definition at line 177 of file gic.cc.

References gem5::KvmVM::contextIdToVCpuId(), data, setGicReg(), and gem5::KvmKernelGic::vm.

◆ writeDistributor()

void gem5::KvmKernelGicV2::writeDistributor ( ContextID  ctx,
Addr  daddr,
uint32_t  data 
)
overridevirtual

Implements gem5::GicV2Registers.

Definition at line 170 of file gic.cc.

References gem5::KvmVM::contextIdToVCpuId(), data, setGicReg(), and gem5::KvmKernelGic::vm.

Member Data Documentation

◆ cpuRange

const AddrRange gem5::KvmKernelGicV2::cpuRange
private

Address range for the CPU interfaces.

Definition at line 186 of file gic.hh.

◆ distRange

const AddrRange gem5::KvmKernelGicV2::distRange
private

Address range for the distributor.

Definition at line 188 of file gic.hh.


The documentation for this class was generated from the following files:

Generated on Thu Jul 28 2022 13:33:06 for gem5 by doxygen 1.8.17