gem5 v24.0.0.0
|
KVM in-kernel GIC abstraction. More...
#include <gic.hh>
Public Member Functions | |
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 | |
KvmKernelGic & | operator= (const KvmKernelGic &&rhs)=delete |
KvmKernelGic & | operator= (const KvmKernelGic &rhs)=delete |
virtual void | init () |
In-kernel GIC API | |
KvmVM & | vm |
KVM VM in the parent system. | |
KvmDevice | kdev |
Kernel interface to the GIC. | |
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. | |
void | setIntState (unsigned type, unsigned vcpu, unsigned irq, bool high) |
Update the kernel's VGIC interrupt state. | |
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.
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.
vm | KVM VM representing this system |
cpu_addr | GIC CPU interface base address |
dist_addr | GIC distributor base address |
it_lines | Number of interrupt lines to support |
Definition at line 51 of file gic.cc.
References gem5::KvmVM::enableKernelIRQChip(), kdev, gem5::KvmDevice::setAttr(), and vm.
|
delete |
|
delete |
void gem5::KvmKernelGic::clearPPI | ( | unsigned | vcpu, |
unsigned | ppi ) |
Clear a private peripheral interrupt.
vcpu | KVM virtual CPU number @parma ppi PPI interrupt number |
Definition at line 85 of file gic.cc.
References setIntState().
void gem5::KvmKernelGic::clearSPI | ( | unsigned | spi | ) |
Clear a shared peripheral interrupt.
spi | SPI number |
Definition at line 73 of file gic.cc.
References setIntState().
|
inlinevirtual |
Reimplemented in gem5::KvmKernelGicV3.
|
delete |
|
delete |
|
protected |
Update the kernel's VGIC interrupt state.
type | Interrupt type (KVM_ARM_IRQ_TYPE_PPI/KVM_ARM_IRQ_TYPE_SPI) |
vcpu | CPU id within KVM (ignored for SPIs) |
irq | Interrupt number |
high | True to signal an interrupt, false to clear it. |
Definition at line 91 of file gic.cc.
References gem5::Kvm::capIRQLineLayout2(), gem5::ArmISA::irq, gem5::KvmVM::kvm, panic_if, gem5::KvmVM::setIRQLine(), gem5::X86ISA::type, and vm.
Referenced by clearPPI(), clearSPI(), setPPI(), and setSPI().
void gem5::KvmKernelGic::setPPI | ( | unsigned | vcpu, |
unsigned | ppi ) |
Raise a private peripheral interrupt.
vcpu | KVM virtual CPU number @parma ppi PPI interrupt number |
Definition at line 79 of file gic.cc.
References setIntState().
void gem5::KvmKernelGic::setSPI | ( | unsigned | spi | ) |
Raise a shared peripheral interrupt.
spi | SPI number |
Definition at line 67 of file gic.cc.
References setIntState().
|
protected |
Kernel interface to the GIC.
Definition at line 137 of file gic.hh.
Referenced by gem5::KvmKernelGicV2::getGicReg(), gem5::KvmKernelGicV3::getGicReg(), gem5::KvmKernelGicV3::init(), KvmKernelGic(), gem5::KvmKernelGicV2::KvmKernelGicV2(), gem5::KvmKernelGicV3::KvmKernelGicV3(), gem5::KvmKernelGicV2::setGicReg(), and gem5::KvmKernelGicV3::setGicReg().
|
protected |
KVM VM in the parent system.
Definition at line 134 of file gic.hh.
Referenced by KvmKernelGic(), gem5::KvmKernelGicV2::readCpu(), gem5::KvmKernelGicV2::readDistributor(), setIntState(), gem5::KvmKernelGicV2::writeCpu(), and gem5::KvmKernelGicV2::writeDistributor().