On Mon, Apr 20, 2020 at 10:14 PM Jason A. Donenfeld Jason@zx2c4.com wrote:
Hi David,
On Mon, Apr 20, 2020 at 2:32 AM David Laight David.Laight@aculab.com wrote:
Maybe kernel_fp_begin() should be passed the address of somewhere the address of an fpu save area buffer can be written to. Then the pre-emption code can allocate the buffer and save the state into it.
Interesting idea. It looks like `struct xregs_state` is only 576 bytes. That's not exactly small, but it's not insanely huge either, and maybe we could justifiably stick that on the stack, or even reserve part of the stack allocation for that that the function would know about, without needing to specify any address.
Hah-hah, nevermind here. extended_state_area is of course huge, bringing the whole structure to a whopping 3k with avx512. :)