Module Name: src Committed By: riastradh Date: Tue Oct 17 14:17:42 UTC 2023
Modified Files: src/sys/arch/x86/x86: identcpu.c Log Message: Revert "x86: Panic early if fpu save size is too large, take 2." Apparently this is too early to print anything useful, so it just causes a reboot loop. PR kern/57661 To generate a diff of this commit: cvs rdiff -u -r1.127 -r1.128 src/sys/arch/x86/x86/identcpu.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/x86/x86/identcpu.c diff -u src/sys/arch/x86/x86/identcpu.c:1.127 src/sys/arch/x86/x86/identcpu.c:1.128 --- src/sys/arch/x86/x86/identcpu.c:1.127 Tue Oct 17 11:12:33 2023 +++ src/sys/arch/x86/x86/identcpu.c Tue Oct 17 14:17:42 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: identcpu.c,v 1.127 2023/10/17 11:12:33 riastradh Exp $ */ +/* $NetBSD: identcpu.c,v 1.128 2023/10/17 14:17:42 riastradh Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.127 2023/10/17 11:12:33 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.128 2023/10/17 14:17:42 riastradh Exp $"); #include "opt_xen.h" @@ -52,7 +52,6 @@ __KERNEL_RCSID(0, "$NetBSD: identcpu.c,v #include <machine/specialreg.h> #include <machine/pio.h> #include <machine/cpu.h> -#include <machine/pcb.h> #include <x86/cputypes.h> #include <x86/cacheinfo.h> @@ -770,16 +769,8 @@ cpu_probe_fpu(struct cpu_info *ci) /* Get features and maximum size of the save area */ x86_cpuid(0xd, descs); - if (descs[2] > sizeof(struct fxsave)) { - CTASSERT(offsetof(struct pcb, pcb_savefpu) < PAGE_SIZE); - const unsigned max_fpu_save_size = - PAGE_SIZE - offsetof(struct pcb, pcb_savefpu); - if (descs[2] > max_fpu_save_size) { - panic("CPU's FPU save size too large: %u > %u", - descs[2], max_fpu_save_size); - } + if (descs[2] > sizeof(struct fxsave)) x86_fpu_save_size = descs[2]; - } x86_xsave_features = (uint64_t)descs[3] << 32 | descs[0];