diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2013-06-27 16:38:47 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2013-07-15 17:13:51 +0100 |
commit | 2ebcebe262e88111ff583f97bc5fe0aae64b8940 (patch) | |
tree | ca9d53c5d33dfa34136f15de159addf12b8544d3 /ui/keymaps.c | |
parent | 204a9c43afb92e2ff44fc9d1d377bc98ee97e3d7 (diff) | |
download | qemu-2ebcebe262e88111ff583f97bc5fe0aae64b8940.tar.gz qemu-2ebcebe262e88111ff583f97bc5fe0aae64b8940.tar.bz2 qemu-2ebcebe262e88111ff583f97bc5fe0aae64b8940.zip |
target-arm: avoid undefined behaviour when writing TTBCR
LPAE CPUs have more potentially valid bits in the TTBCR, and so the
simple masking out of invalid bits is no longer sufficient to obtain
the base address width field of the register, which is what we use to
precalculate c2_mask and c2_base_mask. Explicitly extract the
relevant register field rather than simply shifting by the register
value.
This bug would have had no ill effects in practice, since if the
EAE bit (TTBCR bit 31) is set then we don't use the precalculated
masks, and if EAE is zero then bits 30..3 are all UNK/SBZP, so
well-behaved guests won't set them. However the shift is undefined
behaviour, so we should avoid it.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1372347527-4428-1-git-send-email-peter.maydell@linaro.org
Diffstat (limited to 'ui/keymaps.c')
0 files changed, 0 insertions, 0 deletions