gem5 v24.0.0.0
Loading...
Searching...
No Matches
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.
 
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.
 
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.
 
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

uint32_t getGicReg (unsigned group, unsigned vcpu, unsigned offset)
 Get value of GIC register "from" a cpu.
 
void setGicReg (unsigned group, unsigned vcpu, unsigned offset, unsigned 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 cpuRange
 Address range for the CPU interfaces.
 
const AddrRange distRange
 Address range for the distributor.
 

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.
 
KvmDevice kdev
 Kernel interface to the GIC.
 

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 118 of file gic.cc.

References gem5::KvmKernelGic::kdev, gem5::MipsISA::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 131 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 166 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 159 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 145 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 180 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 173 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 Tue Jun 18 2024 16:24:12 for gem5 by doxygen 1.11.0