On 7/19/23 12:52, Ilya Leoshkevich wrote:
On Thu, 2023-07-13 at 22:14 +0100, Richard Henderson wrote:
Detect PCLMUL in cpuinfo; implement the accel hooks.
Signed-off-by: Richard Henderson <richard.hender...@linaro.org>
---
host/include/i386/host/cpuinfo.h | 1 +
host/include/i386/host/crypto/clmul.h | 187
++++++++++++++++++++++++
host/include/x86_64/host/crypto/clmul.h | 1 +
util/cpuinfo-i386.c | 1 +
4 files changed, 190 insertions(+)
create mode 100644 host/include/i386/host/crypto/clmul.h
create mode 100644 host/include/x86_64/host/crypto/clmul.h
...
diff --git a/util/cpuinfo-i386.c b/util/cpuinfo-i386.c
index 3a7b7e0ad1..c6f6364826 100644
--- a/util/cpuinfo-i386.c
+++ b/util/cpuinfo-i386.c
@@ -39,6 +39,7 @@ unsigned __attribute__((constructor))
cpuinfo_init(void)
info |= (c & bit_SSE4_1 ? CPUINFO_SSE4 : 0);
info |= (c & bit_MOVBE ? CPUINFO_MOVBE : 0);
info |= (c & bit_POPCNT ? CPUINFO_POPCNT : 0);
+ info |= (c & bit_PCLMULQDQ ? CPUINFO_PCLMUL : 0);
I wanted to give this a try, but my cpuid.h has only
bit_VPCLMULQDQ, and I don't see it in [1] either.
Should have been bit_PCLMUL (VPCLMULQDQ is for the 256- and 512-bit inputs). I'll have to
track down why this compiled for me.
Where is this supposed to come from? Does qemu/cpuid.h need an update?
Yes, an update is required.
r~