linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sparc32: make copy_to/from_user_page() usable from modular code
@ 2014-02-13 21:15 Paul Gortmaker
  2014-02-20  0:50 ` David Miller
  2014-03-26  8:41 ` Geert Uytterhoeven
  0 siblings, 2 replies; 4+ messages in thread
From: Paul Gortmaker @ 2014-02-13 21:15 UTC (permalink / raw)
  To: sparclinux; +Cc: David S. Miller, linux-kernel, Paul Gortmaker

While copy_to/from_user_page() users are uncommon, there is one in
drivers/staging/lustre/lustre/libcfs/linux/linux-curproc.c which leads
to the following:

ERROR: "sparc32_cachetlb_ops" [drivers/staging/lustre/lustre/libcfs/libcfs.ko] undefined!

during routine allmodconfig build coverage.  The reason this happens
is as follows:

In arch/sparc/include/asm/cacheflush_32.h we have:

 #define flush_cache_page(vma,addr,pfn) \
        sparc32_cachetlb_ops->cache_page(vma, addr)

 #define copy_to_user_page(vma, page, vaddr, dst, src, len) \
        do {                                                    \
                flush_cache_page(vma, vaddr, page_to_pfn(page));\
                memcpy(dst, src, len);                          \
        } while (0)
 #define copy_from_user_page(vma, page, vaddr, dst, src, len) \
        do {                                                    \
                flush_cache_page(vma, vaddr, page_to_pfn(page));\
                memcpy(dst, src, len);                          \
        } while (0)

However, sparc32_cachetlb_ops isn't exported and hence the error.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 arch/sparc/mm/srmmu.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c
index 869023abe5a4..cfbe53c17b0d 100644
--- a/arch/sparc/mm/srmmu.c
+++ b/arch/sparc/mm/srmmu.c
@@ -14,6 +14,7 @@
 #include <linux/pagemap.h>
 #include <linux/vmalloc.h>
 #include <linux/kdebug.h>
+#include <linux/export.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/log2.h>
@@ -62,6 +63,7 @@ extern unsigned long last_valid_pfn;
 static pgd_t *srmmu_swapper_pg_dir;
 
 const struct sparc32_cachetlb_ops *sparc32_cachetlb_ops;
+EXPORT_SYMBOL(sparc32_cachetlb_ops);
 
 #ifdef CONFIG_SMP
 const struct sparc32_cachetlb_ops *local_ops;
-- 
1.8.5.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] sparc32: make copy_to/from_user_page() usable from modular code
  2014-02-13 21:15 [PATCH] sparc32: make copy_to/from_user_page() usable from modular code Paul Gortmaker
@ 2014-02-20  0:50 ` David Miller
  2014-03-26  8:41 ` Geert Uytterhoeven
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2014-02-20  0:50 UTC (permalink / raw)
  To: paul.gortmaker; +Cc: sparclinux, linux-kernel

From: Paul Gortmaker <paul.gortmaker@windriver.com>
Date: Thu, 13 Feb 2014 16:15:01 -0500

> While copy_to/from_user_page() users are uncommon, there is one in
> drivers/staging/lustre/lustre/libcfs/linux/linux-curproc.c which leads
> to the following:
> 
> ERROR: "sparc32_cachetlb_ops" [drivers/staging/lustre/lustre/libcfs/libcfs.ko] undefined!
> 
> during routine allmodconfig build coverage.  The reason this happens
> is as follows:
> 
> In arch/sparc/include/asm/cacheflush_32.h we have:
> 
>  #define flush_cache_page(vma,addr,pfn) \
>         sparc32_cachetlb_ops->cache_page(vma, addr)
> 
>  #define copy_to_user_page(vma, page, vaddr, dst, src, len) \
>         do {                                                    \
>                 flush_cache_page(vma, vaddr, page_to_pfn(page));\
>                 memcpy(dst, src, len);                          \
>         } while (0)
>  #define copy_from_user_page(vma, page, vaddr, dst, src, len) \
>         do {                                                    \
>                 flush_cache_page(vma, vaddr, page_to_pfn(page));\
>                 memcpy(dst, src, len);                          \
>         } while (0)
> 
> However, sparc32_cachetlb_ops isn't exported and hence the error.
> 
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

Also applied.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] sparc32: make copy_to/from_user_page() usable from modular code
  2014-02-13 21:15 [PATCH] sparc32: make copy_to/from_user_page() usable from modular code Paul Gortmaker
  2014-02-20  0:50 ` David Miller
@ 2014-03-26  8:41 ` Geert Uytterhoeven
  2014-03-26 14:23   ` Paul Gortmaker
  1 sibling, 1 reply; 4+ messages in thread
From: Geert Uytterhoeven @ 2014-03-26  8:41 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: sparclinux, David S. Miller, linux-kernel@vger.kernel.org

On Thu, Feb 13, 2014 at 10:15 PM, Paul Gortmaker
<paul.gortmaker@windriver.com> wrote:
> While copy_to/from_user_page() users are uncommon, there is one in
> drivers/staging/lustre/lustre/libcfs/linux/linux-curproc.c which leads
> to the following:
>
> ERROR: "sparc32_cachetlb_ops" [drivers/staging/lustre/lustre/libcfs/libcfs.ko] undefined!
>
> during routine allmodconfig build coverage.  The reason this happens
> is as follows:
>
> In arch/sparc/include/asm/cacheflush_32.h we have:
>
>  #define flush_cache_page(vma,addr,pfn) \
>         sparc32_cachetlb_ops->cache_page(vma, addr)
>
>  #define copy_to_user_page(vma, page, vaddr, dst, src, len) \
>         do {                                                    \
>                 flush_cache_page(vma, vaddr, page_to_pfn(page));\
>                 memcpy(dst, src, len);                          \
>         } while (0)
>  #define copy_from_user_page(vma, page, vaddr, dst, src, len) \
>         do {                                                    \
>                 flush_cache_page(vma, vaddr, page_to_pfn(page));\
>                 memcpy(dst, src, len);                          \
>         } while (0)
>
> However, sparc32_cachetlb_ops isn't exported and hence the error.
>
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

Sorry for only noticing now. A similar fix for pa-risc was reverted:

"Christoph Hellwig <hch@infradead.org> commented:
 This one shouldn't go in - Geert sent it a bit prematurely, as Lustre
 shouldn't use it just to reimplement core VM functionality (which it
 shouldn't use either, but that's a separate story)."

http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=a446e72bc15c7bfd2c953e56064ace3566c79b0e

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] sparc32: make copy_to/from_user_page() usable from modular code
  2014-03-26  8:41 ` Geert Uytterhoeven
@ 2014-03-26 14:23   ` Paul Gortmaker
  0 siblings, 0 replies; 4+ messages in thread
From: Paul Gortmaker @ 2014-03-26 14:23 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: sparclinux, David S. Miller, linux-kernel@vger.kernel.org

On 14-03-26 04:41 AM, Geert Uytterhoeven wrote:
> On Thu, Feb 13, 2014 at 10:15 PM, Paul Gortmaker
> <paul.gortmaker@windriver.com> wrote:
>> While copy_to/from_user_page() users are uncommon, there is one in
>> drivers/staging/lustre/lustre/libcfs/linux/linux-curproc.c which leads
>> to the following:
>>
>> ERROR: "sparc32_cachetlb_ops" [drivers/staging/lustre/lustre/libcfs/libcfs.ko] undefined!
>>
>> during routine allmodconfig build coverage.  The reason this happens
>> is as follows:
>>
>> In arch/sparc/include/asm/cacheflush_32.h we have:
>>
>>  #define flush_cache_page(vma,addr,pfn) \
>>         sparc32_cachetlb_ops->cache_page(vma, addr)
>>
>>  #define copy_to_user_page(vma, page, vaddr, dst, src, len) \
>>         do {                                                    \
>>                 flush_cache_page(vma, vaddr, page_to_pfn(page));\
>>                 memcpy(dst, src, len);                          \
>>         } while (0)
>>  #define copy_from_user_page(vma, page, vaddr, dst, src, len) \
>>         do {                                                    \
>>                 flush_cache_page(vma, vaddr, page_to_pfn(page));\
>>                 memcpy(dst, src, len);                          \
>>         } while (0)
>>
>> However, sparc32_cachetlb_ops isn't exported and hence the error.
>>
>> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> 
> Sorry for only noticing now. A similar fix for pa-risc was reverted:
> 
> "Christoph Hellwig <hch@infradead.org> commented:
>  This one shouldn't go in - Geert sent it a bit prematurely, as Lustre
>  shouldn't use it just to reimplement core VM functionality (which it
>  shouldn't use either, but that's a separate story)."

Generally speaking I agree, and every time I touch lustre, I feel
like I need to go home and have a shower.  However, in this case,
lustre wasn't actually directly calling flush_cache_page type core
VM ops directly, and I couldn't convince myself of an argument
of why a modular driver should be forbidden from using either
of copy_to/from_user_page()...

Either way is fine with me.  If a revert is desired and we want
to make lustre depend on CONFIG_BROKEN (okay, a bit harsh) or
don't allow lustre to be modular, that is also fine.

Paul.
--

> 
> http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=a446e72bc15c7bfd2c953e56064ace3566c79b0e
> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-03-26 14:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-13 21:15 [PATCH] sparc32: make copy_to/from_user_page() usable from modular code Paul Gortmaker
2014-02-20  0:50 ` David Miller
2014-03-26  8:41 ` Geert Uytterhoeven
2014-03-26 14:23   ` Paul Gortmaker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).