Re: crash with cpucontrol/microcode update : Today's -CURRENT

From: Konstantin Belousov <kostikbel_at_gmail.com>
Date: Sat, 10 Aug 2013 23:02:56 +0300
On Sat, Aug 10, 2013 at 02:06:10PM -0500, Larry Rosenman wrote:
> I'm getting the following _at_R254183:
> when I try to run the microcode_update.
> 
> Just started with yesterday's -CURRENT.

> (kgdb) #0  doadump (textdump=<value optimized out>) at pcpu.h:236
> #1  0xffffffff8051d6f0 in kern_reboot (howto=260)
>      at /usr/src/sys/kern/kern_shutdown.c:447
> #2  0xffffffff8051da77 in panic (fmt=<value optimized out>)
>      at /usr/src/sys/kern/kern_shutdown.c:754
> #3  0xffffffff80780d9a in trap_fatal (frame=<value optimized out>,
>      eva=<value optimized out>) at /usr/src/sys/amd64/amd64/trap.c:873
> #4  0xffffffff80781199 in trap_pfault (frame=0x0, usermode=0)
>      at /usr/src/sys/amd64/amd64/trap.c:731
> #5  0xffffffff80780792 in trap (frame=0xffffff900d55c7b0)
>      at /usr/src/sys/amd64/amd64/trap.c:463
> #6  0xffffffff8076ad02 in calltrap ()
>      at /usr/src/sys/amd64/amd64/exception.S:232
> #7  0xffffffff80709be9 in vm_page_unwire (m=0x0, activate=0)
>      at /usr/src/sys/vm/vm_page.c:2356
> #8  0xffffffff806fb4ed in kmem_unback (object=0xffffffff80c57550,
>      addr=<value optimized out>, size=4096) at /usr/src/sys/vm/vm_kern.c:404
> #9  0xffffffff806fb5a4 in kmem_free (vmem=0xffffffff80bd7780,
>      addr=18446741884987129872, size=4096) at /usr/src/sys/vm/vm_kern.c:421
> #10 0xffffffff80506597 in contigfree (addr=0x0, size=4048,
>      type=0xffffffff812d5ea0) at /usr/src/sys/kern/kern_malloc.c:435
> #11 0xffffffff812d5a79 in cpuctl_ioctl (dev=<value optimized out>,
>      cmd=<value optimized out>, data=0xfffffe000d2a2f80 "0?c",
>      flags=<value optimized out>, td=<value optimized out>)
>      at /usr/src/sys/modules/cpuctl/../../dev/cpuctl/cpuctl.c:480
> #12 0xffffffff8041962f in devfs_ioctl_f (fp=0xfffffe001e68cbe0,
>      com=3222299396, data=0xfffffe000d2a2f80, cred=<value optimized out>,
>      td=0xfffffe0252ebd490) at /usr/src/sys/fs/devfs/devfs_vnops.c:757
> #13 0xffffffff8056b3be in kern_ioctl (td=0xfffffe0252ebd490,
>      fd=<value optimized out>, com=0) at file.h:306
> #14 0xffffffff8056b13f in sys_ioctl (td=0xfffffe0252ebd490,
>      uap=0xffffff900d55cb80) at /usr/src/sys/kern/sys_generic.c:693
> #15 0xffffffff80781697 in amd64_syscall (td=0xfffffe0252ebd490, traced=0)
>      at subr_syscall.c:134
> #16 0xffffffff8076afeb in Xfast_syscall ()
>      at /usr/src/sys/amd64/amd64/exception.S:391

Try this.

diff --git a/sys/dev/cpuctl/cpuctl.c b/sys/dev/cpuctl/cpuctl.c
index 742ef0db..4e5abb2 100644
--- a/sys/dev/cpuctl/cpuctl.c
+++ b/sys/dev/cpuctl/cpuctl.c
_at__at_ -346,8 +346,7 _at__at_ update_intel(int cpu, cpuctl_update_args_t *args, struct thread *td)
 	else
 		ret = EEXIST;
 fail:
-	if (ptr != NULL)
-		contigfree(ptr, args->size, M_CPUCTL);
+	free(ptr, M_CPUCTL);
 	return (ret);
 }
 
_at__at_ -476,8 +475,7 _at__at_ update_via(int cpu, cpuctl_update_args_t *args, struct thread *td)
 	else
 		ret = 0;
 fail:
-	if (ptr != NULL)
-		contigfree(ptr, args->size, M_CPUCTL);
+	free(ptr, M_CPUCTL);
 	return (ret);
 }
 

Received on Sat Aug 10 2013 - 18:03:02 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:40 UTC