]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.14/arm64-kvm-fix-architecturally-invalid-reset-value-for-fpexc32_el2.patch
Linux 4.9.165
[thirdparty/kernel/stable-queue.git] / queue-4.14 / arm64-kvm-fix-architecturally-invalid-reset-value-for-fpexc32_el2.patch
1 From c88b093693ccbe41991ef2e9b1d251945e6e54ed Mon Sep 17 00:00:00 2001
2 From: Dave Martin <Dave.Martin@arm.com>
3 Date: Thu, 21 Feb 2019 11:42:32 +0000
4 Subject: arm64: KVM: Fix architecturally invalid reset value for FPEXC32_EL2
5
6 From: Dave Martin <Dave.Martin@arm.com>
7
8 commit c88b093693ccbe41991ef2e9b1d251945e6e54ed upstream.
9
10 Due to what looks like a typo dating back to the original addition
11 of FPEXC32_EL2 handling, KVM currently initialises this register to
12 an architecturally invalid value.
13
14 As a result, the VECITR field (RES1) in bits [10:8] is initialised
15 with 0, and the two reserved (RES0) bits [6:5] are initialised with
16 1. (In the Common VFP Subarchitecture as specified by ARMv7-A,
17 these two bits were IMP DEF. ARMv8-A removes them.)
18
19 This patch changes the reset value from 0x70 to 0x700, which
20 reflects the architectural constraints and is presumably what was
21 originally intended.
22
23 Cc: <stable@vger.kernel.org> # 4.12.x-
24 Cc: Christoffer Dall <christoffer.dall@arm.com>
25 Fixes: 62a89c44954f ("arm64: KVM: 32bit handling of coprocessor traps")
26 Signed-off-by: Dave Martin <Dave.Martin@arm.com>
27 Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
28 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
29
30 ---
31 arch/arm64/kvm/sys_regs.c | 2 +-
32 1 file changed, 1 insertion(+), 1 deletion(-)
33
34 --- a/arch/arm64/kvm/sys_regs.c
35 +++ b/arch/arm64/kvm/sys_regs.c
36 @@ -1079,7 +1079,7 @@ static const struct sys_reg_desc sys_reg
37
38 { SYS_DESC(SYS_DACR32_EL2), NULL, reset_unknown, DACR32_EL2 },
39 { SYS_DESC(SYS_IFSR32_EL2), NULL, reset_unknown, IFSR32_EL2 },
40 - { SYS_DESC(SYS_FPEXC32_EL2), NULL, reset_val, FPEXC32_EL2, 0x70 },
41 + { SYS_DESC(SYS_FPEXC32_EL2), NULL, reset_val, FPEXC32_EL2, 0x700 },
42 };
43
44 static bool trap_dbgidr(struct kvm_vcpu *vcpu,