Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Aug 2013 23:02:56 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Larry Rosenman <ler@lerctr.org>
Cc:        freebsd-current@freebsd.org
Subject:   Re: crash with cpucontrol/microcode update : Today's -CURRENT
Message-ID:  <20130810200256.GI4972@kib.kiev.ua>
In-Reply-To: <alpine.BSF.2.00.1308101403250.1421@borg>
References:  <alpine.BSF.2.00.1308101403250.1421@borg>

next in thread | previous in thread | raw e-mail | index | archive | help

--t7jLP6F5mUg+B1HH
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Aug 10, 2013 at 02:06:10PM -0500, Larry Rosenman wrote:
> I'm getting the following @R254183:
> when I try to run the microcode_update.
>=20
> Just started with yesterday's -CURRENT.

> (kgdb) #0  doadump (textdump=3D<value optimized out>) at pcpu.h:236
> #1  0xffffffff8051d6f0 in kern_reboot (howto=3D260)
>      at /usr/src/sys/kern/kern_shutdown.c:447
> #2  0xffffffff8051da77 in panic (fmt=3D<value optimized out>)
>      at /usr/src/sys/kern/kern_shutdown.c:754
> #3  0xffffffff80780d9a in trap_fatal (frame=3D<value optimized out>,
>      eva=3D<value optimized out>) at /usr/src/sys/amd64/amd64/trap.c:873
> #4  0xffffffff80781199 in trap_pfault (frame=3D0x0, usermode=3D0)
>      at /usr/src/sys/amd64/amd64/trap.c:731
> #5  0xffffffff80780792 in trap (frame=3D0xffffff900d55c7b0)
>      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=3D0x0, activate=3D0)
>      at /usr/src/sys/vm/vm_page.c:2356
> #8  0xffffffff806fb4ed in kmem_unback (object=3D0xffffffff80c57550,
>      addr=3D<value optimized out>, size=3D4096) at /usr/src/sys/vm/vm_ker=
n.c:404
> #9  0xffffffff806fb5a4 in kmem_free (vmem=3D0xffffffff80bd7780,
>      addr=3D18446741884987129872, size=3D4096) at /usr/src/sys/vm/vm_kern=
=2Ec:421
> #10 0xffffffff80506597 in contigfree (addr=3D0x0, size=3D4048,
>      type=3D0xffffffff812d5ea0) at /usr/src/sys/kern/kern_malloc.c:435
> #11 0xffffffff812d5a79 in cpuctl_ioctl (dev=3D<value optimized out>,
>      cmd=3D<value optimized out>, data=3D0xfffffe000d2a2f80 "0?c",
>      flags=3D<value optimized out>, td=3D<value optimized out>)
>      at /usr/src/sys/modules/cpuctl/../../dev/cpuctl/cpuctl.c:480
> #12 0xffffffff8041962f in devfs_ioctl_f (fp=3D0xfffffe001e68cbe0,
>      com=3D3222299396, data=3D0xfffffe000d2a2f80, cred=3D<value optimized=
 out>,
>      td=3D0xfffffe0252ebd490) at /usr/src/sys/fs/devfs/devfs_vnops.c:757
> #13 0xffffffff8056b3be in kern_ioctl (td=3D0xfffffe0252ebd490,
>      fd=3D<value optimized out>, com=3D0) at file.h:306
> #14 0xffffffff8056b13f in sys_ioctl (td=3D0xfffffe0252ebd490,
>      uap=3D0xffffff900d55cb80) at /usr/src/sys/kern/sys_generic.c:693
> #15 0xffffffff80781697 in amd64_syscall (td=3D0xfffffe0252ebd490, traced=
=3D0)
>      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
@@ -346,8 +346,7 @@ update_intel(int cpu, cpuctl_update_args_t *args, struc=
t thread *td)
 	else
 		ret =3D EEXIST;
 fail:
-	if (ptr !=3D NULL)
-		contigfree(ptr, args->size, M_CPUCTL);
+	free(ptr, M_CPUCTL);
 	return (ret);
 }
=20
@@ -476,8 +475,7 @@ update_via(int cpu, cpuctl_update_args_t *args, struct =
thread *td)
 	else
 		ret =3D 0;
 fail:
-	if (ptr !=3D NULL)
-		contigfree(ptr, args->size, M_CPUCTL);
+	free(ptr, M_CPUCTL);
 	return (ret);
 }
=20

--t7jLP6F5mUg+B1HH
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (FreeBSD)

iQIcBAEBAgAGBQJSBpxvAAoJEJDCuSvBvK1B6AAP/0h9rkaGEBwupRftJ3JIGIY1
XB8cxGN47FTAyhtKb/e55oohQX6deLJtWfkS+Dh+njvscnl/2mm5crWeXARclItG
dAOV+JIyDJS+owVVJhOz+0tVFdi1RJGj2o3KNClgPDcJlwTD3AqGNOwYBbSidY6g
KC3FyWA6Xdptu7encyMhguKIkWRpTW8oxzl/RG0o0oqi7kvJwOjuZGGQ8aseWnI7
gz+v+INQaceF77tvFysiFwTuheZD+lOY5C6o4wKsdYp7L860BH/q+JT79fepm64w
kqC+IZpsLqPu9uTPV9jOjx9yyy6cvaLagBLFXg8qnqh4yunDVl0+As8JomBiLLo0
n9mSrMnz8BPem3ZjH1CoqbRbE4mVRdjyjaVDDzzbFH3eTGVmNRls+Xqqs8OTdChZ
NTORJcO5jteqXupXxhv49r8NHE6FLC4xNFVVwPQIAvaiXSk/ML1OVO0iGSr4DnQp
Qpyz9GC/DDiN09gryYyqX232EIalgrxelWU9KHSQteL1LSxw1YbX6IlJPkGcbEsh
Yu82gM7e4E2Iw5T17L/Dye+NDQgyIOrou71ruSf0XzHDbnfNhVVEiUoNuODxssRK
mM5ojww/319+8E/c4vkHNff9rrnzJ0AyrJS9timQVhyjXRcWeRsN4rMn/sGaxhnB
EQphhh+3rF3L58bhCTx3
=+5V8
-----END PGP SIGNATURE-----

--t7jLP6F5mUg+B1HH--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130810200256.GI4972>