aboutsummaryrefslogtreecommitdiffstats
path: root/include/kvm
diff options
context:
space:
mode:
authorPavel Fedin <p.fedin@samsung.com>2015-10-27 04:37:29 -0400
committerChristoffer Dall <christoffer.dall@linaro.org>2015-11-04 09:29:49 -0500
commitc4cd4c168b81dad53e659d18cdae653bc0ec2384 (patch)
treefe519309bd917369e61cde515ebc7bc9915d9409 /include/kvm
parent5fdf876d30ce7c9b63045b3db8374912ab9b262c (diff)
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 'include/kvm')
-rw-r--r--include/kvm/arm_vgic.h6
1 files changed, 0 insertions, 6 deletions
diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h
index 8065801a1847..3936bf802e1d 100644
--- a/include/kvm/arm_vgic.h
+++ b/include/kvm/arm_vgic.h
@@ -295,9 +295,6 @@ struct vgic_v3_cpu_if {
295}; 295};
296 296
297struct vgic_cpu { 297struct vgic_cpu {
298 /* per IRQ to LR mapping */
299 u8 *vgic_irq_lr_map;
300
301 /* Pending/active/both interrupts on this VCPU */ 298 /* Pending/active/both interrupts on this VCPU */
302 DECLARE_BITMAP(pending_percpu, VGIC_NR_PRIVATE_IRQS); 299 DECLARE_BITMAP(pending_percpu, VGIC_NR_PRIVATE_IRQS);
303 DECLARE_BITMAP(active_percpu, VGIC_NR_PRIVATE_IRQS); 300 DECLARE_BITMAP(active_percpu, VGIC_NR_PRIVATE_IRQS);
@@ -308,9 +305,6 @@ struct vgic_cpu {
308 unsigned long *active_shared; 305 unsigned long *active_shared;
309 unsigned long *pend_act_shared; 306 unsigned long *pend_act_shared;
310 307
311 /* Bitmap of used/free list registers */
312 DECLARE_BITMAP(lr_used, VGIC_V2_MAX_LRS);
313
314 /* Number of list registers on this CPU */ 308 /* Number of list registers on this CPU */
315 int nr_lr; 309 int nr_lr;
316 310