: "memory");
}
+static __always_inline void fpu_lfpc(unsigned int *fpc)
+{
+ instrument_read(fpc, sizeof(*fpc));
+ asm volatile("lfpc %[fpc]"
+ :
+ : [fpc] "Q" (*fpc)
+ : "memory");
+}
+
/**
* fpu_lfpc_safe - Load floating point control register safely.
* @fpc: new value for floating point control register
: "memory");
}
+static __always_inline void fpu_sfpc(unsigned int fpc)
+{
+ asm volatile("sfpc %[fpc]"
+ :
+ : [fpc] "d" (fpc)
+ : "memory");
+}
+
+static __always_inline void fpu_stfpc(unsigned int *fpc)
+{
+ instrument_write(fpc, sizeof(*fpc));
+ asm volatile("stfpc %[fpc]"
+ : [fpc] "=Q" (*fpc)
+ :
+ : "memory");
+}
+
#endif /* __ASSEMBLY__ */
#endif /* __ASM_S390_FPU_INSN_H */
* in use by the previous context.
*/
flags &= state->mask;
- if (flags & KERNEL_FPC) {
- /* Save floating point control */
- asm volatile("stfpc %0" : "=Q" (state->fpc));
- }
+ if (flags & KERNEL_FPC)
+ fpu_stfpc(&state->fpc);
if (!cpu_has_vx()) {
if (flags & KERNEL_VXR_LOW)
save_fp_regs(state->fprs);
* current context.
*/
flags &= state->mask;
- if (flags & KERNEL_FPC) {
- /* Restore floating-point controls */
- asm volatile("lfpc %0" : : "Q" (state->fpc));
- }
+ if (flags & KERNEL_FPC)
+ fpu_lfpc(&state->fpc);
if (!cpu_has_vx()) {
if (flags & KERNEL_VXR_LOW)
load_fp_regs(state->fprs);
state = ¤t->thread.fpu;
regs = current->thread.fpu.regs;
- asm volatile("stfpc %0" : "=Q" (state->fpc));
+ fpu_stfpc(&state->fpc);
if (likely(cpu_has_vx())) {
asm volatile("lgr 1,%0\n"
"VSTM 0,15,0,1\n"
void execve_tail(void)
{
current->thread.fpu.fpc = 0;
- asm volatile("sfpc %0" : : "d" (0));
+ fpu_sfpc(0);
}
struct task_struct *__switch_to(struct task_struct *prev, struct task_struct *next)