From owner-freebsd-arch@freebsd.org Mon Feb 29 16:36:06 2016 Return-Path: Delivered-To: freebsd-arch@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 B4C37AB8D76 for ; Mon, 29 Feb 2016 16:36:06 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34BB56EA for ; Mon, 29 Feb 2016 16:36:06 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u1TGZkSv019906 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 29 Feb 2016 18:35:46 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u1TGZkSv019906 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u1TGZk3x019905; Mon, 29 Feb 2016 18:35:46 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 29 Feb 2016 18:35:46 +0200 From: Konstantin Belousov To: Svatopluk Kraus Cc: Justin Hibbits , "freebsd-arch@freebsd.org" Subject: Re: RF_CACHEABLE flag Message-ID: <20160229163545.GW67250@kib.kiev.ua> References: <20160222121836.GH91220@kib.kiev.ua> <20160224102754.GK91220@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) 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: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Feb 2016 16:36:06 -0000 On Mon, Feb 29, 2016 at 05:18:16PM +0100, Svatopluk Kraus wrote: > It's not so simple to change memory attributes on ARM. Some conditions > must be met. So, a question is - in which circumstances > pmap_change_attr() is used? > > It's defined like > int pmap_change_attr(vm_offset_t va, vm_size_t size, int mode); > > (1) As memory attributes can be changed on a page basis only, the va > and size are arranged according to that in i386 implementation. That's > okay. > > (2) Can the memory be used by somebody else while the attributes are > being changed? In other words, can the memory be unmapped temporary? Is this for the change of pte through invalidation ? In other words, do you mean, is it fine to temporary unmap the range during the pmap_change_attr() execution ? If yes, it is fine for uses of the function in the DRM code, since it is utilized during a setup of things like GTT or buffers, and no other accesses to the memory could happen until the setup is finished. I noted that function is used by several network drivers as well, and by ntb. It seem that cxgbe and mxge also use it during setup.