xen/arm: io: Support sign-extension for every read access
authorJulien Grall <julien.grall@citrix.com>
Wed, 7 Oct 2015 14:41:05 +0000 (15:41 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 8 Oct 2015 11:22:46 +0000 (12:22 +0100)
commitac0ca6895b654d2d80b2e894183e253e0423f4e6
treebd4aa6381f48d4edc685ec041774d9d938d38c4c
parent687a3f53bdd81d28302e82dd542f2e2a790e5f69
xen/arm: io: Support sign-extension for every read access

The guest may try to load data from the emulated MMIO region using
instructions with Sign-Extension (i.e ldrs*). Any use of one those,
will set the SSE bit (Syndrome Sign Extend) in the ISS (see B3-1433
in DDI 0406C.b).

Note that the bit can only be set for access size smaller than the
register size (i.e byte/half-word for aarch32, byte/half-word/word for
aarch32). So we don't have to worry about undefined C behavior.

Until now, the support of sign-extension was limited for byte access in
vGIC emulation. Although there is no reason to not have it generically.

So move the support just after we get the data from the MMIO emulation.

Signed-off-by: Julien Grall <julien.grall@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/arch/arm/io.c
xen/arch/arm/vgic-v2.c
xen/arch/arm/vgic-v3.c
xen/include/asm-arm/vgic.h