diff options
| author | John Baldwin <jhb@FreeBSD.org> | 2026-03-28 11:19:10 +0000 |
|---|---|---|
| committer | John Baldwin <jhb@FreeBSD.org> | 2026-05-27 13:43:46 +0000 |
| commit | 59d67f2868b17dc6ae897a3afd3ec4d96301e160 (patch) | |
| tree | a4089c0300365ade26aa4967ab6eaa5908347705 | |
| parent | 187b46e1c4d761efe2e92f662d68c0f49cd04b44 (diff) | |
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
| -rw-r--r-- | sys/amd64/amd64/vm_machdep.c | 6 | ||||
| -rw-r--r-- | sys/i386/i386/vm_machdep.c | 6 |
2 files changed, 0 insertions, 12 deletions
diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c index e37f122dffa3..8121a17d885a 100644 --- a/sys/amd64/amd64/vm_machdep.c +++ b/sys/amd64/amd64/vm_machdep.c @@ -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 diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c index 003f00070bff..bf08f7dd3882 100644 --- a/sys/i386/i386/vm_machdep.c +++ b/sys/i386/i386/vm_machdep.c @@ -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 |
