lkml.org 
[lkml]   [2022]   [Jun]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: 回复: [PATCH 2/2] uio:powerpc:mpc85x x: l2-cache-sram uio driver implementation
From


Le 14/06/2022 à 09:18, Christophe Leroy a écrit :
>
>
> Le 14/06/2022 à 08:09, Wenhu Wang a écrit :
>>>> +static const struct vm_operations_struct uio_cache_sram_vm_ops = {
>>>> +#ifdef CONFIG_HAVE_IOREMAP_PROT
>>>
>>> Same here.
>>>
>>
>> I tried to eliminate it in mainline
>> See: [PATCH v2] mm: eliminate ifdef of HAVE_IOREMAP_PROT in .c files
>> https://lkml.org/lkml/2022/6/10/695
>>
>
> I looked at that patch.
>
> I don't think you can just drop the #ifdef in function
> __access_remote_vm() in mm/memory.c
>
> You have to replace it with something like:
>
>     if (!IS_ENABLED(CONFIG_HAVE_IOREMAP_PROT))
>         break;
>


Another thing in that patch:

By making generic_access_phys() a static inline, it means that everytime
you refer to the address of that function in a vm_operations_struct
struct, the compiler has to provide an outlined instance of the
function. It means you'll likely have several instances of a
generic_access_phys().

What you could do instead is to add the following at the start of
generic_access_phys() in mm/memory.c :

if (!IS_ENABLED(CONFIG_HAVE_IOREMAP_PROT))
return 0;

\
 
 \ /
  Last update: 2022-06-14 09:27    [W:0.107 / U:1.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site