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]
Date:   Fri, 26 May 2017 14:38:01 +0200
From:   Heiko Carstens <heiko.carstens@...ibm.com>
To:     Logan Gunthorpe <logang@...tatee.com>,
        Sebastian Ott <sebott@...ux.vnet.ibm.com>
Cc:     linux-kernel@...r.kernel.org, linux-s390@...r.kernel.org,
        Martin Schwidefsky <schwidefsky@...ibm.com>,
        Al Viro <viro@...IV.linux.org.uk>
Subject: Re: [PATCH] s390: provide default ioremap and iounmap declaration

On Thu, May 25, 2017 at 09:43:48AM -0600, Logan Gunthorpe wrote:
> Add a default ioremap function which was not provided in all
> circumstances. (Only when CONFIG_PCI was set).
> 
> I have designs to use them in scatterlist.c where they'd likely never
> be called without CONFIG_PCI set, but it is needed to compile. Thus,
> if the function is ever hit it returns NULL.
> 
> Signed-off-by: Logan Gunthorpe <logang@...tatee.com>
> Cc: Martin Schwidefsky <schwidefsky@...ibm.com>
> Cc: Heiko Carstens <heiko.carstens@...ibm.com>
> Cc: Al Viro <viro@...IV.linux.org.uk>
> ---
> 
> Thanks to Al Viro for pointing out this corner case in s390.
> 
>  arch/s390/include/asm/io.h | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/arch/s390/include/asm/io.h b/arch/s390/include/asm/io.h
> index 437e9af..f4140d4 100644
> --- a/arch/s390/include/asm/io.h
> +++ b/arch/s390/include/asm/io.h
> @@ -73,6 +73,17 @@ static inline void ioport_unmap(void __iomem *p)
>  #define __raw_writel	zpci_write_u32
>  #define __raw_writeq	zpci_write_u64
> 
> +#else
> +
> +static inline void __iomem *ioremap(unsigned long offset, unsigned long size)
> +{
> +	return NULL;
> +}
> +
> +static inline void iounmap(void __iomem *addr)
> +{
> +}
> +
>  #endif /* CONFIG_PCI */

I'd rather move the #ifdef CONFIG_PCI than implementing this yet another
time (see patch below). But I'll leave that up to Sebastian.

diff --git a/arch/s390/include/asm/io.h b/arch/s390/include/asm/io.h
index 437e9af96688..904e4b3af95d 100644
--- a/arch/s390/include/asm/io.h
+++ b/arch/s390/include/asm/io.h
@@ -25,8 +25,6 @@ void unxlate_dev_mem_ptr(phys_addr_t phys, void *addr);
 
 #define IO_SPACE_LIMIT 0
 
-#ifdef CONFIG_PCI
-
 #define ioremap_nocache(addr, size)	ioremap(addr, size)
 #define ioremap_wc			ioremap_nocache
 #define ioremap_wt			ioremap_nocache
@@ -49,6 +47,8 @@ static inline void ioport_unmap(void __iomem *p)
 {
 }
 
+#ifdef CONFIG_PCI
+
 /*
  * s390 needs a private implementation of pci_iomap since ioremap with its
  * offset parameter isn't sufficient. That's because BAR spaces are not

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ