<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/arch/x86/kernel/fpu/regset.c, branch linus/master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/arch/x86/kernel/fpu/regset.c?h=linus%2Fmaster</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/arch/x86/kernel/fpu/regset.c?h=linus%2Fmaster'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2022-02-18T10:23:21Z</updated>
<entry>
<title>x86/ptrace: Fix xfpregs_set()'s incorrect xmm clearing</title>
<updated>2022-02-18T10:23:21Z</updated>
<author>
<name>Andy Lutomirski</name>
<email>luto@kernel.org</email>
</author>
<published>2022-02-14T12:05:49Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=44cad52cc14ae10062f142ec16ede489bccf4469'/>
<id>urn:sha1:44cad52cc14ae10062f142ec16ede489bccf4469</id>
<content type='text'>
xfpregs_set() handles 32-bit REGSET_XFP and 64-bit REGSET_FP. The actual
code treats these regsets as modern FX state (i.e. the beginning part of
XSTATE). The declarations of the regsets thought they were the legacy
i387 format. The code thought they were the 32-bit (no xmm8..15) variant
of XSTATE and, for good measure, made the high bits disappear by zeroing
the wrong part of the buffer. The latter broke ptrace, and everything
else confused anyone trying to understand the code. In particular, the
nonsense definitions of the regsets confused me when I wrote this code.

Clean this all up. Change the declarations to match reality (which
shouldn't change the generated code, let alone the ABI) and fix
xfpregs_set() to clear the correct bits and to only do so for 32-bit
callers.

Fixes: 6164331d15f7 ("x86/fpu: Rewrite xfpregs_set()")
Reported-by: Luís Ferreira &lt;contact@lsferreira.net&gt;
Signed-off-by: Andy Lutomirski &lt;luto@kernel.org&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Link: https://bugzilla.kernel.org/show_bug.cgi?id=215524
Link: https://lore.kernel.org/r/YgpFnZpF01WwR8wU@zn.tnic
</content>
</entry>
<entry>
<title>x86/fpu: Move xstate size to fpu_*_cfg</title>
<updated>2021-10-21T17:38:55Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2021-10-14T23:09:34Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=2bd264bce238cedbf00bde1f28ad51ba45b9114e'/>
<id>urn:sha1:2bd264bce238cedbf00bde1f28ad51ba45b9114e</id>
<content type='text'>
Use the new kernel and user space config storage to store and retrieve the
XSTATE buffer sizes. The default and the maximum size are the same for now,
but will change when support for dynamically enabled features is added.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Link: https://lkml.kernel.org/r/20211014230739.296830097@linutronix.de
</content>
</entry>
<entry>
<title>x86/fpu/xstate: Use fpstate for copy_uabi_to_xstate()</title>
<updated>2021-10-21T12:24:14Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2021-10-13T14:55:55Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=49e4eb4125d506937e52e10c34c8cafd93ab0ed6'/>
<id>urn:sha1:49e4eb4125d506937e52e10c34c8cafd93ab0ed6</id>
<content type='text'>
Prepare for dynamically enabled states per task. The function needs to
retrieve the features and sizes which are valid in a fpstate
context. Retrieve them from fpstate.

Move the function declarations to the core header as they are not
required anywhere else.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Link: https://lkml.kernel.org/r/20211013145323.233529986@linutronix.de
</content>
</entry>
<entry>
<title>x86/fpu/regset: Convert to fpstate</title>
<updated>2021-10-20T20:35:29Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2021-10-13T14:55:36Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=caee31a36c33ed7788d0b3d93a663860157f6c55'/>
<id>urn:sha1:caee31a36c33ed7788d0b3d93a663860157f6c55</id>
<content type='text'>
Convert regset related code to the new register storage mechanism in
preparation for dynamically sized buffers.

No functional change.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Link: https://lkml.kernel.org/r/20211013145322.555239736@linutronix.de
</content>
</entry>
<entry>
<title>x86/fpu: Replace the includes of fpu/internal.h</title>
<updated>2021-10-20T13:27:29Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2021-10-15T01:16:39Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=b56d2795b29792c465cc8ef036abad5127a003fb'/>
<id>urn:sha1:b56d2795b29792c465cc8ef036abad5127a003fb</id>
<content type='text'>
Now that the file is empty, fixup all references with the proper includes
and delete the former kitchen sink.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Link: https://lkml.kernel.org/r/20211015011540.001197214@linutronix.de
</content>
</entry>
<entry>
<title>x86/fpu: Move mxcsr related code to core</title>
<updated>2021-10-20T13:27:28Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2021-10-15T01:16:31Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=d9d005f32aac7362a1998f4b7fdf8874e91546bd'/>
<id>urn:sha1:d9d005f32aac7362a1998f4b7fdf8874e91546bd</id>
<content type='text'>
No need to expose that to code which only needs the XCR0 accessors.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Link: https://lkml.kernel.org/r/20211015011539.740012411@linutronix.de
</content>
</entry>
<entry>
<title>x86/fpu: Move fpregs_restore_userregs() to core</title>
<updated>2021-10-20T13:27:28Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2021-10-15T01:16:30Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=9848fb96839bfd6ad4c00748842ccfd5bd3b0346'/>
<id>urn:sha1:9848fb96839bfd6ad4c00748842ccfd5bd3b0346</id>
<content type='text'>
Only used internally in the FPU core code.

While at it, convert to the percpu accessors which verify preemption is
disabled.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Link: https://lkml.kernel.org/r/20211015011539.686806639@linutronix.de
</content>
</entry>
<entry>
<title>x86/fpu: Clean up CPU feature tests</title>
<updated>2021-10-20T13:27:27Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2021-10-15T01:16:21Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=d06241f52cfe4a0580856ef2cfac90dc7f752cae'/>
<id>urn:sha1:d06241f52cfe4a0580856ef2cfac90dc7f752cae</id>
<content type='text'>
Further disintegration of internal.h:

Move the CPU feature tests to a core header and remove the unused one.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Link: https://lkml.kernel.org/r/20211015011539.401510559@linutronix.de
</content>
</entry>
<entry>
<title>x86/fpu: Hook up PKRU into ptrace()</title>
<updated>2021-06-23T17:44:24Z</updated>
<author>
<name>Dave Hansen</name>
<email>dave.hansen@linux.intel.com</email>
</author>
<published>2021-06-23T12:02:19Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=e84ba47e313dbc097bf859bb6e4f9219883d5f78'/>
<id>urn:sha1:e84ba47e313dbc097bf859bb6e4f9219883d5f78</id>
<content type='text'>
One nice thing about having PKRU be XSAVE-managed is that it gets naturally
exposed into the XSAVE-using ABIs.  Now that XSAVE will not be used to
manage PKRU, these ABIs need to be manually enabled to deal with PKRU.

ptrace() uses copy_uabi_xstate_to_kernel() to collect the tracee's
XSTATE. As PKRU is not in the task's XSTATE buffer, use task-&gt;thread.pkru
for filling in up the ptrace buffer.

Signed-off-by: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Reviewed-by: Borislav Petkov &lt;bp@suse.de&gt;
Link: https://lkml.kernel.org/r/20210623121456.508770763@linutronix.de
</content>
</entry>
<entry>
<title>x86/fpu: Rename and sanitize fpu__save/copy()</title>
<updated>2021-06-23T16:55:56Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2021-06-23T12:02:06Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=b2681e791dbcee6acb1dca7a5076a0285109ac4c'/>
<id>urn:sha1:b2681e791dbcee6acb1dca7a5076a0285109ac4c</id>
<content type='text'>
Both function names are a misnomer.

fpu__save() is actually about synchronizing the hardware register state
into the task's memory state so that either coredump or a math exception
handler can inspect the state at the time where the problem happens.

The function guarantees to preserve the register state, while "save" is a
common terminology for saving the current state so it can be modified and
restored later. This is clearly not the case here.

Rename it to fpu_sync_fpstate().

fpu__copy() is used to clone the current task's FPU state when duplicating
task_struct. While the register state is a copy the rest of the FPU state
is not.

Name it accordingly and remove the really pointless @src argument along
with the warning which comes along with it.

Nothing can ever copy the FPU state of a non-current task. It's clearly
just a consequence of arch_dup_task_struct(), but it makes no sense to
proliferate that further.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Reviewed-by: Borislav Petkov &lt;bp@suse.de&gt;
Link: https://lkml.kernel.org/r/20210623121455.196727450@linutronix.de
</content>
</entry>
</feed>
