[06/13] KVM: PPC: Ultravisor: UV_RESTRICTED_SPR_WRITE ucall
diff mbox series

Message ID 1548172784-27414-7-git-send-email-linuxram@us.ibm.com
State Changes Requested
Headers show
Series
  • KVM: PPC: Paravirtualize KVM to support Ultravisor
Related show

Commit Message

Ram Pai Jan. 22, 2019, 3:59 p.m. UTC
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.

Signed-off-by: Ram Pai <linuxram@us.ibm.com>
---
 arch/powerpc/include/asm/ucall-api.h        | 6 ++++++
 arch/powerpc/include/uapi/asm/uapi_uvcall.h | 1 +
 2 files changed, 7 insertions(+)

Patch
diff mbox series

diff --git a/arch/powerpc/include/asm/ucall-api.h b/arch/powerpc/include/asm/ucall-api.h
index f411dcb..7723b4e 100644
--- a/arch/powerpc/include/asm/ucall-api.h
+++ b/arch/powerpc/include/asm/ucall-api.h
@@ -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 */
diff --git a/arch/powerpc/include/uapi/asm/uapi_uvcall.h b/arch/powerpc/include/uapi/asm/uapi_uvcall.h
index 7f018cf..d76dd1f 100644
--- a/arch/powerpc/include/uapi/asm/uapi_uvcall.h
+++ b/arch/powerpc/include/uapi/asm/uapi_uvcall.h
@@ -9,4 +9,5 @@ 
 #define UAPI_UC_H
 
 #define UV_WRITE_PATE 	0xf104
+#define UV_RESTRICTED_SPR_WRITE 0xf108
 #endif /* #ifndef UAPI_UC_H */