RE: [PATCH] crypto: inside-secure - Fix corruption on not fully coherent systems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
> Sent: Friday, September 18, 2020 10:01 AM
> To: Van Leeuwen, Pascal <pvanleeuwen@xxxxxxxxxx>
> Cc: linux-crypto@xxxxxxxxxxxxxxx; antoine.tenart@xxxxxxxxxxx; davem@xxxxxxxxxxxxx; Ard Biesheuvel <ardb@xxxxxxxxxx>
> Subject: Re: [PATCH] crypto: inside-secure - Fix corruption on not fully coherent systems
>
> <<< External Email >>>
> On Fri, Sep 18, 2020 at 07:42:35AM +0000, Van Leeuwen, Pascal wrote:
> >
> > Actually, that is what we did as a _quick hack_ initially, but:
> >
> > First of all, it's not only about the L1 cacheline size. It's about the worst case cache
> > line size in the path all the way from the CPU to the actual memory interface.
> >
> > Second, cache line sizes may differ from system to system. So it's not actually
> > a constant at all (unless you compile the driver specifically for 1 target system).
>
> Can this alignment exceed ARCH_DMA_MINALIGN? If not then the
> macro CRYPTO_MINALIGN should cover it.
>
I don't know. I'm not familiar with that macro and I have not been able to dig up any
clear description on what it should convey.

Based on the name, I might be inclined to think yes, but based on many definitions
I've seen in header files, I would say no. Because it's often just an alias for the L1
cacheline size, which may not be the largest cacheline for _some_ systems.

In any case, aligning to the worst cache cacheline for a CPU architecture may mean
you end up wasting a lot of space on a system with a much smaller cacheline.

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

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.


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




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux