Search code examples
linux-kernelaescpukernel-moduleinstructions

Detecting AES-NI CPU instructions


Recent Intel and AMD CPUs support specific AES instructions that increase the performance of encryption and decryption.

Is it possible to to detect when these instructions are called? For example by writing a kernel module that monitors the instructions that are sent to the CPU? Or is the kernel still to high-level?


Solution

  • My understanding is that instructions like AESENC require no special privileges, so you won't be able to trap them with one of the usual fault handlers even in the kernel. You might be able to do it with a modified version of QEMU or VirtualBox, but that would be a bit of a pain.

    I'm guessing you are trying to see if a software package supports AES-NI?