NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

PR/59371 CVS commit: src/sys/arch



The following reply was made to PR kern/59371; it has been noted by GNATS.

From: "Taylor R Campbell" <riastradh%netbsd.org@localhost>
To: gnats-bugs%gnats.NetBSD.org@localhost
Cc: 
Subject: PR/59371 CVS commit: src/sys/arch
Date: Mon, 28 Apr 2025 13:01:28 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Mon Apr 28 13:01:28 UTC 2025
 
 Modified Files:
 	src/sys/arch/amd64/include: pcb.h
 	src/sys/arch/x86/include: specialreg.h
 	src/sys/arch/x86/x86: fpu.c
 
 Log Message:
 xen: Stop-gap FPU PCB fix; disable Intel AMX for now.
 
 Since the custom cpu_uarea_alloc/free are disabled under XENPV,
 nothing would initialize struct pcb::pcb_savefpu to point either to
 struct pcb::pcb_savefpusmall, or to a separately allocated large area
 on machines with Intel AMX TILECFG/TILEDATA requiring it.  So the
 memset in fpu_lwp_fork would crash on null pointer dereference:
 
 [   1.0000030] uvm_fault(0xffffffff8094a300, 0x0, 2) -> e
 [   1.0000030] fatal page fault in supervisor mode
 [   1.0000030] trap type 6 code 0x2 rip 0xffffffff8062795c cs 0xe030 rflags 0x10202 cr2 0 ilevel 0 rsp 0xffffffff80adad38
 [   1.0000030] curlwp 0xffffffff8078f880 pid 0.0 lowest kstack 0xffffffff80ad62c0
 kernel: page fault trap, code=0
 Stopped in pid 0.0 (system) at  netbsd:memset+0x2c:     repe stosq      %es:(%rdi)
 memset() at netbsd:memset+0x2c
 lwp_create() at netbsd:lwp_create+0x2f1
 fork1() at netbsd:fork1+0x42c
 main() at netbsd:main+0x44f
 
 In order to support Intel AMX TILECFG/TILEDATA, or any other CPU
 extensions that increase the XSAVE area beyond what fits in a single
 page after struct pcb, we would need to enable the the custom
 cpu_uarea_alloc/free.  Currently that would imply allocating stack
 guard pages (`redzone') under XENPV; if there's some reason the stack
 guard pages don't work, we could also push #ifdef XENPV conditionals
 into cpu_uarea_alloc/free to cover the guard pages -- to be
 considered.
 
 PR kern/59371: Xen domU uvm_fault since FPU state allocation patch
 
 PR port-amd64/57661: Crash when booting on Xeon Silver 4416+ in
 KVM/Qemu
 
 
 To generate a diff of this commit:
 cvs rdiff -u -r1.34 -r1.35 src/sys/arch/amd64/include/pcb.h
 cvs rdiff -u -r1.218 -r1.219 src/sys/arch/x86/include/specialreg.h
 cvs rdiff -u -r1.90 -r1.91 src/sys/arch/x86/x86/fpu.c
 
 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.
 


Home | Main Index | Thread Index | Old Index