KVM: arm64: Add templates for BHB mitigation sequences
stable inclusion from stable-v4.19.236 commit a68912a3ae3413be5febcaa40e7e0ec1fd62adee category: bugfix bugzilla: 186460, https://gitee.com/src-openeuler/kernel/issues/I53MHA CVE: CVE-2022-23960 -------------------------------- KVM writes the Spectre-v2 mitigation template at the beginning of each vector when a CPU requires a specific sequence to run. Because the template is copied, it can not be modified by the alternatives at runtime. As the KVM template code is intertwined with the bp-hardening callbacks, all templates must have a bp-hardening callback. Add templates for calling ARCH_WORKAROUND_3 and one for each value of K in the brancy-loop. Identify these sequences by a new parameter template_start, and add a copy of install_bp_hardening_cb() that is able to install them. Signed-off-by:James Morse <james.morse@arm.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Conflicts: arch/arm64/include/asm/cpucaps.h Signed-off-by:
Chen Jiahao <chenjiahao16@huawei.com> Reviewed-by:
Hanjun Guo <guohanjun@huawei.com> Reviewed-by:
Liao Chang <liaochang1@huawei.com> Signed-off-by:
Yongqiang Liu <liuyongqiang13@huawei.com>
Showing
- arch/arm64/include/asm/cpucaps.h 2 additions, 0 deletionsarch/arm64/include/asm/cpucaps.h
- arch/arm64/include/asm/kvm_mmu.h 4 additions, 2 deletionsarch/arm64/include/asm/kvm_mmu.h
- arch/arm64/include/asm/mmu.h 6 additions, 0 deletionsarch/arm64/include/asm/mmu.h
- arch/arm64/kernel/cpu_errata.c 64 additions, 1 deletionarch/arm64/kernel/cpu_errata.c
- arch/arm64/kvm/hyp/hyp-entry.S 54 additions, 0 deletionsarch/arm64/kvm/hyp/hyp-entry.S
Please register or sign in to comment