• Peter Maydell's avatar
    target-arm: handle address translations that start at level 3 · d6be29e3
    Peter Maydell authored
    The ARMv8 address translation system defines that a page table walk
    starts at a level which depends on the translation granule size
    and the number of bits of virtual address that need to be resolved.
    Where the translation granule is 64KB and the guest sets the
    TCR.TxSZ field to between 35 and 39, it's actually possible to
    start at level 3 (the final level). QEMU's implementation failed
    to handle this case, and so we would set level to 2 and behave
    incorrectly (including invoking the C undefined behaviour of
    shifting left by a negative number). Correct the code that
    determines the starting level to deal with the start-at-3 case,
    by replacing the if-else ladder with an expression derived from
    the ARM ARM pseudocode version.
    
    This error was detected by the Coverity scan, which spotted
    the potential shift by a negative number.
    Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
    Message-id: 1415890569-7454-1-git-send-email-peter.maydell@linaro.org
    d6be29e3
Name
Last commit
Last update
..
Makefile.objs Loading commit data...
arm-semi.c Loading commit data...
arm_ldst.h Loading commit data...
cpu-qom.h Loading commit data...
cpu.c Loading commit data...
cpu.h Loading commit data...
cpu64.c Loading commit data...
crypto_helper.c Loading commit data...
gdbstub.c Loading commit data...
gdbstub64.c Loading commit data...
helper-a64.c Loading commit data...
helper-a64.h Loading commit data...
helper.c Loading commit data...
helper.h Loading commit data...
internals.h Loading commit data...
iwmmxt_helper.c Loading commit data...
kvm-consts.h Loading commit data...
kvm-stub.c Loading commit data...
kvm.c Loading commit data...
kvm32.c Loading commit data...
kvm64.c Loading commit data...
kvm_arm.h Loading commit data...
machine.c Loading commit data...
neon_helper.c Loading commit data...
op_addsub.h Loading commit data...
op_helper.c Loading commit data...
psci.c Loading commit data...
translate-a64.c Loading commit data...
translate.c Loading commit data...
translate.h Loading commit data...