From owner-svn-src-all@FreeBSD.ORG Sat Sep 6 08:00:48 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BB56F993; Sat, 6 Sep 2014 08:00:48 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 428061329; Sat, 6 Sep 2014 08:00:48 +0000 (UTC) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s8680gPN054878 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 6 Sep 2014 11:00:42 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua s8680gPN054878 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id s8680gYW054876; Sat, 6 Sep 2014 11:00:42 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 6 Sep 2014 11:00:42 +0300 From: Konstantin Belousov To: John Baldwin Subject: Re: svn commit: r270850 - in head/sys: i386/i386 i386/include i386/isa x86/acpica Message-ID: <20140906080042.GT2737@kib.kiev.ua> References: <201408301748.s7UHmc6H059701@svn.freebsd.org> <3070015.668SIdAzOX@ralph.baldwin.cx> <20140905084305.GN2737@kib.kiev.ua> <201409051044.05853.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="b/WH2/j5QGsRzh1z" Content-Disposition: inline In-Reply-To: <201409051044.05853.jhb@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 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, 06 Sep 2014 08:00:48 -0000 --b/WH2/j5QGsRzh1z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 05, 2014 at 10:44:05AM -0400, John Baldwin wrote: > On Friday, September 05, 2014 4:43:05 am Konstantin Belousov wrote: > > On Thu, Sep 04, 2014 at 10:50:25PM -0400, John Baldwin wrote: > > > On Tuesday, September 02, 2014 06:41:27 PM Konstantin Belousov wrote: > > > > On Tue, Sep 02, 2014 at 11:00:57AM -0400, John Baldwin wrote: > > > > > I thought about that. I could easily make a parallel array, or p= erhaps > > > > > use a separate 'susppcb' structure that includes a pcb and the sa= vefpu > > > > > union and change susppcbs to be an array of those. Which do you = prefer?=20 > > > > > If we want to move some state out of the PCB on amd64 into this, = then a > > > > > separate struct for susppcbs might be the sanest. > > > >=20 > > > > Yes, separate structure seems to be a way forward. > > >=20 > > > Please see www.freebsd.org/~jhb/patches/susppcb.patch Note that I mo= ved > > > fpususpend() out into a C function on amd64 so that resumectx() could= still=20 > > > operate on just a pcb. This also makes savectx and resumectx more sy= mmetric > > > and matches what I ended up doing on i386. This is tested for suspen= d and > > > resume on both i386 and amd64. > >=20 > > The implementation of fpuresume() in C is definitely an improvement. > >=20 > > You only moved the fpu context to the susppcb, I think this is good for > > now, we will want to move other bits later. > >=20 > > Do we need to keep pcb layout for KBI compat ? I remember that pcb > > size is asserted to properly fit into pcpu area for percpu zones. > > But why keep the layout ? I.e. moving all padding bits to the end. >=20 > I wasn't sure. I thought the padding was there for ABI reasons. If we d= on't > need KBI compat, I would much rather consolidate all the padding at the e= nd. The padding is due to functional requirements. I do not see KBI requirements that would cause us to keep the layout, at least in HEAD. >=20 > > There is one weird detail, not touched by your patch. Amd64 resume > > path calls initializecpu(), while i386 does not. I do not see any > > use for the call, the reload of CRX registers by trampoline/resumectx > > should already set everything to working state. E.g., enabling XMM > > in CR4 after fpu state is restored looks strange. >=20 > I can test that. >=20 > > Overall, it looks fine. Do you prefer to have alloc_fpusave() on i386 ? >=20 > Well, it might be nice to have XSAVE on i386. I'm not sure if Intel has > any 32-bit only chips planned that will use AVX or MPX, etc. If they are, > then I do think AVX on i386 would be nice to have. Barring XSAVE I think > we can just use a static savefpu on i386 for now. I mean that having alloc_fpusave() would allow to avoid several #ifdefs by using pointer to save area on i386 as well. >=20 > We might also consider removing support for 486sx CPUs and requiring an > on-CPU FPU for i386. If we do that we might able to use a common fpu.c > which would be even nicer. IMO merging fpu.c and npx.c is very non-trivial. First obstacle is the differences between i386 and amd64 fpu context layouts (software-imposed). --b/WH2/j5QGsRzh1z Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJUCr8qAAoJEJDCuSvBvK1BtI8P/2SMZcJeEbBmY3QWrMtN71Kq PzaG6dccA19dH7zowqtr3ApLCd4L27qmlKZZ7uez4xgb8NxayPLPyW/zXZ+/a3Jc WKpyXZCtiYewwKceBG+XkToAL/XWZR9QnjJBLpqyFcpWY3croM0sEtqn9VWUFuPS R3YQzo3ogw+IblA9HOYfnLYQAXbkHQtTipzes7iZd/xrCLc3HOwdIqnIQW5nq5i1 xsTUTlbS+8+SCfLRRh1AfWJd3GaSc/kcQMJ5BFO8QA1jdm3g8gnEZXoQutaogvnG k539IkudaPXASZG0LD2Y9IFNBa1IkP8AGNj8N5byjU8PfknymBEJx1DBOGb2g5kM hUBtwPkKOUdNSR1izQELmsvQAlKcrF8Z6zjgXlWDyha0LcknKalUiEDBz4dnMtbC OPdsnAl9+nLM6JcSZ5xIKtPQzJItBlp4E88fTGn5DKQ8ZRKtm96+Sfkkjts7X1ix 6jQRaoZL1ipKlXa5arUPKJZq1lFG6k4Arug5MgDoyc4yzFpj1WMY8i5wcizwsjow TYniJOgGMjwjPBBuqD8U5EBG3aHnCK1uj0y7rUC86OcMfcaoRXxSukUkzzkbfsVA h3m5yp4VOSXzby89GMlcJXW/yz+yEX4cLR/8A7il5c8cKU4u/f5yzDHEJm36q9+s QoJb2Nc81IBUTP79q++L =dFVS -----END PGP SIGNATURE----- --b/WH2/j5QGsRzh1z--