xen/arm: vgic-v2: Handle correctly byte write in ITARGETSR
authorJulien Grall <julien.grall@citrix.com>
Wed, 18 Nov 2015 16:42:39 +0000 (16:42 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 25 Nov 2015 12:29:18 +0000 (12:29 +0000)
commit9f5e16e7659fc9abb64c1d50dfea0dcfdb49b01b
tree1bab2792e9e1d14ea7bb021e4b04914074bfb79a
parentbc50de883847c1ebc7c8b4d73283d9be6c4df38e
xen/arm: vgic-v2: Handle correctly byte write in ITARGETSR

During a store, the byte is always in the low part of the register (i.e
[0:7]).

We are incorrectly masking the register by using a shift of the byte
offset in the ITARGETSR while the byte is alwasy in r[0:7]. This will
result in a target list equal to 0 which is ignored by the emulation.

Because of that the guest will only be able to modify the first byte in
each ITARGETSR.

Furthermore, the body of the loop is retrieving the old target list
using the index of the byte.

To avoid modifying too much the loop, shift the byte stored to the correct
offset.

Signed-off-by: Julien Grall <julien.grall@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
xen/arch/arm/vgic-v2.c