KVM: PPC: Ultravisor: UV_RESTRICTED_SPR_READ ucall
PATCH 7/13 KVM: PPC: Ultravisor: UV_RESTRICTED_SPR_READ ucall
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 <[email protected]>
--- arch/powerpc/include/asm/ucall-api.h | 11 +++++++++++ arch/powerpc/include/uapi/asm/uapi_uvcall.h | 1 + 2 files changed, 12 insertions(+)
arch/powerpc/include/asm/ucall-api.h +11 -0
@@ -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 */
arch/powerpc/include/uapi/asm/uapi_uvcall.h +1 -0
@@ -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 */
Signature · 1 line
1.8.3.1