gem5  v22.0.0.2
Public Member Functions | List of all members
gem5::KvmKernelGic Class Reference

KVM in-kernel GIC abstraction. More...

#include <gic.hh>

Inheritance diagram for gem5::KvmKernelGic:
gem5::KvmKernelGicV2 gem5::KvmKernelGicV3

Public Member Functions

 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 ()
 

In-kernel GIC API

KvmVMvm
 KVM VM in the parent system. More...
 
KvmDevice kdev
 Kernel interface to the GIC. More...
 
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...
 
void setIntState (unsigned type, unsigned vcpu, unsigned irq, bool high)
 Update the kernel's VGIC interrupt state. More...
 

Detailed Description

KVM in-kernel GIC abstraction.

This class defines a high-level interface to the KVM in-kernel GIC model. It exposes an API that is similar to that of software-emulated GIC models in gem5.

Definition at line 61 of file gic.hh.

Constructor & Destructor Documentation

◆ KvmKernelGic() [1/3]

gem5::KvmKernelGic::KvmKernelGic ( KvmVM vm,
uint32_t  dev,
unsigned  it_lines 
)

Instantiate a KVM in-kernel GIC model.

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

Parameters
vmKVM VM representing this system
cpu_addrGIC CPU interface base address
dist_addrGIC distributor base address
it_linesNumber of interrupt lines to support

Definition at line 51 of file gic.cc.

References gem5::KvmVM::enableKernelIRQChip(), kdev, gem5::KvmDevice::setAttr(), and vm.

◆ ~KvmKernelGic()

gem5::KvmKernelGic::~KvmKernelGic ( )
virtual

Definition at line 62 of file gic.cc.

◆ KvmKernelGic() [2/3]

gem5::KvmKernelGic::KvmKernelGic ( const KvmKernelGic other)
delete

◆ KvmKernelGic() [3/3]

gem5::KvmKernelGic::KvmKernelGic ( const KvmKernelGic &&  other)
delete

Member Function Documentation

◆ clearPPI()

void gem5::KvmKernelGic::clearPPI ( unsigned  vcpu,
unsigned  ppi 
)

Clear a private peripheral interrupt.

Parameters
vcpuKVM virtual CPU number @parma ppi PPI interrupt number

Definition at line 85 of file gic.cc.

References setIntState().

◆ clearSPI()

void gem5::KvmKernelGic::clearSPI ( unsigned  spi)

Clear a shared peripheral interrupt.

Parameters
spiSPI number

Definition at line 73 of file gic.cc.

References setIntState().

◆ init()

virtual void gem5::KvmKernelGic::init ( )
inlinevirtual

Reimplemented in gem5::KvmKernelGicV3.

Definition at line 83 of file gic.hh.

◆ operator=() [1/2]

KvmKernelGic& gem5::KvmKernelGic::operator= ( const KvmKernelGic &&  rhs)
delete

◆ operator=() [2/2]

KvmKernelGic& gem5::KvmKernelGic::operator= ( const KvmKernelGic rhs)
delete

◆ setIntState()

void gem5::KvmKernelGic::setIntState ( unsigned  type,
unsigned  vcpu,
unsigned  irq,
bool  high 
)
protected

Update the kernel's VGIC interrupt state.

Parameters
typeInterrupt type (KVM_ARM_IRQ_TYPE_PPI/KVM_ARM_IRQ_TYPE_SPI)
vcpuCPU id within KVM (ignored for SPIs)
irqInterrupt number
highTrue to signal an interrupt, false to clear it.

Definition at line 91 of file gic.cc.

References gem5::Kvm::capIRQLineLayout2(), gem5::high, gem5::ArmISA::irq, gem5::KvmVM::kvm, panic_if, gem5::KvmVM::setIRQLine(), gem5::X86ISA::type, and vm.

Referenced by clearPPI(), clearSPI(), setPPI(), and setSPI().

◆ setPPI()

void gem5::KvmKernelGic::setPPI ( unsigned  vcpu,
unsigned  ppi 
)

Raise a private peripheral interrupt.

Parameters
vcpuKVM virtual CPU number @parma ppi PPI interrupt number

Definition at line 79 of file gic.cc.

References setIntState().

◆ setSPI()

void gem5::KvmKernelGic::setSPI ( unsigned  spi)

Raise a shared peripheral interrupt.

Parameters
spiSPI number

Definition at line 67 of file gic.cc.

References setIntState().

Member Data Documentation

◆ kdev

KvmDevice gem5::KvmKernelGic::kdev
protected

◆ vm

KvmVM& gem5::KvmKernelGic::vm
protected

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