All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Van Leeuwen, Pascal" <pvanleeuwen@rambus.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>,
	"antoine.tenart@bootlin.com" <antoine.tenart@bootlin.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	Ard Biesheuvel <ardb@kernel.org>
Subject: RE: [PATCH] crypto: inside-secure - Fix corruption on not fully coherent systems
Date: Thu, 24 Sep 2020 12:51:11 +0000	[thread overview]
Message-ID: <CY4PR0401MB36528881D714296074EF135AC3390@CY4PR0401MB3652.namprd04.prod.outlook.com> (raw)
In-Reply-To: <20200924123559.GA10827@gondor.apana.org.au>


> -----Original Message-----
> From: Herbert Xu <herbert@gondor.apana.org.au>
> Sent: Thursday, September 24, 2020 2:36 PM
> To: Van Leeuwen, Pascal <pvanleeuwen@rambus.com>
> Cc: linux-crypto@vger.kernel.org; antoine.tenart@bootlin.com; davem@davemloft.net; Ard Biesheuvel <ardb@kernel.org>
> Subject: Re: [PATCH] crypto: inside-secure - Fix corruption on not fully coherent systems
>
> <<< External Email >>>
> On Thu, Sep 24, 2020 at 08:08:12AM +0000, Van Leeuwen, Pascal wrote:
> >
> > The fact that kmalloc uses it does _not_ rule out the fact that it wastes memory ...
> > And as long as you use kmalloc for fairly large data structures, it shouldn't matter much.
> > But here I need a couple of fairly small buffers.
>
> Those small buffers are embedded in a structure that's already
> aligned by kmalloc.  So just put your buffers at the start of
> the struct to minimise holes.
>
If you would make them fixed in size, then putting them at the start instead of the
end would indeed by a bit more efficient (but obviously, that doesn't work if you
dynamically scale them), I'll remember that.

But you still have 2 potential gaps (from buffer 1 to buffer 2 and from buffer 2 to
the other items in the struct) that are larger then they may need to be.
If everyone can live with the wasted space, it's fine by me. (frankly, I don't know
where these structs may end up - guess not on the minimal kernel stack then?)

I only did it this way  because I anticipated that that would be accepted ... guess I
could've save myself some trouble there :-)

Regards,
Pascal van Leeuwen
Silicon IP Architect Multi-Protocol Engines, Rambus Security
Rambus ROTW Holding BV
+31-73 6581953

Note: The Inside Secure/Verimatrix Silicon IP team was recently acquired by Rambus.
Please be so kind to update your e-mail address book with my new e-mail address.

> Cheers,
> --
> Email: Herbert Xu <herbert@gondor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


** This message and any attachments are for the sole use of the intended recipient(s). It may contain information that is confidential and privileged. If you are not the intended recipient of this message, you are prohibited from printing, copying, forwarding or saving it. Please delete the message and attachments and notify the sender immediately. **

Rambus Inc.<http://www.rambus.com>

  reply	other threads:[~2020-09-24 12:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-07  8:19 [PATCH] crypto: inside-secure - Fix corruption on not fully coherent systems Pascal van Leeuwen
2020-09-18  6:58 ` Herbert Xu
2020-09-18  7:42   ` Van Leeuwen, Pascal
2020-09-18  8:01     ` Herbert Xu
2020-09-18  8:21       ` Van Leeuwen, Pascal
2020-09-24  3:11         ` Herbert Xu
2020-09-24  8:08           ` Van Leeuwen, Pascal
2020-09-24 12:35             ` Herbert Xu
2020-09-24 12:51               ` Van Leeuwen, Pascal [this message]
2020-09-24 12:58                 ` Herbert Xu

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=CY4PR0401MB36528881D714296074EF135AC3390@CY4PR0401MB3652.namprd04.prod.outlook.com \
    --to=pvanleeuwen@rambus.com \
    --cc=antoine.tenart@bootlin.com \
    --cc=ardb@kernel.org \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.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.