Skip to content

Implement PMULL using host intrinsics

Ard Biesheuvel qemu-arm qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2target/arm: Use x86 intrinsics to implement PMULL.P64host/include/i386/host/cpuinfo.h target/arm/tcg/vec_helper.c util/cpuinfo-i386.c+27 -12 replies
2/2target/i386: Implement PCLMULQDQ using AArch64 PMULL instructionshost/include/aarch64/host/cpuinfo.h target/i386/ops_sse.h util/cpuinfo-aarch64.c+26 -01 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] Implement PMULL using host intrinsics

Another set of RFC patches - this time for 64x64->128 polynomial multiplication. Playing round with this on top of the AES changes I sent out earlier this week, I noticed that the speedup is rather substantial.

PMULL is relevant for GCM encryption, which combines AES in counter mode with GHASH, which is based on multiplication in GF(2^128). The significance of PMULL to this encryption mode is basically why PMULL is part of the AES crypto extension on AArch64.

Note that user emulation on a AArch64 host of x86 binaries that perform any kind of HTTPS communication under the hood would likely benefit from this.

Again, this approach is likely too ad-hoc, but it helps span the space of what we might want to cover in terms of host acceleration API. (I'm not a TCG expert, but I guess this raises the question what to cover in helpers and what to cover using native TCG ops?)

Cc Peter Maydell <[email protected]>
Cc Alex Bennée <[email protected]>
Cc Richard Henderson <[email protected]>
Cc Philippe Mathieu-Daudé <[email protected]>

Ard Biesheuvel (2):
target/arm: Use x86 intrinsics to implement PMULL.P64 target/i386: Implement PCLMULQDQ using AArch64 PMULL instructions

 host/include/aarch64/host/cpuinfo.h |  1 +
 host/include/i386/host/cpuinfo.h    |  1 +
 target/arm/tcg/vec_helper.c         | 26 +++++++++++++++++++-
 target/i386/ops_sse.h               | 24 ++++++++++++++++++
 util/cpuinfo-aarch64.c              |  1 +
 util/cpuinfo-i386.c                 |  1 +
 6 files changed, 53 insertions(+), 1 deletion(-)
Signature · 1 line
2.39.2