All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Martin <Dave.Martin@arm.com>
To: Mark Brown <broonie@kernel.org>
Cc: Alexandre Torgue <alexandre.torgue@st.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Ard Biesheuvel <ardb@kernel.org>,
	l00374334 <liqiang64@huawei.com>,
	Linux Crypto Mailing List <linux-crypto@vger.kernel.org>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Will Deacon <will@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	Herbert Xu <herbert@gondor.apana.org.au>
Subject: Re: [PATCH 1/1] arm64: Accelerate Adler32 using arm64 SVE instructions.
Date: Thu, 5 Nov 2020 17:56:48 +0000	[thread overview]
Message-ID: <20201105175647.GI6882@arm.com> (raw)
In-Reply-To: <20201104184905.GB4812@sirena.org.uk>

On Wed, Nov 04, 2020 at 06:49:05PM +0000, Mark Brown wrote:
> On Wed, Nov 04, 2020 at 06:13:06PM +0000, Dave Martin wrote:
> > On Wed, Nov 04, 2020 at 05:50:33PM +0000, Mark Brown wrote:
> 
> > > I think at a minimum we'd want to handle the vector length explicitly
> > > for kernel mode SVE, vector length independent code will work most of
> > > the time but at the very least it feels like a landmine waiting to cause
> > > trouble.  If nothing else there's probably going to be cases where it
> > > makes a difference for performance.  Other than that I'm not currently
> 
> ...
> 
> > The main reasons for constraining the vector length are a) to hide
> > mismatches between CPUs in heterogeneous systems, b) to ensure that
> > validated software doesn't run with a vector length it wasn't validated
> > for, and c) testing.
> 
> > For kernel code, it's reasonable to say that all code should be vector-
> > length agnostic unless there's a really good reason not to be.  So we
> > may not care too much about (b).
> 
> > In that case, just setting ZCR_EL1.LEN to max in kernel_sve_begin() (or
> > whatever) probably makes sense.
> 
> I agree, that's most likely a good default.
> 
> > For (c), it might be useful to have a command-line parameter or debugfs
> > widget to constrain the vector length for kernel code; perhaps globally
> > or perhaps per driver or algo.
> 
> I think a global control would be good for testing, it seems simpler and
> easier all round.  The per thing tuning seems more useful for cases
> where we run into something like a performance reason to use a limited
> set of vector lengths but I think we should only add that when we have
> at least one user for it, some examples of actual restrictions we want
> would probably be helpful for designing the interface.

Ack; note that an algo that wants to use a particular vector length can
do so by means of the special predicate patterns VLnnn, POW2, MUL3 etc.
So setting an explicit limit in ZCR_EL1.LEN should hopefully be an
uncommon requirement.

> 
> > Nonetheless, working up a candidate algorithm to help us see whether
> > there is a good use case seems like a worthwhile project, so I don't
> > want to discourage that too much.
> 
> Definitely worth exploring.

Cheers
---Dave

WARNING: multiple messages have this Message-ID (diff)
From: Dave Martin <Dave.Martin@arm.com>
To: Mark Brown <broonie@kernel.org>
Cc: Alexandre Torgue <alexandre.torgue@st.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	"David S. Miller" <davem@davemloft.net>,
	l00374334 <liqiang64@huawei.com>,
	Linux Crypto Mailing List <linux-crypto@vger.kernel.org>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Will Deacon <will@kernel.org>, Ard Biesheuvel <ardb@kernel.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	Herbert Xu <herbert@gondor.apana.org.au>
Subject: Re: [PATCH 1/1] arm64: Accelerate Adler32 using arm64 SVE instructions.
Date: Thu, 5 Nov 2020 17:56:48 +0000	[thread overview]
Message-ID: <20201105175647.GI6882@arm.com> (raw)
In-Reply-To: <20201104184905.GB4812@sirena.org.uk>

On Wed, Nov 04, 2020 at 06:49:05PM +0000, Mark Brown wrote:
> On Wed, Nov 04, 2020 at 06:13:06PM +0000, Dave Martin wrote:
> > On Wed, Nov 04, 2020 at 05:50:33PM +0000, Mark Brown wrote:
> 
> > > I think at a minimum we'd want to handle the vector length explicitly
> > > for kernel mode SVE, vector length independent code will work most of
> > > the time but at the very least it feels like a landmine waiting to cause
> > > trouble.  If nothing else there's probably going to be cases where it
> > > makes a difference for performance.  Other than that I'm not currently
> 
> ...
> 
> > The main reasons for constraining the vector length are a) to hide
> > mismatches between CPUs in heterogeneous systems, b) to ensure that
> > validated software doesn't run with a vector length it wasn't validated
> > for, and c) testing.
> 
> > For kernel code, it's reasonable to say that all code should be vector-
> > length agnostic unless there's a really good reason not to be.  So we
> > may not care too much about (b).
> 
> > In that case, just setting ZCR_EL1.LEN to max in kernel_sve_begin() (or
> > whatever) probably makes sense.
> 
> I agree, that's most likely a good default.
> 
> > For (c), it might be useful to have a command-line parameter or debugfs
> > widget to constrain the vector length for kernel code; perhaps globally
> > or perhaps per driver or algo.
> 
> I think a global control would be good for testing, it seems simpler and
> easier all round.  The per thing tuning seems more useful for cases
> where we run into something like a performance reason to use a limited
> set of vector lengths but I think we should only add that when we have
> at least one user for it, some examples of actual restrictions we want
> would probably be helpful for designing the interface.

Ack; note that an algo that wants to use a particular vector length can
do so by means of the special predicate patterns VLnnn, POW2, MUL3 etc.
So setting an explicit limit in ZCR_EL1.LEN should hopefully be an
uncommon requirement.

> 
> > Nonetheless, working up a candidate algorithm to help us see whether
> > there is a good use case seems like a worthwhile project, so I don't
> > want to discourage that too much.
> 
> Definitely worth exploring.

Cheers
---Dave

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-11-05 17:56 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-03 12:15 [PATCH 0/1] arm64: Accelerate Adler32 using arm64 SVE instructions l00374334
2020-11-03 12:15 ` l00374334
2020-11-03 12:15 ` [PATCH 1/1] " l00374334
2020-11-03 12:15   ` l00374334
2020-11-03 14:34   ` Ard Biesheuvel
2020-11-03 14:34     ` Ard Biesheuvel
2020-11-03 18:00     ` Dave Martin
2020-11-03 18:00       ` Dave Martin
2020-11-04  9:19       ` Li Qiang
2020-11-04  9:19         ` Li Qiang
2020-11-04 14:49         ` Dave Martin
2020-11-04 14:49           ` Dave Martin
2020-11-05  2:32           ` Li Qiang
2020-11-05  2:32             ` Li Qiang
2020-11-04 17:50       ` Mark Brown
2020-11-04 17:50         ` Mark Brown
2020-11-04 18:13         ` Dave Martin
2020-11-04 18:13           ` Dave Martin
2020-11-04 18:49           ` Mark Brown
2020-11-04 18:49             ` Mark Brown
2020-11-05 17:56             ` Dave Martin [this message]
2020-11-05 17:56               ` Dave Martin
2020-11-04  8:01     ` Li Qiang
2020-11-04  8:01       ` Li Qiang
2020-11-04  8:04       ` Ard Biesheuvel
2020-11-04  8:04         ` Ard Biesheuvel
2020-11-04  8:14         ` Li Qiang
2020-11-04  8:14           ` Li Qiang
2020-11-04 17:57   ` Eric Biggers
2020-11-04 17:57     ` Eric Biggers
2020-11-05  2:49     ` Li Qiang
2020-11-05  2:49       ` Li Qiang
2020-11-05  7:51       ` Ard Biesheuvel
2020-11-05  7:51         ` Ard Biesheuvel
2020-11-05  9:05         ` Li Qiang
2020-11-05  9:05           ` Li Qiang
2020-11-05 18:21           ` Eric Biggers
2020-11-05 18:21             ` Eric Biggers
2020-11-09  6:29             ` Li Qiang
2020-11-09  6:29               ` Li Qiang
2020-11-05 16:53 ` [PATCH 0/1] " Dave Martin
2020-11-05 16:53   ` Dave Martin
2020-11-09  3:43   ` Li Qiang
2020-11-09  3:43     ` Li Qiang
2020-11-10 10:46     ` Dave Martin
2020-11-10 10:46       ` Dave Martin
2020-11-10 13:20       ` Li Qiang
2020-11-10 13:20         ` Li Qiang
2020-11-10 16:07         ` Dave Martin
2020-11-10 16:07           ` Dave Martin
2020-11-12  7:20           ` Li Qiang
2020-11-12  7:20             ` Li Qiang
2020-11-12 11:17             ` Dave Martin
2020-11-12 11:17               ` Dave Martin
2020-11-14  7:31               ` Li Qiang
2020-11-14  7:31                 ` Li Qiang
2020-11-16 15:56                 ` Dave Martin
2020-11-16 15:56                   ` Dave Martin
2020-11-17 12:45                   ` Li Qiang
2020-11-17 12:45                     ` Li Qiang

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=20201105175647.GI6882@arm.com \
    --to=dave.martin@arm.com \
    --cc=alexandre.torgue@st.com \
    --cc=ardb@kernel.org \
    --cc=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=liqiang64@huawei.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=will@kernel.org \
    /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.