netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: ebiggers3@gmail.com
Cc: Jason@zx2c4.com, jeanphilippe.aumasson@gmail.com,
	gregkh@linuxfoundation.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, ak@linux.intel.com,
	David.Laight@aculab.com, tom@herbertland.com,
	hannes@stressinduktion.org, eric.dumazet@gmail.com,
	luto@kernel.org
Subject: Re: [PATCH v2 net-next 3/4] secure_seq: use SipHash in place of MD5
Date: Sat, 07 Jan 2017 20:42:37 -0500 (EST)	[thread overview]
Message-ID: <20170107.204237.1849847777260495687.davem@davemloft.net> (raw)
In-Reply-To: <20170107220911.GB8327@zzz>

From: Eric Biggers <ebiggers3@gmail.com>
Date: Sat, 7 Jan 2017 14:09:11 -0800

> Well, except those instructions aren't actually used in these
> places.  Although x86_64 SHA1-NI accelerated SHA-1 is available in
> the Linux crypto API, it seems that in kernel code it remains
> impractical to use these instructions on small amounts of data
> because they use XMM registers, which means the overhead of
> kernel_fpu_begin()/kernel_fpu_end() must be incurred.  Furthermore,
> kernel_fpu_begin() is not allowed in all contexts so there has to be
> a fallback.
> 
> Out of curiosity, is this actually a solvable problem, e.g. by
> making the code using the XMM registers responsible for saving and
> restoring the ones clobbered, or by optimizing
> kernel_fpu_begin()/kernel_fpu_end()?  Or does it in fact remain
> impractical for such instructions to be used for applications like
> this one?

On x86 making the FPU save more tractible in situations like this is
really hard and will make the code significantly more complex.

It's simpler and cheaper on sparc64, and unlike on x86 there aren't
any fundament restrictions on where FPU stuff can be used.  This is
because we don't have "save all the FPU state" instructions and have
to do it all by hand anyways.

However I will note that just like x86, sparc64 doesn't override the
md5_transform() in lib/md5.c like it should.

  reply	other threads:[~2017-01-08  1:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-07 14:40 [PATCH v2 net-next 0/4] Introduce The SipHash PRF Jason A. Donenfeld
2017-01-07 14:40 ` [PATCH v2 net-next 1/4] siphash: add cryptographically secure PRF Jason A. Donenfeld
2017-01-07 14:40 ` [PATCH v2 net-next 2/4] siphash: implement HalfSipHash1-3 for hash tables Jason A. Donenfeld
2017-01-07 14:40 ` [PATCH v2 net-next 3/4] secure_seq: use SipHash in place of MD5 Jason A. Donenfeld
2017-01-07 21:37   ` David Miller
2017-01-07 22:09     ` Eric Biggers
2017-01-08  1:42       ` David Miller [this message]
2017-01-09 13:18       ` David Laight
2017-01-08 12:23     ` Jason A. Donenfeld
2017-01-07 14:40 ` [PATCH v2 net-next 4/4] syncookies: use SipHash in place of SHA1 Jason A. Donenfeld
2017-01-07 19:54 ` [PATCH v2 net-next 0/4] Introduce The SipHash PRF Eric Biggers
2017-01-08 12:41   ` Jason A. Donenfeld

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=20170107.204237.1849847777260495687.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=David.Laight@aculab.com \
    --cc=Jason@zx2c4.com \
    --cc=ak@linux.intel.com \
    --cc=ebiggers3@gmail.com \
    --cc=eric.dumazet@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hannes@stressinduktion.org \
    --cc=jeanphilippe.aumasson@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tom@herbertland.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).