Date: Tue, 28 Feb 2017 14:59:23 -0800 From: Conrad Meyer <cem@freebsd.org> To: Konstantin Belousov <kib@freebsd.org> Cc: src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r314429 - in head/sys: amd64/amd64 i386/i386 Message-ID: <CAG6CVpXC=ejjHgud00qZEdWS%2Bi1t%2BQo_WHFgRa6u=FAdhHfg8w@mail.gmail.com> In-Reply-To: <201702282254.v1SMsq0l086613@repo.freebsd.org> References: <201702282254.v1SMsq0l086613@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Thanks! On Tue, Feb 28, 2017 at 2:54 PM, Konstantin Belousov <kib@freebsd.org> wrote: > Author: kib > Date: Tue Feb 28 22:54:52 2017 > New Revision: 314429 > URL: https://svnweb.freebsd.org/changeset/base/314429 > > Log: > Initialize pcb_save for thread0. > > Otherwise kernel traps on NULL dereference if fpu_kern(9) is used from the > thread0 context. > > Reported by: cem > Reviewed by: cem, jhb > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > > Modified: > head/sys/amd64/amd64/machdep.c > head/sys/i386/i386/machdep.c > > Modified: head/sys/amd64/amd64/machdep.c > ============================================================================== > --- head/sys/amd64/amd64/machdep.c Tue Feb 28 22:49:45 2017 (r314428) > +++ head/sys/amd64/amd64/machdep.c Tue Feb 28 22:54:52 2017 (r314429) > @@ -1734,6 +1734,7 @@ hammer_time(u_int64_t modulep, u_int64_t > * area. > */ > thread0.td_pcb = get_pcb_td(&thread0); > + thread0.td_pcb->pcb_save = get_pcb_user_save_td(&thread0); > bzero(get_pcb_user_save_td(&thread0), cpu_max_ext_state_size); > if (use_xsave) { > xhdr = (struct xstate_hdr *)(get_pcb_user_save_td(&thread0) + > > Modified: head/sys/i386/i386/machdep.c > ============================================================================== > --- head/sys/i386/i386/machdep.c Tue Feb 28 22:49:45 2017 (r314428) > +++ head/sys/i386/i386/machdep.c Tue Feb 28 22:54:52 2017 (r314429) > @@ -2420,6 +2420,7 @@ init386(int first) > * area. > */ > thread0.td_pcb = get_pcb_td(&thread0); > + thread0.td_pcb->pcb_save = get_pcb_user_save_td(&thread0); > bzero(get_pcb_user_save_td(&thread0), cpu_max_ext_state_size); > if (use_xsave) { > xhdr = (struct xstate_hdr *)(get_pcb_user_save_td(&thread0) + >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAG6CVpXC=ejjHgud00qZEdWS%2Bi1t%2BQo_WHFgRa6u=FAdhHfg8w>