From 90294f99e606a952ac83a27c433bf5546bf27c3c Mon Sep 17 00:00:00 2001 From: jdolecek Date: Wed, 8 Jul 2020 11:11:00 +0000 Subject: [PATCH] initalize ci_kfpu_spl, to avoid triggering KASSERT() in fpu_kern_enter() Follows revision 1.177 of sys/arch/x86/x86/cpu.c: """ Add a small API for in-kernel FPU operations. fpu_kern_enter(); /* do FPU stuff */ fpu_kern_leave(); """ With this DomU kernel boots with: [ 2.0000571] aes: Intel AES-NI --- sys/arch/xen/x86/cpu.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/arch/xen/x86/cpu.c b/sys/arch/xen/x86/cpu.c index 0957c08ae5f3..e2e9245bb1ca 100644 --- a/sys/arch/xen/x86/cpu.c +++ b/sys/arch/xen/x86/cpu.c @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.c,v 1.137 2020/06/27 09:54:08 jdolecek Exp $ */ +/* $NetBSD: cpu.c,v 1.138 2020/07/08 11:11:00 jdolecek Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -65,7 +65,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.137 2020/06/27 09:54:08 jdolecek Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.138 2020/07/08 11:11:00 jdolecek Exp $"); #include "opt_ddb.h" #include "opt_multiprocessor.h" @@ -232,6 +232,7 @@ cpu_attach(device_t parent, device_t self, void *aux) ci->ci_cpuid = caa->cpu_number; ci->ci_vcpu = NULL; ci->ci_index = nphycpu++; + ci->ci_kfpu_spl = -1; if (!pmf_device_register(self, NULL, NULL)) aprint_error_dev(self, "couldn't establish power handler\n"); @@ -391,6 +392,7 @@ cpu_attach_common(device_t parent, device_t self, void *aux) ci->ci_dev = self; ci->ci_cpuid = cpunum; ci->ci_vcpuid = cpunum; + ci->ci_kfpu_spl = -1; KASSERT(HYPERVISOR_shared_info != NULL); KASSERT(cpunum < XEN_LEGACY_MAX_VCPUS);