arm/arm64: KVM: vgic: Improve handling of GICD_I{CS}PENDRn
authorChristoffer Dall <christoffer.dall@linaro.org>
Sat, 14 Jun 2014 19:54:51 +0000 (21:54 +0200)
committerChristoffer Dall <christoffer.dall@linaro.org>
Fri, 19 Sep 2014 01:44:31 +0000 (18:44 -0700)
commitfaa1b46c3e9f4d40359aee04ff275eea5f4cae3a
treeee960c075d6d84402892f8d1025812208b105326
parentcced50c9280ef7ca1af48080707a170efa1adfa0
arm/arm64: KVM: vgic: Improve handling of GICD_I{CS}PENDRn

Writes to GICD_ISPENDRn and GICD_ICPENDRn are currently not handled
correctly for level-triggered interrupts.  The spec states that for
level-triggered interrupts, writes to the GICD_ISPENDRn activate the
output of a flip-flop which is in turn or'ed with the actual input
interrupt signal.  Correspondingly, writes to GICD_ICPENDRn simply
deactivates the output of that flip-flop, but does not (of course) affect
the external input signal.  Reads from GICC_IAR will also deactivate the
flip-flop output.

This requires us to track the state of the level-input separately from
the state in the flip-flop.  We therefore introduce two new variables on
the distributor struct to track these two states.  Astute readers may
notice that this is introducing more state than required (because an OR
of the two states gives you the pending state), but the remaining vgic
code uses the pending bitmap for optimized operations to figure out, at
the end of the day, if an interrupt is pending or not on the distributor
side.  Refactoring the code to consider the two state variables all the
places where we currently access the precomputed pending value, did not
look pretty.

Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
include/kvm/arm_vgic.h
virt/kvm/arm/vgic.c
This page took 0.036283 seconds and 5 git commands to generate.