Skip to content

Commit

Permalink
s390/fpu: change type of fpu mask from u32 to int
Browse files Browse the repository at this point in the history
Change type of fpu mask consistently from u32 to int. This is a
prerequisite to make the kernel fpu usage preemptible. Upcoming code
uses __atomic* ops which work with int pointers.

Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
  • Loading branch information
Heiko Carstens committed Feb 16, 2024
1 parent 87c5c70 commit c038b98
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion arch/s390/include/asm/fpu-types.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ struct fpu {

/* In-kernel FPU state structure */
struct kernel_fpu {
u32 mask;
int mask;
u32 fpc;
union {
freg_t fprs[__NUM_FPRS];
Expand Down
8 changes: 4 additions & 4 deletions arch/s390/include/asm/fpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ enum {
*
* Prefer using the kernel_fpu_begin()/kernel_fpu_end() pair of functions.
*/
void __kernel_fpu_begin(struct kernel_fpu *state, u32 flags);
void __kernel_fpu_end(struct kernel_fpu *state, u32 flags);
void __kernel_fpu_begin(struct kernel_fpu *state, int flags);
void __kernel_fpu_end(struct kernel_fpu *state, int flags);

static __always_inline void save_vx_regs(__vector128 *vxrs)
{
Expand Down Expand Up @@ -144,7 +144,7 @@ static __always_inline void load_fp_regs(freg_t *fprs)
fpu_ld(15, &fprs[15]);
}

static inline void kernel_fpu_begin(struct kernel_fpu *state, u32 flags)
static inline void kernel_fpu_begin(struct kernel_fpu *state, int flags)
{
preempt_disable();
state->mask = S390_lowcore.fpu_flags;
Expand All @@ -158,7 +158,7 @@ static inline void kernel_fpu_begin(struct kernel_fpu *state, u32 flags)
S390_lowcore.fpu_flags |= flags;
}

static inline void kernel_fpu_end(struct kernel_fpu *state, u32 flags)
static inline void kernel_fpu_end(struct kernel_fpu *state, int flags)
{
S390_lowcore.fpu_flags = state->mask;
if (state->mask & flags) {
Expand Down
8 changes: 4 additions & 4 deletions arch/s390/kernel/fpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
#include <linux/sched.h>
#include <asm/fpu.h>

void __kernel_fpu_begin(struct kernel_fpu *state, u32 flags)
void __kernel_fpu_begin(struct kernel_fpu *state, int flags)
{
__vector128 *vxrs = state->vxrs;
u32 mask;
int mask;

/*
* Limit the save to the FPU/vector registers already
Expand Down Expand Up @@ -58,10 +58,10 @@ void __kernel_fpu_begin(struct kernel_fpu *state, u32 flags)
}
EXPORT_SYMBOL(__kernel_fpu_begin);

void __kernel_fpu_end(struct kernel_fpu *state, u32 flags)
void __kernel_fpu_end(struct kernel_fpu *state, int flags)
{
__vector128 *vxrs = state->vxrs;
u32 mask;
int mask;

/*
* Limit the restore to the FPU/vector registers of the
Expand Down

0 comments on commit c038b98

Please sign in to comment.