diff options
author | Andreas Sandberg <andreas.sandberg@arm.com> | 2016-04-27 15:34:48 +0100 |
---|---|---|
committer | Andreas Sandberg <andreas.sandberg@arm.com> | 2016-04-27 15:34:48 +0100 |
commit | f1575fdc4a1dd186814e76a314e97bd4c6ddbe86 (patch) | |
tree | d660a79019a114347a709b47f72d2f1bc580d704 /src/arch/arm/kvm | |
parent | d5e78923505b18cd5af6a7a2996605569fb2e4b9 (diff) | |
download | gem5-f1575fdc4a1dd186814e76a314e97bd4c6ddbe86.tar.xz |
kvm, arm: Make GIC interrupt lines configurable
Add support for overriding the number of interrupt lines in the ARM
KvmGic.
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Radhika Jagtap <radhika.jagtap@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Diffstat (limited to 'src/arch/arm/kvm')
-rw-r--r-- | src/arch/arm/kvm/KvmGic.py | 1 | ||||
-rw-r--r-- | src/arch/arm/kvm/gic.cc | 8 | ||||
-rw-r--r-- | src/arch/arm/kvm/gic.hh | 4 |
3 files changed, 9 insertions, 4 deletions
diff --git a/src/arch/arm/kvm/KvmGic.py b/src/arch/arm/kvm/KvmGic.py index 53814698e..74bfe1e0b 100644 --- a/src/arch/arm/kvm/KvmGic.py +++ b/src/arch/arm/kvm/KvmGic.py @@ -48,6 +48,7 @@ class KvmGic(BaseGic): dist_addr = Param.Addr(0x1f001000, "Address for distributor") cpu_addr = Param.Addr(0x1f000100, "Address for cpu") + it_lines = Param.UInt32(128, "Number of interrupt lines supported") system = Param.System(Parent.any, 'System this interrupt controller belongs to') diff --git a/src/arch/arm/kvm/gic.cc b/src/arch/arm/kvm/gic.cc index bed13ec2c..684f026f0 100644 --- a/src/arch/arm/kvm/gic.cc +++ b/src/arch/arm/kvm/gic.cc @@ -44,8 +44,8 @@ #include "debug/Interrupt.hh" #include "params/KvmGic.hh" - -KvmKernelGicV2::KvmKernelGicV2(KvmVM &_vm, Addr cpu_addr, Addr dist_addr) +KvmKernelGicV2::KvmKernelGicV2(KvmVM &_vm, Addr cpu_addr, Addr dist_addr, + unsigned it_lines) : cpuRange(RangeSize(cpu_addr, KVM_VGIC_V2_CPU_SIZE)), distRange(RangeSize(dist_addr, KVM_VGIC_V2_DIST_SIZE)), vm(_vm), @@ -55,6 +55,8 @@ KvmKernelGicV2::KvmKernelGicV2(KvmVM &_vm, Addr cpu_addr, Addr dist_addr) KVM_DEV_ARM_VGIC_GRP_ADDR, KVM_VGIC_V2_ADDR_TYPE_DIST, dist_addr); kdev.setAttr<uint64_t>( KVM_DEV_ARM_VGIC_GRP_ADDR, KVM_VGIC_V2_ADDR_TYPE_CPU, cpu_addr); + + kdev.setAttr<uint32_t>(KVM_DEV_ARM_VGIC_GRP_NR_IRQS, 0, it_lines); } KvmKernelGicV2::~KvmKernelGicV2() @@ -104,7 +106,7 @@ KvmKernelGicV2::setIntState(unsigned type, unsigned vcpu, unsigned irq, KvmGic::KvmGic(const KvmGicParams *p) : BaseGic(p), system(*p->system), - kernelGic(*p->kvmVM, p->cpu_addr, p->dist_addr), + kernelGic(*p->kvmVM, p->cpu_addr, p->dist_addr, p->it_lines), addrRanges{kernelGic.distRange, kernelGic.cpuRange} { } diff --git a/src/arch/arm/kvm/gic.hh b/src/arch/arm/kvm/gic.hh index 77a7b5e53..b16a3f104 100644 --- a/src/arch/arm/kvm/gic.hh +++ b/src/arch/arm/kvm/gic.hh @@ -65,8 +65,10 @@ class KvmKernelGicV2 * @param vm KVM VM representing this system * @param cpu_addr GIC CPU interface base address * @param dist_addr GIC distributor base address + * @param it_liens Number of interrupt lines to support */ - KvmKernelGicV2(KvmVM &vm, Addr cpu_addr, Addr dist_addr); + KvmKernelGicV2(KvmVM &vm, Addr cpu_addr, Addr dist_addr, + unsigned it_lines); virtual ~KvmKernelGicV2(); KvmKernelGicV2(const KvmKernelGicV2 &other) = delete; |