[aarch64-port-dev ] Linux aarch64 Virtualization detection

Baesken, Matthias matthias.baesken at sap.com
Fri Jan 13 08:25:53 UTC 2023


Hi , maybe someone can help with the following topic.

On  x86_64  there is for quite some time  coding in the JVM  to detect  the virtualization  (e.g. VMWare, KVM, Xen …)  .

The info is  later used in hs_err  file output   / jfr   etc .

See

https://github.com/openjdk/jdk/blob/34cdda5b8359cce33c2d4f92a41a620aea4f96e7/src/hotspot/cpu/x86/vm_version_x86.cpp#L608

https://github.com/openjdk/jdk/blob/34cdda5b8359cce33c2d4f92a41a620aea4f96e7/src/hotspot/cpu/x86/vm_version_x86.cpp#L2032

  (x86_64  uses the   cpuid  call)

On  Linux  ppc64(le)  we have something similar  (but this parses  some /proc file  system location ).

I think it would be nice  to  have  the  Virtualization detection   on Linux aarch64  too .

Is someone aware of some  good  ways to get the info on aarch64 ?

On OS level , we can for example call  this to get the info  :

sudo dmidecode -s system-product-name
KVM Virtual Machine

(but calling stuff like  dmidecode  from the JVM is not really an option , and it also needs privileges [sudo]  ) .

For  the JVM we need something more lightweight (like cpuid  call  on x86_64  , or  parsing a file on ppc64(le) ) .


Best regards, Matthias


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/aarch64-port-dev/attachments/20230113/79abe657/attachment-0001.htm>


More information about the aarch64-port-dev mailing list