FAILED: patch "[PATCH] arm: KVM: Fix VTTBR_BADDR_MASK BUG_ON off-by-one" failed to apply to 3.18-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 3.18-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
Quoted 1 line
From
5553b142be11e794ebc0805950b2e8313f93d718Mon Sep 17 00:00:00 2001
From: Marc Zyngier <[email protected]>
Date: Thu, 16 Nov 2017 17:58:21 +0000
Subject: [PATCH] arm: KVM: Fix VTTBR_BADDR_MASK BUG_ON off-by-one
VTTBR_BADDR_MASK is used to sanity check the size and alignment of the VTTBR address. It seems to currently be off by one, thereby only allowing up to 39-bit addresses (instead of 40-bit) and also insufficiently checking the alignment. This patch fixes it.
This patch is the 32bit pendent of Kristina's arm64 fix, and she deserves the actual kudos for pinpointing that one.
arch/arm/include/asm/kvm_arm.h +1 -2
@@ -161,8 +161,7 @@#else #define VTTBR_X (5 - KVM_T0SZ)#endif -#define VTTBR_BADDR_SHIFT (VTTBR_X - 1) -#define VTTBR_BADDR_MASK (((_AC(1, ULL) << (40 - VTTBR_X)) - 1) << VTTBR_BADDR_SHIFT) +#define VTTBR_BADDR_MASK (((_AC(1, ULL) << (40 - VTTBR_X)) - 1) << VTTBR_X)#define VTTBR_VMID_SHIFT _AC(48, ULL)#define VTTBR_VMID_MASK (size) (_AT(u64, (1 << size) - 1) << VTTBR_VMID_SHIFT)