diff options
author | Pavel Fedin <p.fedin@samsung.com> | 2015-10-27 11:37:29 +0300 |
---|---|---|
committer | Christoffer Dall <christoffer.dall@linaro.org> | 2015-11-04 17:29:49 +0300 |
commit | c4cd4c168b81dad53e659d18cdae653bc0ec2384 (patch) | |
tree | fe519309bd917369e61cde515ebc7bc9915d9409 /virt/kvm/arm/vgic-v2.c | |
parent | 5fdf876d30ce7c9b63045b3db8374912ab9b262c (diff) | |
download | linux-c4cd4c168b81dad53e659d18cdae653bc0ec2384.tar.xz |
KVM: arm/arm64: Optimize away redundant LR tracking
Currently we use vgic_irq_lr_map in order to track which LRs hold which
IRQs, and lr_used bitmap in order to track which LRs are used or free.
vgic_irq_lr_map is actually used only for piggy-back optimization, and
can be easily replaced by iteration over lr_used. This is good because in
future, when LPI support is introduced, number of IRQs will grow up to at
least 16384, while numbers from 1024 to 8192 are never going to be used.
This would be a huge memory waste.
In its turn, lr_used is also completely redundant since
ae705930fca6322600690df9dc1c7d0516145a93 ("arm/arm64: KVM: Keep elrsr/aisr
in sync with software model"), because together with lr_used we also update
elrsr. This allows to easily replace lr_used with elrsr, inverting all
conditions (because in elrsr '1' means 'free').
Signed-off-by: Pavel Fedin <p.fedin@samsung.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Diffstat (limited to 'virt/kvm/arm/vgic-v2.c')
-rw-r--r-- | virt/kvm/arm/vgic-v2.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/virt/kvm/arm/vgic-v2.c b/virt/kvm/arm/vgic-v2.c index 8d7b04db8471..c0f5d7fad9ea 100644 --- a/virt/kvm/arm/vgic-v2.c +++ b/virt/kvm/arm/vgic-v2.c @@ -158,6 +158,7 @@ static void vgic_v2_enable(struct kvm_vcpu *vcpu) * anyway. */ vcpu->arch.vgic_cpu.vgic_v2.vgic_vmcr = 0; + vcpu->arch.vgic_cpu.vgic_v2.vgic_elrsr = ~0; /* Get the show on the road... */ vcpu->arch.vgic_cpu.vgic_v2.vgic_hcr = GICH_HCR_EN; |