Proxmox CPU model kvm64 with PCID and AES flags

chrone

Active Member
Apr 15, 2015
115
16
38
planet earth
Hi Proxmox,

Is there a way to pass through the "aes" instruction to Guest VM by using CPU model kvm64?

I noticed with recent PVE 5.1-35 we could enable the PCID flag on the CPU model from GUI. Would be nice to have AES flag as well.

I know using CPU model host will give all the new CPU instructions, but if we live migrate to different CPU, the qemu might hang, hence the question arise for passing through both PCID and AES-NI instructions to VM with CPU model kvm64.
 
  • Like
Reactions: guletz
Just edit the config manually and set this:

Code:
cpu: kvm64,+aes

I can benchmark it with

Code:
openssl speed -evp aes-256-cbc

and it raises 65 MB/sec to 495 MB/sec in throughput
 
Just edit the config manually and set this:

Code:
cpu: kvm64,+aes

I can benchmark it with

Code:
openssl speed -evp aes-256-cbc

and it raises 65 MB/sec to 495 MB/sec in throughput


I got this error when I use "cpu: kvm64,+aes" on Proxmox 5.1.x the latest.

Code:
unable to parse value of 'cpu' - duplicate key in comma-separated list property: cputype
 
  • Like
Reactions: mkad
we will probably extend the recently introduced flags mechanism to support other flags than "pcid" and "spec-ctrl". in the meantime, you can just set the CPU type to one supporting AESNI (e.g., >= Westmere for Intel IIRC)
 
  • Like
Reactions: chrone
we will probably extend the recently introduced flags mechanism to support other flags than "pcid" and "spec-ctrl". in the meantime, you can just set the CPU type to one supporting AESNI (e.g., >= Westmere for Intel IIRC)

Awesome! Looking forward for this. :)
 
Damn, it worked until recently.

are you sure about that? I don't really see how based on the code and git history.. the same syntax works on the qemu command line though, so maybe you mixed those two up?
 
Okay, lets revise: I tested it recently on v4 :-D

hehe. just out of curiosity - git says it has been an enum before it turned into a property string (with an enum) for a long long time (at least since the switch from svn to git in 2011). possibly enums in the schema were at some point not enforced, but just used to generate docs/... ?
 
Yes, it was an enum over the GUI yet you could just add the aforementioned string in the configuration and it passed inspection as long as nobody changed the VM setttings or trigger a reread and rewrite internally. It was a hack, yet it worked.

It goes without saying, setting the cpu to westmere or newer is maybe the way to go.
 
we will probably extend the recently introduced flags mechanism to support other flags than "pcid" and "spec-ctrl". in the meantime, you can just set the CPU type to one supporting AESNI (e.g., >= Westmere for Intel IIRC)

Hello Fabian,

is there allready an ETA for that?

Or is there another "comfort" way to make it accessable via gui? For example add a custom cpu type via config?

kind regards
 
is there allready an ETA for that?

no (but patches welcome ;))

Or is there another "comfort" way to make it accessable via gui? For example add a custom cpu type via config?

no, the CPU types are direct mappings of those in Qemu, which are determined at compile time.
 
  • Like
Reactions: Sralityhe
Wrote a small patch that you can add aes, avx, avx2 to the vmconfig file and enable these for your guest.

If someone like the *deb for testing or other cpu-flags feel free to ask.
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!