AES-NI instructions in guest

This is for discussing general topics about how to use VirtualBox.
Post Reply
hcb
Posts: 2
Joined: 15. Jun 2013, 11:31

AES-NI instructions in guest

Post by hcb »

Hello,

does virtualbox support passing the AES-NI instructions from the host to a guest?

I am trying to use them from a Windows 7 host inside a Linux guest. The guest sees the correct cpu model "Intel(R) Core(TM) i5-4670T CPU @ 2.30GHz", but not the instruction set. Is it because of my hardware/software setup, a bug or not supported at all?

Thanks,
Christian.

processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 60
model name : Intel(R) Core(TM) i5-4670T CPU @ 2.30GHz
stepping : 3
cpu MHz : 2209.020
cache size : 6144 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 2
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 5
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl pni ssse3 lahf_lm
bogomips : 4418.04
clflush size : 64
cache_alignment : 64
address sizes : 39 bits physical, 48 bits virtual
power management:
BillG
Volunteer
Posts: 5106
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: AES-NI instructions in guest

Post by BillG »

I can't see how VirtualBox comes into the picture. The CPU is not emulated, it is virtualized. The code generated by the guest OS is executed by the physical CPU. The vm gets its time slice of the CPU, like any other process running on the physical machine.
Bill
hcb
Posts: 2
Joined: 15. Jun 2013, 11:31

Re: AES-NI instructions in guest

Post by hcb »

Exactly virtualization and not emulation.

I just start a Debian live CD (debian-live-7.0.0-amd64-standard.iso). One time directly on the host and a second time inside a virtual machine on the same host. CPU features/flags should be same, but are totally different. It is more then aes missing. For example the guest only sees sse3, but the host supports sse4_2

Host:

processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 60
model name : Intel(R) Core(TM) i5-4670T CPU @ 2.30GHz
stepping : 3
microcode : 0x7
cpu MHz : 800.000
cache size : 6144 KB
physical id : 0
siblings : 4
core id : 0
cpu cores : 4
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms
bogomips : 4599.77
clflush size : 64
cache_alignment : 64
address sizes : 39 bits physical, 48 bits virtual
power management:


Guest:

processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 60
model name : Intel(R) Core(TM) i5-4670T CPU @ 2.30GHz
stepping : 3
cpu MHz : 2206.031
cache size : 6144 KB
fpu : yes
fpu_exception : yes
cpuid level : 5
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx rdtscp lm constant_tsc up rep_good nopl pni monitor ssse3 lahf_lm
bogomips : 4412.06
clflush size : 64
cache_alignment : 64
address sizes : 39 bits physical, 48 bits virtual
power management:
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: AES-NI instructions in guest

Post by mpack »

There have been instances in the past where some CPU features are masked when the feature registers are passed to the guest. I don't know if this is one of those cases, but if yes then it'll be because VirtualBox can't support that feature, for some reason. For example, the context of that instruction may not be saved when switching between guest and host.
FireballDWF
Posts: 1
Joined: 6. Jan 2014, 15:14
Primary OS: Other
VBox Version: OSE other
Guest OSses: Debian

Re: AES-NI instructions in guest

Post by FireballDWF »

Known issue: ticket #9537
Post Reply