From: Will Deacon <will.deacon@arm.com>
To: Yury Norov <ynorov@caviumnetworks.com>
Cc: linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org,
Al Viro <viro@zeniv.linux.org.uk>,
Andrew Morton <akpm@linux-foundation.org>,
Andrew Pinski <Andrew.Pinski@cavium.com>,
Arnd Bergmann <arnd@arndb.de>,
Catalin Marinas <catalin.marinas@arm.com>,
"David S . Miller" <davem@davemloft.net>,
Geethasowjanya Akula <Geethasowjanya.Akula@cavium.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Ingo Molnar <mingo@kernel.org>, Kees Cook <keescook@chromium.org>,
Laura Abbott <labbott@redhat.com>,
Nicholas Piggin <npiggin@gmail.com>,
Sunil Goutham <Sunil.Goutham@cavium.com>
Subject: Re: [PATCH RFC 0/3] API for 128-bit IO access
Date: Fri, 26 Jan 2018 18:11:49 +0000 [thread overview]
Message-ID: <20180126181149.GA17922@arm.com> (raw)
In-Reply-To: <20180126090542.bsza7hqqinqwllcr@yury-thinkpad>
On Fri, Jan 26, 2018 at 12:05:42PM +0300, Yury Norov wrote:
> On Wed, Jan 24, 2018 at 10:22:13AM +0000, Will Deacon wrote:
> > On Wed, Jan 24, 2018 at 12:05:16PM +0300, Yury Norov wrote:
> > > This series adds API for 128-bit memory IO access and enables it for ARM64.
> > > The original motivation for 128-bit API came from new Cavium network device
> > > driver. The hardware requires 128-bit access to make things work. See
> > > description in patch 3 for details.
> > >
> > > Also, starting from ARMv8.4, stp and ldp instructions become atomic, and
> > > API for 128-bit access would be helpful in core arm64 code.
> >
> > Only for normal, cacheable memory, so they're not suitable for IO accesses
> > as you're proposing here.
>
> Hi Will,
>
> Thanks for clarification.
>
> Could you elaborate, do you find 128-bit read/write API useless, or
> you just correct my comment?
>
> I think that ordered uniform 128-bit access API would be helpful, even
> if not atomic.
Sorry, but I strongly disagree here. Having an IO accessor that isn't
guaranteed to be atomic is a recipe for disaster if it's not called out
explicitly. You're much better off implementing something along the lines
of <linux/io-128-nonatomic-hi-lo.h> using 2x64-bit accessors like we already
have for the 2x32-bit case.
However, that doesn't solve your problem and is somewhat of a distraction.
I'd suggest that in your case, where you have a device that relies on
128-bit atomic access that is assumedly tightly integrated into your SoC,
then the driver just codes it's own local implementation of the accessor,
given that there isn't a way to guarantee the atomicity architecturally
(and even within your SoC it might not be atomic to all endpoints).
Will
WARNING: multiple messages have this Message-ID (diff)
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH RFC 0/3] API for 128-bit IO access
Date: Fri, 26 Jan 2018 18:11:49 +0000 [thread overview]
Message-ID: <20180126181149.GA17922@arm.com> (raw)
In-Reply-To: <20180126090542.bsza7hqqinqwllcr@yury-thinkpad>
On Fri, Jan 26, 2018 at 12:05:42PM +0300, Yury Norov wrote:
> On Wed, Jan 24, 2018 at 10:22:13AM +0000, Will Deacon wrote:
> > On Wed, Jan 24, 2018 at 12:05:16PM +0300, Yury Norov wrote:
> > > This series adds API for 128-bit memory IO access and enables it for ARM64.
> > > The original motivation for 128-bit API came from new Cavium network device
> > > driver. The hardware requires 128-bit access to make things work. See
> > > description in patch 3 for details.
> > >
> > > Also, starting from ARMv8.4, stp and ldp instructions become atomic, and
> > > API for 128-bit access would be helpful in core arm64 code.
> >
> > Only for normal, cacheable memory, so they're not suitable for IO accesses
> > as you're proposing here.
>
> Hi Will,
>
> Thanks for clarification.
>
> Could you elaborate, do you find 128-bit read/write API useless, or
> you just correct my comment?
>
> I think that ordered uniform 128-bit access API would be helpful, even
> if not atomic.
Sorry, but I strongly disagree here. Having an IO accessor that isn't
guaranteed to be atomic is a recipe for disaster if it's not called out
explicitly. You're much better off implementing something along the lines
of <linux/io-128-nonatomic-hi-lo.h> using 2x64-bit accessors like we already
have for the 2x32-bit case.
However, that doesn't solve your problem and is somewhat of a distraction.
I'd suggest that in your case, where you have a device that relies on
128-bit atomic access that is assumedly tightly integrated into your SoC,
then the driver just codes it's own local implementation of the accessor,
given that there isn't a way to guarantee the atomicity architecturally
(and even within your SoC it might not be atomic to all endpoints).
Will
next prev parent reply other threads:[~2018-01-26 18:11 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-24 9:05 [PATCH RFC 0/3] API for 128-bit IO access Yury Norov
2018-01-24 9:05 ` Yury Norov
2018-01-24 9:05 ` Yury Norov
2018-01-24 9:05 ` [PATCH 1/3] UAPI: Introduce 128-bit types and byteswap operations Yury Norov
2018-01-24 9:05 ` Yury Norov
2018-01-24 9:05 ` [PATCH 2/3] asm-generic/io.h: API for 128-bit memory accessors Yury Norov
2018-01-24 9:05 ` Yury Norov
2018-01-24 9:05 ` Yury Norov
2018-01-24 9:05 ` [PATCH 3/3] arm64: enable 128-bit memory read/write support Yury Norov
2018-01-24 9:05 ` Yury Norov
2018-01-24 13:00 ` Geert Uytterhoeven
2018-01-24 13:00 ` Geert Uytterhoeven
2018-01-24 18:19 ` Yury Norov
2018-01-24 18:19 ` Yury Norov
2018-01-24 10:22 ` [PATCH RFC 0/3] API for 128-bit IO access Will Deacon
2018-01-24 10:22 ` Will Deacon
2018-01-26 9:05 ` Yury Norov
2018-01-26 9:05 ` Yury Norov
2018-01-26 18:11 ` Will Deacon [this message]
2018-01-26 18:11 ` Will Deacon
2018-01-29 10:25 ` Yury Norov
2018-01-29 10:25 ` Yury Norov
2018-01-24 10:28 ` Arnd Bergmann
2018-01-24 10:28 ` Arnd Bergmann
2018-01-24 15:48 ` Andy Shevchenko
2018-01-24 15:48 ` Andy Shevchenko
2018-01-24 15:48 ` Andy Shevchenko
2018-01-24 15:48 ` Andy Shevchenko
2018-01-25 11:38 ` Yury Norov
2018-01-25 11:38 ` Yury Norov
2018-01-25 11:38 ` Yury Norov
2018-01-25 12:11 ` Robin Murphy
2018-01-25 12:11 ` Robin Murphy
2018-01-25 12:11 ` Robin Murphy
2018-01-25 13:59 ` Arnd Bergmann
2018-01-25 13:59 ` Arnd Bergmann
2018-01-25 13:59 ` Arnd Bergmann
2018-01-24 16:38 ` Jeffrey Walton
2018-01-24 16:38 ` Jeffrey Walton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180126181149.GA17922@arm.com \
--to=will.deacon@arm.com \
--cc=Andrew.Pinski@cavium.com \
--cc=Geethasowjanya.Akula@cavium.com \
--cc=Sunil.Goutham@cavium.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=catalin.marinas@arm.com \
--cc=davem@davemloft.net \
--cc=gregkh@linuxfoundation.org \
--cc=keescook@chromium.org \
--cc=labbott@redhat.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=npiggin@gmail.com \
--cc=viro@zeniv.linux.org.uk \
--cc=ynorov@caviumnetworks.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.