From owner-svn-src-all@freebsd.org Tue Feb 28 23:06:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B475CF2B8B; Tue, 28 Feb 2017 23:06:46 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-wr0-f172.google.com (mail-wr0-f172.google.com [209.85.128.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1BF1DD06; Tue, 28 Feb 2017 23:06:45 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-wr0-f172.google.com with SMTP id u108so18777830wrb.3; Tue, 28 Feb 2017 15:06:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=0YRKcH8VJJhEOInTqSvhsPn0UoVZ7qaJA3jt5cZIGRI=; b=qxw0QBXkNm/+mrM5P6BLqp4H+pgoVQMlNpNE4EStdirATfncehWtGhFkZFn3Z2FK07 Ev2kt+PZz7I7pM8o0vfcbSI9EVRaF1nEkK/z0fx7zwp9kr2YuJcBeR3BJoSfYE3fIFA8 BmLXCxJuJZfR/oLZEuFUh15WaEKwddrp2jV3yOU51sdudTz1PUkK2rydCuqWoRu4DpYp 121bh9N5vfF1ZxMgEWESPsfKQvy/MqP249+VSw0feQUFnqNy+PZn3FeE074fZl1YO7A/ SMcenZKvH9w5+8cz/CnA6aUZ9ahn5iKGkOcrw1T5obDwWWSmY1knIwKPVYwbB5c/UneR 2MHg== X-Gm-Message-State: AMke39k+o3gkQuw25yrF8czVmeUDMNOcoGW9gui5TaXccx49GmchSh/25H9dbETh6BYiUg== X-Received: by 10.223.169.1 with SMTP id u1mr4315333wrc.53.1488322764667; Tue, 28 Feb 2017 14:59:24 -0800 (PST) Received: from mail-wr0-f180.google.com (mail-wr0-f180.google.com. [209.85.128.180]) by smtp.gmail.com with ESMTPSA id u198sm20311682wmf.9.2017.02.28.14.59.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Feb 2017 14:59:24 -0800 (PST) Received: by mail-wr0-f180.google.com with SMTP id l37so18623837wrc.1; Tue, 28 Feb 2017 14:59:24 -0800 (PST) X-Received: by 10.223.162.211 with SMTP id t19mr4426255wra.57.1488322764427; Tue, 28 Feb 2017 14:59:24 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.80.152.82 with HTTP; Tue, 28 Feb 2017 14:59:23 -0800 (PST) In-Reply-To: <201702282254.v1SMsq0l086613@repo.freebsd.org> References: <201702282254.v1SMsq0l086613@repo.freebsd.org> From: Conrad Meyer Date: Tue, 28 Feb 2017 14:59:23 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r314429 - in head/sys: amd64/amd64 i386/i386 To: Konstantin Belousov Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2017 23:06:46 -0000 Thanks! On Tue, Feb 28, 2017 at 2:54 PM, Konstantin Belousov 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) + >