]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/pseries/svm: Export guest SVM status to user space via sysfs
authorRyan Grimm <grimm@linux.vnet.ibm.com>
Tue, 20 Aug 2019 02:13:21 +0000 (23:13 -0300)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 29 Aug 2019 23:55:41 +0000 (09:55 +1000)
commita311b871c49ad285248427027fd465cab031da4d
treee1a92b157035854c3787daf73e71e302bc60efda
parent757945ba5f0d93b2fd4a99d57295834b4bf80158
powerpc/pseries/svm: Export guest SVM status to user space via sysfs

User space might want to know it's running in a secure VM.  It can't do
a mfmsr because mfmsr is a privileged instruction.

The solution here is to create a cpu attribute:

/sys/devices/system/cpu/svm

which will read 0 or 1 based on the S bit of the current CPU.

Signed-off-by: Ryan Grimm <grimm@linux.vnet.ibm.com>
Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20190820021326.6884-12-bauerman@linux.ibm.com
Documentation/ABI/testing/sysfs-devices-system-cpu
arch/powerpc/kernel/sysfs.c