summaryrefslogtreecommitdiff
path: root/arch/s390/include/asm/switch_to.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/include/asm/switch_to.h')
-rw-r--r--arch/s390/include/asm/switch_to.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/s390/include/asm/switch_to.h b/arch/s390/include/asm/switch_to.h
index 0e0109578021..2542a7e4c8b4 100644
--- a/arch/s390/include/asm/switch_to.h
+++ b/arch/s390/include/asm/switch_to.h
@@ -114,6 +114,19 @@ static inline void save_vx_regs(__vector128 *vxrs)
: "=Q" (*(addrtype *) vxrs) : : "1");
}
+static inline void save_vx_regs_safe(__vector128 *vxrs)
+{
+ unsigned long cr0, flags;
+
+ flags = arch_local_irq_save();
+ __ctl_store(cr0, 0, 0);
+ __ctl_set_bit(0, 17);
+ __ctl_set_bit(0, 18);
+ save_vx_regs(vxrs);
+ __ctl_load(cr0, 0, 0);
+ arch_local_irq_restore(flags);
+}
+
static inline void restore_vx_regs(__vector128 *vxrs)
{
typedef struct { __vector128 _[__NUM_VXRS]; } addrtype;