Skip to content

Commit 69231a6

Browse files
jgoulyMarc Zyngier
authored andcommitted
KVM: arm64: Make kvm_at() take an OP_AT_*
To allow using newer instructions that current assemblers don't know about, replace the `at` instruction with the underlying SYS instruction. Signed-off-by: Joey Gouly <joey.gouly@arm.com> Cc: Oliver Upton <oliver.upton@linux.dev> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Will Deacon <will@kernel.org> Reviewed-by: Marc Zyngier <maz@kernel.org> Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com> Acked-by: Will Deacon <will@kernel.org> Signed-off-by: Marc Zyngier <maz@kernel.org>
1 parent 8400291 commit 69231a6

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

arch/arm64/include/asm/kvm_asm.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <asm/hyp_image.h>
1111
#include <asm/insn.h>
1212
#include <asm/virt.h>
13+
#include <asm/sysreg.h>
1314

1415
#define ARM_EXIT_WITH_SERROR_BIT 31
1516
#define ARM_EXCEPTION_CODE(x) ((x) & ~(1U << ARM_EXIT_WITH_SERROR_BIT))
@@ -259,7 +260,7 @@ extern u64 __kvm_get_mdcr_el2(void);
259260
asm volatile( \
260261
" mrs %1, spsr_el2\n" \
261262
" mrs %2, elr_el2\n" \
262-
"1: at "at_op", %3\n" \
263+
"1: " __msr_s(at_op, "%3") "\n" \
263264
" isb\n" \
264265
" b 9f\n" \
265266
"2: msr spsr_el2, %1\n" \

arch/arm64/kvm/hyp/include/hyp/fault.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ static inline bool __translate_far_to_hpfar(u64 far, u64 *hpfar)
2727
* saved the guest context yet, and we may return early...
2828
*/
2929
par = read_sysreg_par();
30-
if (!__kvm_at("s1e1r", far))
30+
if (!__kvm_at(OP_AT_S1E1R, far))
3131
tmp = read_sysreg_par();
3232
else
3333
tmp = SYS_PAR_EL1_F; /* back to the guest */

0 commit comments

Comments
 (0)