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: <20140926080551.GD31106@ulmo>
Date:	Fri, 26 Sep 2014 10:05:52 +0200
From:	Thierry Reding <thierry.reding@...il.com>
To:	Arnd Bergmann <arnd@...db.de>
Cc:	Will Deacon <will.deacon@....com>,
	"linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"benh@...nel.crashing.org" <benh@...nel.crashing.org>,
	"chris@...kel.net" <chris@...kel.net>,
	"cmetcalf@...era.com" <cmetcalf@...era.com>,
	"davem@...emloft.net" <davem@...emloft.net>,
	"deller@....de" <deller@....de>,
	"dhowells@...hat.com" <dhowells@...hat.com>,
	"geert@...ux-m68k.org" <geert@...ux-m68k.org>,
	"heiko.carstens@...ibm.com" <heiko.carstens@...ibm.com>,
	"hpa@...or.com" <hpa@...or.com>,
	"jcmvbkbc@...il.com" <jcmvbkbc@...il.com>,
	"jesper.nilsson@...s.com" <jesper.nilsson@...s.com>,
	"mingo@...hat.com" <mingo@...hat.com>,
	"monstr@...str.eu" <monstr@...str.eu>,
	"paulmck@...ux.vnet.ibm.com" <paulmck@...ux.vnet.ibm.com>,
	"rdunlap@...radead.org" <rdunlap@...radead.org>,
	"sam@...nborg.org" <sam@...nborg.org>,
	"schwidefsky@...ibm.com" <schwidefsky@...ibm.com>,
	"starvik@...s.com" <starvik@...s.com>,
	"takata@...ux-m32r.org" <takata@...ux-m32r.org>,
	"tglx@...utronix.de" <tglx@...utronix.de>,
	"tony.luck@...el.com" <tony.luck@...el.com>,
	"daniel.thompson@...aro.org" <daniel.thompson@...aro.org>,
	"broonie@...aro.org" <broonie@...aro.org>,
	"linux@....linux.org.uk" <linux@....linux.org.uk>
Subject: Re: [PATCH v3 00/17] Cross-architecture definitions of relaxed MMIO
 accessors

On Thu, Sep 25, 2014 at 05:15:14PM +0200, Arnd Bergmann wrote:
> On Thursday 25 September 2014 17:07:47 Arnd Bergmann wrote:
> 
> > The current version doesn't let you do that, so I'll keel the #ifdef
> > sections separate. This also means that I won't apply your patch 17:
> > we will keep needing the #ifdef to support all three relevant combinations:
> > 
> > a) architectures that provide neither and want to get the defaults
> >    from asm-generic
> > b) architectures that provide the non-relaxed versions and want tog
> >    to get just the relaxed version from asm-generic
> > c) architectures that provide both
> > 
> 
> And here is the new version I applied:
> 
> diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
> index 508a57257de5..3e976be3bdd4 100644
> --- a/include/asm-generic/io.h
> +++ b/include/asm-generic/io.h
> @@ -174,6 +174,43 @@ static inline void writeq(u64 value, void __iomem *addr)
>  #endif /* CONFIG_64BIT */
>  
>  /*
> + * {read,write}{b,w,l,q}_relaxed() are like the regular version, but
> + * are not guaranteed to provide ordering against spinlocks or memory
> + * accesses.
> + */
> +#ifndef readb_relaxed
> +#define readb_relaxed readb
> +#endif

My original patch to consolidate the read*/write*() and friends
explicitly avoided the use of macros to do this. The reason was that if
we have static inline functions in asm-generic/io.h it defines the
canonical prototype of these functions, so that architectures that want
to override them can just copy the prototype from there.

So for consistency the above would become:

	#ifndef readb_relaxed
	#define readb_relaxed readb_relaxed
	static inline u8 readb_relaxed(const void __iomem *addr)
	{
		return readb(addr);
	}
	#endif

And analogously for the others. For the *_relaxed variants it's perhaps
not as important because the signature is the same as for the plain
variants, so I'm not objecting very strongly to the plain macros.

Thierry

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ