linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] riscv: fix fs/proc/kcore.c compilation with sparsemem enabled
@ 2019-10-22 16:21 David Abdurachmanov
  2019-10-22 19:52 ` Logan Gunthorpe
  2019-10-23  0:04 ` Paul Walmsley
  0 siblings, 2 replies; 3+ messages in thread
From: David Abdurachmanov @ 2019-10-22 16:21 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, Anup Patel,
	Mike Rapoport, Greentime Hu, Stefan O'Rear,
	David Abdurachmanov, Alexandre Ghiti, Logan Gunthorpe,
	Thomas Gleixner, linux-riscv, linux-kernel
  Cc: david.abdurachmanov

Failed to compile Fedora/RISCV kernel (5.4-rc3+) with sparsemem enabled:

fs/proc/kcore.c: In function 'read_kcore':
fs/proc/kcore.c:510:8: error: implicit declaration of function 'kern_addr_valid'; did you mean 'virt_addr_valid'? [-Werror=implicit-function-declaration]
  510 |    if (kern_addr_valid(start)) {
      |        ^~~~~~~~~~~~~~~
      |        virt_addr_valid

Looking at other architectures I don't see kern_addr_valid being guarded by
CONFIG_FLATMEM.

Fixes: d95f1a542c3d ("RISC-V: Implement sparsemem")
Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
Tested-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
---
 arch/riscv/include/asm/pgtable.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h
index 42292d99cc74..7110879358b8 100644
--- a/arch/riscv/include/asm/pgtable.h
+++ b/arch/riscv/include/asm/pgtable.h
@@ -428,9 +428,7 @@ static inline int ptep_clear_flush_young(struct vm_area_struct *vma,
 #define __pte_to_swp_entry(pte)	((swp_entry_t) { pte_val(pte) })
 #define __swp_entry_to_pte(x)	((pte_t) { (x).val })
 
-#ifdef CONFIG_FLATMEM
 #define kern_addr_valid(addr)   (1) /* FIXME */
-#endif
 
 extern void *dtb_early_va;
 extern void setup_bootmem(void);
-- 
2.21.0


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH] riscv: fix fs/proc/kcore.c compilation with sparsemem enabled
  2019-10-22 16:21 [PATCH] riscv: fix fs/proc/kcore.c compilation with sparsemem enabled David Abdurachmanov
@ 2019-10-22 19:52 ` Logan Gunthorpe
  2019-10-23  0:04 ` Paul Walmsley
  1 sibling, 0 replies; 3+ messages in thread
From: Logan Gunthorpe @ 2019-10-22 19:52 UTC (permalink / raw)
  To: David Abdurachmanov, Paul Walmsley, Palmer Dabbelt, Albert Ou,
	Anup Patel, Mike Rapoport, Greentime Hu, Stefan O'Rear,
	David Abdurachmanov, Alexandre Ghiti, Thomas Gleixner,
	linux-riscv, linux-kernel



On 2019-10-22 10:21 a.m., David Abdurachmanov wrote:
> Failed to compile Fedora/RISCV kernel (5.4-rc3+) with sparsemem enabled:
> 
> fs/proc/kcore.c: In function 'read_kcore':
> fs/proc/kcore.c:510:8: error: implicit declaration of function 'kern_addr_valid'; did you mean 'virt_addr_valid'? [-Werror=implicit-function-declaration]
>   510 |    if (kern_addr_valid(start)) {
>       |        ^~~~~~~~~~~~~~~
>       |        virt_addr_valid
> 
> Looking at other architectures I don't see kern_addr_valid being guarded by
> CONFIG_FLATMEM.
> 
> Fixes: d95f1a542c3d ("RISC-V: Implement sparsemem")
> Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
> Tested-by: David Abdurachmanov <david.abdurachmanov@sifive.com>

Makes sense to me.

Reviewed-by: Logan Gunthorpe <logang@deltatee.com>


> ---
>  arch/riscv/include/asm/pgtable.h | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h
> index 42292d99cc74..7110879358b8 100644
> --- a/arch/riscv/include/asm/pgtable.h
> +++ b/arch/riscv/include/asm/pgtable.h
> @@ -428,9 +428,7 @@ static inline int ptep_clear_flush_young(struct vm_area_struct *vma,
>  #define __pte_to_swp_entry(pte)	((swp_entry_t) { pte_val(pte) })
>  #define __swp_entry_to_pte(x)	((pte_t) { (x).val })
>  
> -#ifdef CONFIG_FLATMEM
>  #define kern_addr_valid(addr)   (1) /* FIXME */
> -#endif
>  
>  extern void *dtb_early_va;
>  extern void setup_bootmem(void);
> 

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH] riscv: fix fs/proc/kcore.c compilation with sparsemem enabled
  2019-10-22 16:21 [PATCH] riscv: fix fs/proc/kcore.c compilation with sparsemem enabled David Abdurachmanov
  2019-10-22 19:52 ` Logan Gunthorpe
@ 2019-10-23  0:04 ` Paul Walmsley
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Walmsley @ 2019-10-23  0:04 UTC (permalink / raw)
  To: David Abdurachmanov
  Cc: Stefan O'Rear, Palmer Dabbelt, Alexandre Ghiti,
	David Abdurachmanov, Anup Patel, linux-kernel, Mike Rapoport,
	Albert Ou, Greentime Hu, Thomas Gleixner, Logan Gunthorpe,
	linux-riscv

On Tue, 22 Oct 2019, David Abdurachmanov wrote:

> Failed to compile Fedora/RISCV kernel (5.4-rc3+) with sparsemem enabled:
> 
> fs/proc/kcore.c: In function 'read_kcore':
> fs/proc/kcore.c:510:8: error: implicit declaration of function 'kern_addr_valid'; did you mean 'virt_addr_valid'? [-Werror=implicit-function-declaration]
>   510 |    if (kern_addr_valid(start)) {
>       |        ^~~~~~~~~~~~~~~
>       |        virt_addr_valid
> 
> Looking at other architectures I don't see kern_addr_valid being guarded by
> CONFIG_FLATMEM.
> 
> Fixes: d95f1a542c3d ("RISC-V: Implement sparsemem")
> Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
> Tested-by: David Abdurachmanov <david.abdurachmanov@sifive.com>

Thanks, queued for v5.4-rc with Logan's Reviewed-by:.


- Paul

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

end of thread, other threads:[~2019-10-23  0:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-22 16:21 [PATCH] riscv: fix fs/proc/kcore.c compilation with sparsemem enabled David Abdurachmanov
2019-10-22 19:52 ` Logan Gunthorpe
2019-10-23  0:04 ` Paul Walmsley

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