[PATCH 3/3] x86: avoid copying dynamic FP state from init_task
Ingo Molnar
mingo at kernel.org
Wed Feb 26 05:23:03 PST 2025
* Benjamin Berg <benjamin at sipsolutions.net> wrote:
> > Note that this patch, while it still applies cleanly, crashes/hangs
> > the x86-64 defconfig kernel bootup in the early boot phase in a KVM
> > guest bootup.
>
> Oh, outch. It seems that arch_task_struct_size can actually become
> smaller than sizeof(init_task) if the CPU does not have certain
> features.
>
> See fpu__init_task_struct_size, which does:
>
> int task_size = sizeof(struct task_struct);
> task_size -= sizeof(current->thread.fpu.__fpstate.regs);
> task_size += fpu_kernel_cfg.default_size;
>
> I'll submit a new version of the patch and then also switch to use
> memcpy_and_pad.
Thank you!
Ingo
More information about the linux-um
mailing list