Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 921ef1e1 authored by Alex Bennée's avatar Alex Bennée Committed by Marc Zyngier
Browse files

KVM: arm64: fix misleading comments in save/restore



The elr_el2 and spsr_el2 registers in fact contain the processor state
before entry into EL2. In the case of guest state it could be in either
el0 or el1.

Signed-off-by: default avatarAlex Bennée <alex.bennee@linaro.org>
Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
parent 8889583c
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -50,8 +50,8 @@
	stp	x29, lr, [x3, #80]
	stp	x29, lr, [x3, #80]


	mrs	x19, sp_el0
	mrs	x19, sp_el0
	mrs	x20, elr_el2		// EL1 PC
	mrs	x20, elr_el2		// pc before entering el2
	mrs	x21, spsr_el2		// EL1 pstate
	mrs	x21, spsr_el2		// pstate before entering el2


	stp	x19, x20, [x3, #96]
	stp	x19, x20, [x3, #96]
	str	x21, [x3, #112]
	str	x21, [x3, #112]
@@ -82,8 +82,8 @@
	ldr	x21, [x3, #16]
	ldr	x21, [x3, #16]


	msr	sp_el0, x19
	msr	sp_el0, x19
	msr	elr_el2, x20 				// EL1 PC
	msr	elr_el2, x20 		// pc on return from el2
	msr	spsr_el2, x21 				// EL1 pstate
	msr	spsr_el2, x21 		// pstate on return from el2


	add	x3, x2, #CPU_XREG_OFFSET(19)
	add	x3, x2, #CPU_XREG_OFFSET(19)
	ldp	x19, x20, [x3]
	ldp	x19, x20, [x3]