Commit f0445dfa authored by Marc Zyngier's avatar Marc Zyngier

arm64: KVM: Reserve 4 additional instructions in the BPI template

So far, we only reserve a single instruction in the BPI template in
order to branch to the vectors. As we're going to stuff a few more
instructions there, let's reserve a total of 5 instructions, which
we're going to patch later on as required.

We also introduce a small refactor of the vectors themselves, so that
we stop carrying the target branch around.
Acked-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Reviewed-by: default avatarAndrew Jones <drjones@redhat.com>
Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
parent 4340ba80
...@@ -19,33 +19,24 @@ ...@@ -19,33 +19,24 @@
#include <linux/linkage.h> #include <linux/linkage.h>
#include <linux/arm-smccc.h> #include <linux/arm-smccc.h>
.macro ventry target .macro hyp_ventry
.rept 31 .align 7
1: .rept 27
nop nop
.endr .endr
b \target b __kvm_hyp_vector + (1b - 0b)
nop
nop
nop
nop
.endm .endm
.macro vectors target .macro generate_vectors
ventry \target + 0x000 0:
ventry \target + 0x080 .rept 16
ventry \target + 0x100 hyp_ventry
ventry \target + 0x180 .endr
.org 0b + SZ_2K // Safety measure
ventry \target + 0x200
ventry \target + 0x280
ventry \target + 0x300
ventry \target + 0x380
ventry \target + 0x400
ventry \target + 0x480
ventry \target + 0x500
ventry \target + 0x580
ventry \target + 0x600
ventry \target + 0x680
ventry \target + 0x700
ventry \target + 0x780
.endm .endm
...@@ -55,7 +46,7 @@ ...@@ -55,7 +46,7 @@
.align 11 .align 11
ENTRY(__bp_harden_hyp_vecs_start) ENTRY(__bp_harden_hyp_vecs_start)
.rept 4 .rept 4
vectors __kvm_hyp_vector generate_vectors
.endr .endr
ENTRY(__bp_harden_hyp_vecs_end) ENTRY(__bp_harden_hyp_vecs_end)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment