svn commit: r327950 - in head/sys/powerpc: aim include powerpc ps3

Nathan Whitehorn nwhitehorn at freebsd.org
Sun Jan 14 23:42:59 UTC 2018



On 01/14/18 09:57, Nathan Whitehorn wrote:
>
>
> On 01/14/18 09:52, Konstantin Belousov wrote:
>> On Sun, Jan 14, 2018 at 09:30:53AM -0800, Nathan Whitehorn wrote:
>>> The immediate consequence of that is that no MI code that knows about
>>> direct maps can possibly take advantage of the direct map on this
>>> platform. Do we really want that to save some conditional logic that
>>> would get optimized out on amd64 and arm64 anyway? I really do not see
>>> the benefit here.
>> It is not clear what do you mean.  Are you saying that there is no 
>> benefit
>> of providing the conditional logic, or that it is not benefit of 
>> exclusing
>> powerpc ?
>
> Sorry, that was poorly stated. Let me try again:
>
> If we make a PPC_PHYS_TO_DMAP(), but there is an MI PHYS_TO_DMAP() 
> API, consumer code in the MI parts of the kernel won't be able to 
> benefit from the PPC direct map, which seems unfortunate. The cost 
> from a code perspective of having an if (direct_map_available) seems 
> low, since on systems where direct_map_available is defined to be 1, 
> the compiler will optimize it to the same code as if gated by #ifdef. 
> It might be more cumbersome to write the code, however.
>
>> I do not object against adding the conditional, but it should not be
>> too clumsy to use.
>>
>
> OK. Let me try to draft something in the next couple days and see how 
> much of a pain it is in practice.
> -Nathan
>

How about the attached? It makes PHYS_TO_DMAP() return 0 if no mapping 
exists. This is straightforward, does not introduce extra macros, and 
can pretty easily replace SFBUF_OPTIONAL_DIRECT_MAP on the assumption 
that PHYS_TO_DMAP() is cheap. I've modified the other MI-ish consumers 
in the tree accordingly; compat/linuxkpi/common/src/linux_page.c already 
does the right thing and needed no modifications.
-Nathan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PHYS_TO_DMAP.diff
Type: text/x-patch
Size: 1942 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-src-head/attachments/20180114/3c1e4042/attachment.bin>


More information about the svn-src-head mailing list