Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Feb 2016 23:20:15 +0100
From:      Svatopluk Kraus <onwahe@gmail.com>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        Justin Hibbits <jrh29@alumni.cwru.edu>,  "freebsd-arch@freebsd.org" <freebsd-arch@freebsd.org>
Subject:   Re: RF_CACHEABLE flag
Message-ID:  <CAFHCsPVYT6_Odw6Ht5dNV9t4Qkta7UE5ToVdzhkZCCr8h_%2B%2Bqw@mail.gmail.com>
In-Reply-To: <20160229163545.GW67250@kib.kiev.ua>
References:  <CAHSQbTA5A3uSDT143e3yWmfzWZyOCDJ4GSo6JO2NiLc_VAKoYg@mail.gmail.com> <20160222121836.GH91220@kib.kiev.ua> <CAHSQbTDZVpNU0WsXSHM8yuDqn_5vmy9Ox0fnLZLb2NJfoC7Exg@mail.gmail.com> <20160224102754.GK91220@kib.kiev.ua> <CAJ-VmomUxb7nR7cyg58zHVrVP3MB2JLLebWJPf7kB0F7NDpu6A@mail.gmail.com> <CAFHCsPVgJt9OJdUtKixGF1XSWtRiD1F8ZHCD5SRodQ77Wm%2B=Sw@mail.gmail.com> <20160229163545.GW67250@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Feb 29, 2016 at 5:35 PM, Konstantin Belousov
<kostikbel@gmail.com> wrote:
> 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 ?

Yep, the question was about that.

>
> 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.

The pmap_change_attr() was implemented in (new) armv6 pmap, but was
removed before the pmap was committed. It was not sure when the
function is used, and if even implemented right. It was about two
years ago. Now, with better knowledge and information you provided, it
should be possible to implement it again.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFHCsPVYT6_Odw6Ht5dNV9t4Qkta7UE5ToVdzhkZCCr8h_%2B%2Bqw>