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:	Thu, 25 Sep 2014 11:05:43 +1000
From:	Greg Ungerer <gerg@...inux.org>
To:	Will Deacon <will.deacon@....com>, <linux-arch@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>
CC:	<arnd@...db.de>, <benh@...nel.crashing.org>, <chris@...kel.net>,
	<cmetcalf@...era.com>, <davem@...emloft.net>, <deller@....de>,
	<dhowells@...hat.com>, <geert@...ux-m68k.org>,
	<heiko.carstens@...ibm.com>, <hpa@...or.com>, <jcmvbkbc@...il.com>,
	<jesper.nilsson@...s.com>, <mingo@...hat.com>, <monstr@...str.eu>,
	<paulmck@...ux.vnet.ibm.com>, <rdunlap@...radead.org>,
	<sam@...nborg.org>, <schwidefsky@...ibm.com>, <starvik@...s.com>,
	<takata@...ux-m32r.org>, <tglx@...utronix.de>,
	<tony.luck@...el.com>, <daniel.thompson@...aro.org>,
	<broonie@...aro.org>, <linux@....linux.org.uk>
Subject: Re: [PATCH v3 09/17] m68k: io: implement dummy relaxed accessor macros
 for writes

Hi Will

On 25/09/14 03:17, Will Deacon wrote:
> write{b,w,l}_relaxed are implemented by some architectures in order to
> permit memory-mapped I/O accesses with weaker barrier semantics than the
> non-relaxed variants.
> 
> This patch adds dummy macros for the write accessors to m68k, in the
> same vein as the dummy definitions for the relaxed read accessors.
> Additionally, the existing relaxed read accessors are moved into
> asm/io.h, so that they can be used by m68k targets with an MMU.
> 
> Acked-by: Geert Uytterhoeven <geert@...ux-m68k.org>
> Signed-off-by: Will Deacon <will.deacon@....com>
> ---
>  arch/m68k/include/asm/io.h    | 8 ++++++++
>  arch/m68k/include/asm/io_no.h | 4 ----
>  2 files changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/m68k/include/asm/io.h b/arch/m68k/include/asm/io.h
> index c70cc9155003..bccd5a914eb6 100644
> --- a/arch/m68k/include/asm/io.h
> +++ b/arch/m68k/include/asm/io.h
> @@ -3,3 +3,11 @@
>  #else
>  #include <asm/io_mm.h>
>  #endif
> +
> +#define readb_relaxed(addr)	readb(addr)
> +#define readw_relaxed(addr)	readw(addr)
> +#define readl_relaxed(addr)	readl(addr)
> +
> +#define writeb_relaxed(b, addr)	writeb(b, addr)
> +#define writew_relaxed(b, addr)	writew(b, addr)
> +#define writel_relaxed(b, addr)	writel(b, addr)

Putting them here means they won't have any multiple include protection
(there is no "#ifndef _IO_H" around them). Doesn't seem to lead to
any problems in practice. Just flagging it...

Regards
Greg



> diff --git a/arch/m68k/include/asm/io_no.h b/arch/m68k/include/asm/io_no.h
> index 52f7e8499172..19c237c63dc2 100644
> --- a/arch/m68k/include/asm/io_no.h
> +++ b/arch/m68k/include/asm/io_no.h
> @@ -40,10 +40,6 @@ static inline unsigned int _swapl(volatile unsigned long v)
>  #define readl(addr) \
>      ({ unsigned int __v = (*(volatile unsigned int *) (addr)); __v; })
>  
> -#define readb_relaxed(addr) readb(addr)
> -#define readw_relaxed(addr) readw(addr)
> -#define readl_relaxed(addr) readl(addr)
> -
>  #define writeb(b,addr) (void)((*(volatile unsigned char *) (addr)) = (b))
>  #define writew(b,addr) (void)((*(volatile unsigned short *) (addr)) = (b))
>  #define writel(b,addr) (void)((*(volatile unsigned int *) (addr)) = (b))
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ