From owner-svn-src-all@freebsd.org Sat Oct 7 20:11:54 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 5208CE411D6; Sat, 7 Oct 2017 20:11:54 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 59F786C9AF; Sat, 7 Oct 2017 20:11:52 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id v97KBgsf055098 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 7 Oct 2017 23:11:43 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v97KBgsf055098 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v97KBgkL055097; Sat, 7 Oct 2017 23:11:42 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 7 Oct 2017 23:11:42 +0300 From: Konstantin Belousov To: Don Lewis Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324313 - head/sys/amd64/amd64 Message-ID: <20171007201142.GE95911@kib.kiev.ua> References: <201710051250.v95Co31e048931@repo.freebsd.org> <201710072004.v97K49xE062415@gw.catspoiler.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201710072004.v97K49xE062415@gw.catspoiler.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home 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: Sat, 07 Oct 2017 20:11:54 -0000 On Sat, Oct 07, 2017 at 01:04:09PM -0700, Don Lewis wrote: > On 5 Oct, Konstantin Belousov wrote: > > Author: kib > > Date: Thu Oct 5 12:50:03 2017 > > New Revision: 324313 > > URL: https://svnweb.freebsd.org/changeset/base/324313 > > > > Log: > > Avoid a race betweem freeing LDT and context switches. > > > > cpu_switch.S uses curproc->p_md.md_ldt value as the flag indicating > > presence of the process LDT. The flag is checked and then ldt segment > > descriptor is copied into the CPU' GDT slot. > > > > Disallow context switches around clearing of the curproc LDT state by > > performing the cleanup in critical section. Ensure that the md_ldt > > flag is cleared before md_ldt_sd descriptor content is destroyed by > > inserting fence between the operations. > > > > We depend on the x86 memory model strong ordering guarantees, in > > particular, that cpu_switch.S observes the writes to md_ldt and > > md_ldt_sd in the expected order. > > I don't know which of this series of commits is responsible, but I think > that it fixed the build of lang/ghc on Ryzen. > > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221029#c102 Does ghc use LDT on amd64 ? This sounds unbelievable.