lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZGMnLTPYXuPGHXtp@kernel.org>
Date:   Tue, 16 May 2023 09:48:13 +0300
From:   Mike Rapoport <rppt@...nel.org>
To:     Baoquan He <bhe@...hat.com>
Cc:     linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org,
        linux-mm@...ck.org, arnd@...db.de, christophe.leroy@...roup.eu,
        hch@...radead.org, agordeev@...ux.ibm.com,
        wangkefeng.wang@...wei.com, schnelle@...ux.ibm.com,
        David.Laight@...lab.com, shorne@...il.com, willy@...radead.org,
        deller@....de
Subject: Re: [PATCH v5 RESEND 05/17] mm: ioremap: allow ARCH to have its own
 ioremap method definition

On Mon, May 15, 2023 at 05:08:36PM +0800, Baoquan He wrote:
> Architectures can be converted to GENERIC_IOREMAP, to take standard
> ioremap_xxx() and iounmap() way. But some ARCH-es could have specific
> handling for ioremap_prot(), ioremap() and iounmap(), than standard
> methods.
> 
> In oder to convert these ARCH-es to take GENERIC_IOREMAP method, allow
> these architecutres to have their own ioremap_prot(), ioremap() and
> iounmap() definitions.
> 
> Signed-off-by: Baoquan He <bhe@...hat.com>
> Acked-by: Arnd Bergmann <arnd@...db.de>
> Cc: linux-arch@...r.kernel.org
> Cc: Kefeng Wang <wangkefeng.wang@...wei.com>

Reviewed-by: Mike Rapoport (IBM) <rppt@...nel.org>

> ---
>  include/asm-generic/io.h | 3 +++
>  mm/ioremap.c             | 4 ++++
>  2 files changed, 7 insertions(+)
> 
> diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
> index a7ca2099ba19..39244c3ee797 100644
> --- a/include/asm-generic/io.h
> +++ b/include/asm-generic/io.h
> @@ -1081,11 +1081,14 @@ void __iomem *ioremap_prot(phys_addr_t phys_addr, size_t size,
>  void iounmap(volatile void __iomem *addr);
>  void generic_iounmap(volatile void __iomem *addr);
>  
> +#ifndef ioremap
> +#define ioremap ioremap
>  static inline void __iomem *ioremap(phys_addr_t addr, size_t size)
>  {
>  	/* _PAGE_IOREMAP needs to be supplied by the architecture */
>  	return ioremap_prot(addr, size, _PAGE_IOREMAP);
>  }
> +#endif
>  #endif /* !CONFIG_MMU || CONFIG_GENERIC_IOREMAP */
>  
>  #ifndef ioremap_wc
> diff --git a/mm/ioremap.c b/mm/ioremap.c
> index db6234b9db59..9f34a8f90b58 100644
> --- a/mm/ioremap.c
> +++ b/mm/ioremap.c
> @@ -46,12 +46,14 @@ void __iomem *generic_ioremap_prot(phys_addr_t phys_addr, size_t size,
>  	return (void __iomem *)(vaddr + offset);
>  }
>  
> +#ifndef ioremap_prot
>  void __iomem *ioremap_prot(phys_addr_t phys_addr, size_t size,
>  			   unsigned long prot)
>  {
>  	return generic_ioremap_prot(phys_addr, size, __pgprot(prot));
>  }
>  EXPORT_SYMBOL(ioremap_prot);
> +#endif
>  
>  void generic_iounmap(volatile void __iomem *addr)
>  {
> @@ -64,8 +66,10 @@ void generic_iounmap(volatile void __iomem *addr)
>  		vunmap(vaddr);
>  }
>  
> +#ifndef iounmap
>  void iounmap(volatile void __iomem *addr)
>  {
>  	generic_iounmap(addr);
>  }
>  EXPORT_SYMBOL(iounmap);
> +#endif
> -- 
> 2.34.1
> 
> 

-- 
Sincerely yours,
Mike.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ