amd64/i386: Remove dead code to clear XSAVE header

If XSAVE is being used, the XSAVE header will be overwritten either by
copying it from the parent thread in copy_thread for user threads, or
by a fresh copy from fpu/npx_initialstate on the first use of the FPU
for kernel threads.

Reviewed by:	kib
Sponsored by:	AFRL, DARPA
Pull Request:	https://ron-dev.freebsd.org/FreeBSD/src/pulls/23
This commit is contained in:
John Baldwin
2026-03-28 11:19:10 +00:00
parent 187b46e1c4
commit 59d67f2868
2 changed files with 0 additions and 12 deletions
-6
View File
@@ -375,18 +375,12 @@ void
cpu_thread_alloc(struct thread *td)
{
struct pcb *pcb;
struct xstate_hdr *xhdr;
set_top_of_stack_td(td);
td->td_pcb = pcb = get_pcb_td(td);
td->td_frame = (struct trapframe *)td->td_md.md_stack_base - 1;
td->td_md.md_usr_fpu_save = fpu_save_area_alloc();
pcb->pcb_save = get_pcb_user_save_pcb(pcb);
if (use_xsave) {
xhdr = (struct xstate_hdr *)(pcb->pcb_save + 1);
bzero(xhdr, sizeof(*xhdr));
xhdr->xstate_bv = xsave_mask;
}
}
void
-6
View File
@@ -373,7 +373,6 @@ void
cpu_thread_alloc(struct thread *td)
{
struct pcb *pcb;
struct xstate_hdr *xhdr;
/*
* The -VM86_STACK_SPACE (-16) is so we can expand the trapframe
@@ -384,11 +383,6 @@ cpu_thread_alloc(struct thread *td)
VM86_STACK_SPACE) - 1;
pcb->pcb_ext = NULL;
pcb->pcb_save = get_pcb_user_save_pcb(pcb);
if (use_xsave) {
xhdr = (struct xstate_hdr *)(pcb->pcb_save + 1);
bzero(xhdr, sizeof(*xhdr));
xhdr->xstate_bv = xsave_mask;
}
}
void