gem5 v24.0.0.0
Loading...
Searching...
No Matches
gem5::KvmKernelGicV3 Class Reference

#include <gic.hh>

Inheritance diagram for gem5::KvmKernelGicV3:
gem5::KvmKernelGic gem5::Gicv3Registers

Public Member Functions

 KvmKernelGicV3 (KvmVM &vm, const MuxingKvmGicV3Params &params)
 Instantiate a KVM in-kernel GICv3 model.
 
void init () override
 
uint32_t readDistributor (Addr daddr) override
 
uint32_t readRedistributor (const ArmISA::Affinity &aff, Addr daddr) override
 
RegVal readCpu (const ArmISA::Affinity &aff, ArmISA::MiscRegIndex misc_reg) override
 
void writeDistributor (Addr daddr, uint32_t data) override
 
void writeRedistributor (const ArmISA::Affinity &aff, Addr daddr, uint32_t data) override
 
void writeCpu (const ArmISA::Affinity &aff, ArmISA::MiscRegIndex misc_reg, RegVal 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.
 
virtual ~KvmKernelGic ()
 
 KvmKernelGic (const KvmKernelGic &other)=delete
 
 KvmKernelGic (const KvmKernelGic &&other)=delete
 
KvmKernelGicoperator= (const KvmKernelGic &&rhs)=delete
 
KvmKernelGicoperator= (const KvmKernelGic &rhs)=delete
 
void setSPI (unsigned spi)
 Raise a shared peripheral interrupt.
 
void clearSPI (unsigned spi)
 Clear a shared peripheral interrupt.
 
void setPPI (unsigned vcpu, unsigned ppi)
 Raise a private peripheral interrupt.
 
void clearPPI (unsigned vcpu, unsigned ppi)
 Clear a private peripheral interrupt.
 

Protected Member Functions

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

Private Attributes

const AddrRange redistRange
 Address range for the redistributor.
 
const AddrRange distRange
 Address range for the distributor.
 

Additional Inherited Members

- Static Protected Member Functions inherited from gem5::Gicv3Registers
static void copyDistRegister (Gicv3Registers *from, Gicv3Registers *to, Addr daddr)
 
static void copyRedistRegister (Gicv3Registers *from, Gicv3Registers *to, const ArmISA::Affinity &aff, Addr daddr)
 
static void copyCpuRegister (Gicv3Registers *from, Gicv3Registers *to, const ArmISA::Affinity &aff, ArmISA::MiscRegIndex misc_reg)
 
static void clearRedistRegister (Gicv3Registers *to, const ArmISA::Affinity &aff, Addr daddr)
 
static void copyRedistRange (Gicv3Registers *from, Gicv3Registers *to, const ArmISA::Affinity &aff, Addr daddr, size_t size)
 
static void copyDistRange (Gicv3Registers *from, Gicv3Registers *to, Addr daddr, size_t size)
 
static void clearDistRange (Gicv3Registers *to, Addr daddr, size_t size)
 
- Protected Attributes inherited from gem5::KvmKernelGic
KvmVMvm
 KVM VM in the parent system.
 
KvmDevice kdev
 Kernel interface to the GIC.
 

Detailed Description

Definition at line 191 of file gic.hh.

Constructor & Destructor Documentation

◆ KvmKernelGicV3()

gem5::KvmKernelGicV3::KvmKernelGicV3 ( KvmVM & vm,
const MuxingKvmGicV3Params & params )

Instantiate a KVM in-kernel GICv3 model.

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

Parameters
vmKVM VM representing this system
paramsMuxingKvmGicV3 parameters

Definition at line 190 of file gic.cc.

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

Member Function Documentation

◆ getGicReg()

template<typename Ret >
Ret gem5::KvmKernelGicV3::getGicReg ( unsigned group,
unsigned mpidr,
unsigned offset )
protected

Get value of GIC register "from" a cpu.

Parameters
groupDistributor or CPU (KVM_DEV_ARM_VGIC_GRP_{DIST,CPU}_REGS)
mpidrCPU affinity numbers
offsetregister offset

Definition at line 211 of file gic.cc.

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

Referenced by readCpu(), readDistributor(), and readRedistributor().

◆ init()

void gem5::KvmKernelGicV3::init ( )
overridevirtual

Reimplemented from gem5::KvmKernelGic.

Definition at line 203 of file gic.cc.

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

◆ readCpu()

RegVal gem5::KvmKernelGicV3::readCpu ( const ArmISA::Affinity & aff,
ArmISA::MiscRegIndex misc_reg )
overridevirtual

Implements gem5::Gicv3Registers.

Definition at line 252 of file gic.cc.

References gem5::ArmISA::encodeAArch64SysReg(), getGicReg(), and panic_if.

◆ readDistributor()

uint32_t gem5::KvmKernelGicV3::readDistributor ( Addr daddr)
overridevirtual

Implements gem5::Gicv3Registers.

Definition at line 240 of file gic.cc.

References getGicReg().

◆ readRedistributor()

uint32_t gem5::KvmKernelGicV3::readRedistributor ( const ArmISA::Affinity & aff,
Addr daddr )
overridevirtual

Implements gem5::Gicv3Registers.

Definition at line 246 of file gic.cc.

References getGicReg().

◆ setGicReg()

template<typename Arg >
void gem5::KvmKernelGicV3::setGicReg ( unsigned group,
unsigned mpidr,
unsigned offset,
Arg value )
protected

Set value of GIC register "from" a cpu.

Parameters
groupDistributor or CPU (KVM_DEV_ARM_VGIC_GRP_{DIST,CPU}_REGS)
mpidrCPU affinity numbers
offsetregister offset
valuevalue to set register to

Definition at line 226 of file gic.cc.

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

Referenced by writeCpu(), writeDistributor(), and writeRedistributor().

◆ writeCpu()

void gem5::KvmKernelGicV3::writeCpu ( const ArmISA::Affinity & aff,
ArmISA::MiscRegIndex misc_reg,
RegVal data )
overridevirtual

Implements gem5::Gicv3Registers.

Definition at line 276 of file gic.cc.

References data, gem5::ArmISA::encodeAArch64SysReg(), panic_if, and setGicReg().

◆ writeDistributor()

void gem5::KvmKernelGicV3::writeDistributor ( Addr daddr,
uint32_t data )
overridevirtual

Implements gem5::Gicv3Registers.

Definition at line 263 of file gic.cc.

References data, and setGicReg().

◆ writeRedistributor()

void gem5::KvmKernelGicV3::writeRedistributor ( const ArmISA::Affinity & aff,
Addr daddr,
uint32_t data )
overridevirtual

Implements gem5::Gicv3Registers.

Definition at line 269 of file gic.cc.

References data, and setGicReg().

Member Data Documentation

◆ distRange

const AddrRange gem5::KvmKernelGicV3::distRange
private

Address range for the distributor.

Definition at line 248 of file gic.hh.

◆ redistRange

const AddrRange gem5::KvmKernelGicV3::redistRange
private

Address range for the redistributor.

Definition at line 246 of file gic.hh.


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

Generated on Tue Jun 18 2024 16:24:12 for gem5 by doxygen 1.11.0