summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWill Deacon <will.deacon@arm.com>2018-12-13 16:06:14 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-01-09 16:16:45 +0100
commitc1348e03c15be1ddb3f895fc4e32d40812493dc6 (patch)
tree3ce6dab7fce602f7bc9bb7dc5220027f9bcb38d7
parent737dcb98a359e16bc03a2eef83fc5ec88b75e01c (diff)
downloadlinux-stable-c1348e03c15be1ddb3f895fc4e32d40812493dc6.tar.gz
linux-stable-c1348e03c15be1ddb3f895fc4e32d40812493dc6.tar.bz2
linux-stable-c1348e03c15be1ddb3f895fc4e32d40812493dc6.zip
arm64: KVM: Avoid setting the upper 32 bits of VTCR_EL2 to 1
commit df655b75c43fba0f2621680ab261083297fd6d16 upstream. Although bit 31 of VTCR_EL2 is RES1, we inadvertently end up setting all of the upper 32 bits to 1 as well because we define VTCR_EL2_RES1 as signed, which is sign-extended when assigning to kvm->arch.vtcr. Lucky for us, the architecture currently treats these upper bits as RES0 so, whilst we've been naughty, we haven't set fire to anything yet. Cc: <stable@vger.kernel.org> Cc: Marc Zyngier <marc.zyngier@arm.com> Cc: Christoffer Dall <christoffer.dall@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--arch/arm64/include/asm/kvm_arm.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm64/include/asm/kvm_arm.h b/arch/arm64/include/asm/kvm_arm.h
index 0dbc1c6ab7dc..68dedca5a47e 100644
--- a/arch/arm64/include/asm/kvm_arm.h
+++ b/arch/arm64/include/asm/kvm_arm.h
@@ -99,7 +99,7 @@
TCR_EL2_ORGN0_MASK | TCR_EL2_IRGN0_MASK | TCR_EL2_T0SZ_MASK)
/* VTCR_EL2 Registers bits */
-#define VTCR_EL2_RES1 (1 << 31)
+#define VTCR_EL2_RES1 (1U << 31)
#define VTCR_EL2_HD (1 << 22)
#define VTCR_EL2_HA (1 << 21)
#define VTCR_EL2_PS_MASK TCR_EL2_PS_MASK