>> static void fpu_lock_guest_permissions(void) >> { >> @@ -236,19 +253,18 @@ bool fpu_alloc_guest_fpstate(struct fpu_guest *gfpu) >> struct fpstate *fpstate; >> unsigned int size; >> >> - size = fpu_kernel_cfg.default_size + ALIGN(offsetof(struct fpstate, regs), 64); >> + size = guest_default_cfg.size + ALIGN(offsetof(struct fpstate, regs), 64); >> + >> fpstate = vzalloc(size); >> if (!fpstate) >> return false; >> >> /* Leave xfd to 0 (the reset value defined by spec) */ >> - __fpstate_reset(fpstate, 0); >> + __guest_fpstate_reset(fpstate, 0); > >Given that there is a single caller for each of __fpstate_reset() and >__guest_fpstate_reset(), keeping the helpers does more harm than good IMO. Seems Dave strongly dislikes inlining the helpers https://lore.kernel.org/kvm/98dda94f-b805-4e0e-871a-085eb2f6ff20@xxxxxxxxx/ >Passing in '0' and setting xfd in __guest_fpstate_reset() is especially pointless. Agreed. Giving Dave's feedback, how about tweaking __fpstate_reset() for guest FPUs: