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: <CA+55aFzbSKH+N2Yt2zoth6tmbTp6GpxHP8KuT7jzgQD58T6yHQ@mail.gmail.com>
Date:	Wed, 28 Aug 2013 09:16:48 -0700
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	Ezequiel Garcia <ezequiel.garcia@...e-electrons.com>
Cc:	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Thomas Petazzoni <thomas.petazzoni@...e-electrons.com>,
	Gregory Clement <gregory.clement@...e-electrons.com>,
	Lior Amsalem <alior@...vell.com>,
	Baruch Siach <baruch@...s.co.il>,
	Will Deacon <will.deacon@....com>,
	Sebastian Hesselbarth <sebastian.hesselbarth@...il.com>,
	Russell King <linux@....linux.org.uk>,
	Catalin Marinas <catalin.marinas@....com>
Subject: Re: [PATCH v4 1/4] lib: Introduce atomic MMIO modify

On Wed, Aug 28, 2013 at 3:37 AM, Ezequiel Garcia
<ezequiel.garcia@...e-electrons.com> wrote:
> Linus,
>
> Andrew suggested you might have opinions on this, so I'm cc'ing you.
> Since you'll probably want some better context, here it is:
>
> http://lwn.net/Articles/564709/
>
> On Sat, Aug 24, 2013 at 12:35:29PM -0300, Ezequiel Garcia wrote:
>> Some platforms have MMIO regions that are shared across orthogonal
>> subsystems. This commit implements a possible solution for the
>> thread-safe access of such regions through a spinlock-protected API.
>>
>> Concurrent access is protected with a single spinlock for the
>> entire MMIO address space. While this protects shared-registers,
>> it also serializes access to unrelated/unshared registers.

I have nothing against this, except that
"__HAVE_ARCH_ATOMIC_IO_MODIFY" needs to die, along with the #ifdef.

It should be a CONFIG_xyz option that gets set by the architectures
that have it, and then instead of an #ifdef in code, the Makefile
should make the generic target be conditional.

So add a generic

    bool GENERIC_ATOMIC_MMIO_MODIFY
        depends on !ARCH_ATOMIC_MMIO_MODIFY
        default y

to the lib/Kconfig file, and then lib/Makefile just does

    obj-$(CONFIG_GENERIC_ATOMIC_MMIO_MODIFY) += atomic_io.o

After that, ARM can then implement some architecture-optimized
version, and in its own Kconfig file just do "select
ARCH_ATOMIC_MMIO_MODIFY" to let the generic code know that it should
disable that generic version.

                 Linus
--
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