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

Commit 51047f5e authored by Elliot Berman's avatar Elliot Berman
Browse files

arch: arm64: hh: Clobber x18 if SCS isn't enabled



If SCS isn't enabled, then x18 should be considered clobbered by a Haven
hypercall.

Change-Id: I885e44a8bacc7f045f45df4e88fd04626e0baf41
Signed-off-by: default avatarElliot Berman <eberman@codeaurora.org>
parent 6bdb50ad
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -31,14 +31,21 @@ static inline int _hh_hcall(const hh_hcall_fnid_t hcall_num,
	register uint64_t _x7 asm("x7") = args.arg7;

	asm volatile (
#if IS_ENABLED(CONFIG_SHADOW_CALL_STACK)
		"str	x18, [%[_x18]]\n"
#endif
		"hvc	%[num]\n"
#if IS_ENABLED(CONFIG_SHADOW_CALL_STACK)
		"ldr	x18, [%[_x18]]\n"
		"str	xzr, [%[_x18]]\n"
#endif
		: "+r"(_x0), "+r"(_x1), "+r"(_x2), "+r"(_x3), "+r"(_x4),
		  "+r"(_x5), "+r"(_x6), "+r"(_x7)
		: [num] "i" (hcall_num), [_x18] "r"(&_x18)
		: "x9", "x10", "x11", "x12", "x13", "x14", "x15", "x16", "x17",
#if !IS_ENABLED(CONFIG_SHADOW_CALL_STACK)
		  "x18",
#endif
		  "memory"
		);