Introduce UV_RESTRICTED_SPR_READ. Hypervisor loses previlege to access some registers when Ultravisor is enabled. Hypervisor can request read access to those registers using UV_RESTRICTED_SPR_READ ucall. Signed-off-by: Ram Pai <linuxram@xxxxxxxxxx> --- arch/powerpc/include/asm/ucall-api.h | 11 +++++++++++ arch/powerpc/include/uapi/asm/uapi_uvcall.h | 1 + 2 files changed, 12 insertions(+) diff --git a/arch/powerpc/include/asm/ucall-api.h b/arch/powerpc/include/asm/ucall-api.h index 7723b4e..ffafd9e 100644 --- a/arch/powerpc/include/asm/ucall-api.h +++ b/arch/powerpc/include/asm/ucall-api.h @@ -37,5 +37,16 @@ static inline int uv_restricted_spr_write(u64 reg, u64 val) return plpar_ucall(UV_RESTRICTED_SPR_WRITE, retbuf, reg, val); } +static inline int uv_restricted_spr_read(u64 reg, u64 *val) +{ + long rc; + unsigned long retbuf[PLPAR_UCALL_BUFSIZE]; + + rc = plpar_ucall(UV_RESTRICTED_SPR_READ, retbuf, reg); + + *val = retbuf[0]; + return rc; +} + #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 d76dd1f..bbcd026 100644 --- a/arch/powerpc/include/uapi/asm/uapi_uvcall.h +++ b/arch/powerpc/include/uapi/asm/uapi_uvcall.h @@ -10,4 +10,5 @@ #define UV_WRITE_PATE 0xf104 #define UV_RESTRICTED_SPR_WRITE 0xf108 +#define UV_RESTRICTED_SPR_READ 0xf10C #endif /* #ifndef UAPI_UC_H */ -- 1.8.3.1