gem5
v20.1.0.0
|
KVM in-kernel GIC abstraction. More...
#include <gic.hh>
Public Member Functions | |
KvmKernelGicV2 (KvmVM &vm, Addr cpu_addr, Addr dist_addr, unsigned it_lines) | |
Instantiate a KVM in-kernel GIC model. More... | |
virtual | ~KvmKernelGicV2 () |
KvmKernelGicV2 (const KvmKernelGicV2 &other)=delete | |
KvmKernelGicV2 (const KvmKernelGicV2 &&other)=delete | |
KvmKernelGicV2 & | operator= (const KvmKernelGicV2 &&rhs)=delete |
KvmKernelGicV2 & | operator= (const KvmKernelGicV2 &rhs)=delete |
In-kernel GIC API | |
const AddrRange | cpuRange |
Address range for the CPU interfaces. More... | |
const AddrRange | distRange |
Address range for the distributor interface. More... | |
KvmVM & | vm |
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... | |
uint32_t | readDistributor (ContextID ctx, Addr daddr) override |
BaseGicRegisters interface. More... | |
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 |
void | setIntState (unsigned type, unsigned vcpu, unsigned irq, bool high) |
Update the kernel's VGIC interrupt state. More... | |
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... | |
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.
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 47 of file gic.cc.
References KvmVM::enableKernelIRQChip(), kdev, KvmDevice::setAttr(), and vm.
|
delete |
|
delete |
void KvmKernelGicV2::clearPPI | ( | unsigned | vcpu, |
unsigned | ppi | ||
) |
Clear a private peripheral interrupt.
vcpu | KVM virtual CPU number @parma ppi PPI interrupt number |
Definition at line 89 of file gic.cc.
References setIntState().
Referenced by MuxingKvmGic::clearPPInt().
void KvmKernelGicV2::clearSPI | ( | unsigned | spi | ) |
Clear a shared peripheral interrupt.
spi | SPI number |
Definition at line 77 of file gic.cc.
References setIntState().
Referenced by MuxingKvmGic::clearInt().
|
protected |
Get value of GIC register "from" a cpu.
group | Distributor or CPU (KVM_DEV_ARM_VGIC_GRP_{DIST,CPU}_REGS) |
vcpu | CPU id within KVM |
offset | register offset |
Definition at line 110 of file gic.cc.
References ArmISA::attr, KvmDevice::getAttrPtr(), kdev, ArmISA::offset, and X86ISA::reg.
Referenced by readCpu(), and readDistributor().
|
delete |
|
delete |
Implements BaseGicRegisters.
Definition at line 145 of file gic.cc.
References KvmVM::contextIdToVCpuId(), getGicReg(), and vm.
BaseGicRegisters interface.
Implements BaseGicRegisters.
Definition at line 138 of file gic.cc.
References KvmVM::contextIdToVCpuId(), getGicReg(), and vm.
|
protected |
Set value of GIC register "from" a cpu.
group | Distributor or CPU (KVM_DEV_ARM_VGIC_GRP_{DIST,CPU}_REGS) |
vcpu | CPU id within KVM |
offset | register offset |
value | value to set register to |
Definition at line 124 of file gic.cc.
References ArmISA::attr, kdev, ArmISA::offset, X86ISA::reg, and KvmDevice::setAttrPtr().
Referenced by writeCpu(), and writeDistributor().
|
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 95 of file gic.cc.
References ArmISA::irq, KvmVM::setIRQLine(), type, and vm.
Referenced by clearPPI(), clearSPI(), setPPI(), and setSPI().
void KvmKernelGicV2::setPPI | ( | unsigned | vcpu, |
unsigned | ppi | ||
) |
Raise a private peripheral interrupt.
vcpu | KVM virtual CPU number @parma ppi PPI interrupt number |
Definition at line 83 of file gic.cc.
References setIntState().
Referenced by MuxingKvmGic::sendPPInt().
void KvmKernelGicV2::setSPI | ( | unsigned | spi | ) |
Raise a shared peripheral interrupt.
spi | SPI number |
Definition at line 71 of file gic.cc.
References setIntState().
Referenced by MuxingKvmGic::sendInt().
Implements BaseGicRegisters.
Definition at line 159 of file gic.cc.
References KvmVM::contextIdToVCpuId(), data, setGicReg(), and vm.
Implements BaseGicRegisters.
Definition at line 152 of file gic.cc.
References KvmVM::contextIdToVCpuId(), data, setGicReg(), and vm.
const AddrRange KvmKernelGicV2::cpuRange |
const AddrRange KvmKernelGicV2::distRange |
|
protected |
Kernel interface to the GIC.
Definition at line 162 of file gic.hh.
Referenced by getGicReg(), KvmKernelGicV2(), and setGicReg().
|
protected |
KVM VM in the parent system.
Definition at line 159 of file gic.hh.
Referenced by KvmKernelGicV2(), readCpu(), readDistributor(), setIntState(), writeCpu(), and writeDistributor().