aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/include/uapi/asm
diff options
context:
space:
mode:
authorDavid Hildenbrand <dahi@linux.vnet.ibm.com>2016-01-18 08:46:34 -0500
committerChristian Borntraeger <borntraeger@de.ibm.com>2016-02-10 07:12:49 -0500
commit6fd8e67dd83437118cf46a4a9c224142004c3d51 (patch)
tree99b5feb06cbeb2fd6dbd0fd3a6adbac54dbe37fd /arch/s390/include/uapi/asm
parentf6aa6dc44948739be39c20bbcbbe8cff5d77fe18 (diff)
KVM: s390: sync of fp registers via kvm_run
As we already store the floating point registers in the vector save area in floating point register format when we don't have MACHINE_HAS_VX, we can directly expose them to user space using a new sync flag. The floating point registers will be valid when KVM_SYNC_FPRS is set. The fpc will also be valid when KVM_SYNC_FPRS is set. Either KVM_SYNC_FPRS or KVM_SYNC_VRS will be enabled, never both. Let's also change two positions where we access vrs, making the code easier to read and one comment superfluous. Suggested-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'arch/s390/include/uapi/asm')
-rw-r--r--arch/s390/include/uapi/asm/kvm.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/s390/include/uapi/asm/kvm.h b/arch/s390/include/uapi/asm/kvm.h
index fe84bd5fe7ce..347fe5afa419 100644
--- a/arch/s390/include/uapi/asm/kvm.h
+++ b/arch/s390/include/uapi/asm/kvm.h
@@ -154,6 +154,7 @@ struct kvm_guest_debug_arch {
154#define KVM_SYNC_PFAULT (1UL << 5) 154#define KVM_SYNC_PFAULT (1UL << 5)
155#define KVM_SYNC_VRS (1UL << 6) 155#define KVM_SYNC_VRS (1UL << 6)
156#define KVM_SYNC_RICCB (1UL << 7) 156#define KVM_SYNC_RICCB (1UL << 7)
157#define KVM_SYNC_FPRS (1UL << 8)
157/* definition of registers in kvm_run */ 158/* definition of registers in kvm_run */
158struct kvm_sync_regs { 159struct kvm_sync_regs {
159 __u64 prefix; /* prefix register */ 160 __u64 prefix; /* prefix register */
@@ -168,9 +169,12 @@ struct kvm_sync_regs {
168 __u64 pft; /* pfault token [PFAULT] */ 169 __u64 pft; /* pfault token [PFAULT] */
169 __u64 pfs; /* pfault select [PFAULT] */ 170 __u64 pfs; /* pfault select [PFAULT] */
170 __u64 pfc; /* pfault compare [PFAULT] */ 171 __u64 pfc; /* pfault compare [PFAULT] */
171 __u64 vrs[32][2]; /* vector registers */ 172 union {
173 __u64 vrs[32][2]; /* vector registers (KVM_SYNC_VRS) */
174 __u64 fprs[16]; /* fp registers (KVM_SYNC_FPRS) */
175 };
172 __u8 reserved[512]; /* for future vector expansion */ 176 __u8 reserved[512]; /* for future vector expansion */
173 __u32 fpc; /* only valid with vector registers */ 177 __u32 fpc; /* valid on KVM_SYNC_VRS or KVM_SYNC_FPRS */
174 __u8 padding[52]; /* riccb needs to be 64byte aligned */ 178 __u8 padding[52]; /* riccb needs to be 64byte aligned */
175 __u8 riccb[64]; /* runtime instrumentation controls block */ 179 __u8 riccb[64]; /* runtime instrumentation controls block */
176}; 180};