From owner-freebsd-arch@FreeBSD.ORG Sat Oct 25 20:31:09 2014 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E00331FE for ; Sat, 25 Oct 2014 20:31:09 +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 5227165D for ; Sat, 25 Oct 2014 20:31:09 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s9PKV3L1093557 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 25 Oct 2014 23:31:03 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua s9PKV3L1093557 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id s9PKV34W093556; Sat, 25 Oct 2014 23:31:03 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 25 Oct 2014 23:31:03 +0300 From: Konstantin Belousov To: Jilles Tjoelker Subject: Re: RfC: fueword(9) and casueword(9) Message-ID: <20141025203103.GM1877@kib.kiev.ua> References: <20141021094539.GA1877@kib.kiev.ua> <20141022002825.H2080@besplex.bde.org> <20141021162306.GE1877@kib.kiev.ua> <20141025194344.GA11568@stack.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20141025194344.GA11568@stack.nl> 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: arch@freebsd.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2014 20:31:10 -0000 On Sat, Oct 25, 2014 at 09:43:44PM +0200, Jilles Tjoelker wrote: > On Tue, Oct 21, 2014 at 07:23:06PM +0300, Konstantin Belousov wrote: > > I prefer to not complicate the fetch(9) KPI due to the mistakes in the > > umtx structures definitions. I think that it is bug to mark the lock > > words with volatile. I want the fueword(9) interface to be as much > > similar to fuword(9), in particular, volatile seems to be not needed. > > > Below is the updated patch, together with the bug fix noted by Eric. > > Hmm, consider returning an error number (that is, EFAULT) instead of -1 > on failure. This is somewhat like priv_check() which returns EPERM on > failure, and probably reduces confusion if the return value is assigned > to a variable named "error". I did considered EFAULT. The KPI becomes too inconsistent if comparing fueword with fuword or suword. If you reference rv in kern_umtx.c, returning EFAULT for fueword or casueword would not allow to use error directly. The reason is the complicated logic of handling the suspend requests. Basically, non-errors from userspace access must not obliterate the errors from previous calls to check_suspend(). See r270345 for example of the bug from earlier pass over userspace access in kern_umtx.c. There are still more such bugs left in the patch, Peter and I chasing them. > > In share/man/man9/Makefile, MLINKS are still created for fuebyte.9 and > fueword16.9. Fixed, thank you. > > "successful" is consistently misspelled "successfull". I corrected all occurences of successfull in the patch, but it is systematic in the tree. pooma% git grep -e successfull -- | grep -v successfully | wc -l 30