Re: [PATCH v8 1/2] target/s390x: support SHA-512 extensions

2022-09-23 Thread Alex Bennée
David Hildenbrand writes: > On 21.09.22 12:07, Jason A. Donenfeld wrote: >> In order to fully support MSA_EXT_5, we have to support the SHA-512 >> special instructions. So implement those. >> The implementation began as something TweetNacl-like, and then was >> adjusted to be useful here. It's

Re: [PATCH v8 1/2] target/s390x: support SHA-512 extensions

2022-09-22 Thread David Hildenbrand
On 22.09.22 16:51, David Hildenbrand wrote: On 22.09.22 16:35, Jason A. Donenfeld wrote: On Thu, Sep 22, 2022 at 03:07:13PM +0200, David Hildenbrand wrote: +if (processed >= MAX_BLOCKS_PER_RUN * 128) { +break; If you make this a `goto out` or similar instead of a break,

Re: [PATCH v8 1/2] target/s390x: support SHA-512 extensions

2022-09-22 Thread David Hildenbrand
On 22.09.22 16:35, Jason A. Donenfeld wrote: On Thu, Sep 22, 2022 at 03:07:13PM +0200, David Hildenbrand wrote: +if (processed >= MAX_BLOCKS_PER_RUN * 128) { +break; If you make this a `goto out` or similar instead of a break, then you can +if (type ==

Re: [PATCH v8 1/2] target/s390x: support SHA-512 extensions

2022-09-22 Thread David Hildenbrand
On 22.09.22 17:36, Thomas Huth wrote: On 22/09/2022 16.51, David Hildenbrand wrote: [...] Thanks. I'll resend this patch only as reply to your original one, so Thomas can easily pick it up (or add more feedback :)). We're also missing the machine compat handling ... could you add something

Re: [PATCH v8 1/2] target/s390x: support SHA-512 extensions

2022-09-22 Thread Thomas Huth
On 22/09/2022 16.51, David Hildenbrand wrote: [...] Thanks. I'll resend this patch only as reply to your original one, so Thomas can easily pick it up (or add more feedback :)). We're also missing the machine compat handling ... could you add something like this on top: diff --git

Re: [PATCH v8 1/2] target/s390x: support SHA-512 extensions

2022-09-22 Thread Jason A. Donenfeld
On Thu, Sep 22, 2022 at 03:07:13PM +0200, David Hildenbrand wrote: > +if (processed >= MAX_BLOCKS_PER_RUN * 128) { > +break; If you make this a `goto out` or similar instead of a break, then you can > +if (type == S390_FEAT_TYPE_KLMD && len < 128) { change that to `if

Re: [PATCH v8 1/2] target/s390x: support SHA-512 extensions

2022-09-22 Thread David Hildenbrand
On 21.09.22 12:07, Jason A. Donenfeld wrote: In order to fully support MSA_EXT_5, we have to support the SHA-512 special instructions. So implement those. The implementation began as something TweetNacl-like, and then was adjusted to be useful here. It's not very beautiful, but it is quite

[PATCH v8 1/2] target/s390x: support SHA-512 extensions

2022-09-21 Thread Jason A. Donenfeld
In order to fully support MSA_EXT_5, we have to support the SHA-512 special instructions. So implement those. The implementation began as something TweetNacl-like, and then was adjusted to be useful here. It's not very beautiful, but it is quite short and compact, which is what we're going for.