Skip to contentSkip to conversation

KVM: PPC: Ultravisor: UV_RESTRICTED_SPR_WRITE ucall

PATCH In review Ram Pai 1 participant 1 message Jan 22, 2019 PowerPC

lore
Share & tools
lore

Ram Pai

author
#0 lore raw

PATCH 6/13 KVM: PPC: Ultravisor: UV_RESTRICTED_SPR_WRITE ucall

Introduce UV_RESTRICTED_SPR_WRITE. Hypervisor loses access to some registers when Ultravisor is enabled. Hypervisor can request write access to those registers using UV_RESTRICTED_SPR_WRITE ucall.

---
 arch/powerpc/include/asm/ucall-api.h        | 6 ++++++
 arch/powerpc/include/uapi/asm/uapi_uvcall.h | 1 +
 2 files changed, 7 insertions(+)
arch/powerpc/include/asm/ucall-api.h +6 -0
index f411dcb..7723b4e 100644
@@ -31,5 +31,11 @@ static inline int uv_register_pate(u64 lpid, u64 dw0, u64 dw1)
 	return plpar_ucall(UV_WRITE_PATE, retbuf, lpid, dw0, dw1);
 }
 
+static inline int uv_restricted_spr_write(u64 reg, u64 val)
+{
+	unsigned long retbuf[PLPAR_UCALL_BUFSIZE];
+
+	return plpar_ucall(UV_RESTRICTED_SPR_WRITE, retbuf, reg, val);
+}
 #endif /* __ASSEMBLY__ */
 #endif	/* _ASM_POWERPC_UCALL_API_H */
arch/powerpc/include/uapi/asm/uapi_uvcall.h +1 -0
index 7f018cf..d76dd1f 100644
@@ -9,4 +9,5 @@
 #define UAPI_UC_H
 
 #define UV_WRITE_PATE 	0xf104
+#define UV_RESTRICTED_SPR_WRITE 0xf108
 #endif /* #ifndef UAPI_UC_H */
Signature · 1 line
1.8.3.1