From fcf72c0b5f135879450835e9168819e8caf8e5a7 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 09 2021 10:04:09 +0000 Subject: import virt-what-1.18-12.el8 --- diff --git a/SOURCES/0001-Missing-have_cpuinfo-check.patch b/SOURCES/0001-Missing-have_cpuinfo-check.patch index 8b89e45..702b39e 100644 --- a/SOURCES/0001-Missing-have_cpuinfo-check.patch +++ b/SOURCES/0001-Missing-have_cpuinfo-check.patch @@ -1,7 +1,7 @@ From eefc1e7e3dd8fb422baf0f13aec1df9880541b83 Mon Sep 17 00:00:00 2001 From: Jasper Lievisse Adriaanse Date: Thu, 10 Aug 2017 08:44:01 +0100 -Subject: [PATCH 01/21] Missing have_cpuinfo check. +Subject: [PATCH 01/22] Missing have_cpuinfo check. --- virt-what.in | 2 +- @@ -21,5 +21,5 @@ index 8c27b11..9050035 100644 fi fi -- -2.23.0 +2.32.0 diff --git a/SOURCES/0002-Remove-bashisms.patch b/SOURCES/0002-Remove-bashisms.patch index 2809cc8..69d4abb 100644 --- a/SOURCES/0002-Remove-bashisms.patch +++ b/SOURCES/0002-Remove-bashisms.patch @@ -1,7 +1,7 @@ From 9d90704a05dee7704470eff818a1c44aeef6c880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Fri, 4 Aug 2017 12:02:08 -0300 -Subject: [PATCH 02/21] Remove bashisms +Subject: [PATCH 02/22] Remove bashisms Use [ instead of [[ so we fall back to test if necessary: @@ -44,5 +44,5 @@ index 9050035..a05e0db 100644 fi fi -- -2.23.0 +2.32.0 diff --git a/SOURCES/0003-As-xen-pv-guest-can-access-cpuid-from-Intel-CPUs-sta.patch b/SOURCES/0003-As-xen-pv-guest-can-access-cpuid-from-Intel-CPUs-sta.patch index 201223c..472737b 100644 --- a/SOURCES/0003-As-xen-pv-guest-can-access-cpuid-from-Intel-CPUs-sta.patch +++ b/SOURCES/0003-As-xen-pv-guest-can-access-cpuid-from-Intel-CPUs-sta.patch @@ -1,7 +1,7 @@ From a821dc9961d457c086fffcc16a911cb6f9f8659a Mon Sep 17 00:00:00 2001 From: xiliang Date: Sun, 18 Jun 2017 00:33:28 +0800 -Subject: [PATCH 03/21] As xen pv guest can access cpuid from Intel CPUs +Subject: [PATCH 03/22] As xen pv guest can access cpuid from Intel CPUs started IvyBridge onwards have CPUID Faulting, added one more check in virt-what. @@ -32,5 +32,5 @@ index a05e0db..247348e 100644 # Check for AWS if echo "$dmi" | grep -q 'Version: [0-9]\.[0-9]\.amazon'; then -- -2.23.0 +2.32.0 diff --git a/SOURCES/0004-Recognize-ppc64le-little-endian-virtualization-RHBZ-.patch b/SOURCES/0004-Recognize-ppc64le-little-endian-virtualization-RHBZ-.patch index 88f4588..19ae275 100644 --- a/SOURCES/0004-Recognize-ppc64le-little-endian-virtualization-RHBZ-.patch +++ b/SOURCES/0004-Recognize-ppc64le-little-endian-virtualization-RHBZ-.patch @@ -1,7 +1,7 @@ From 7db94c8fe63f2c7ec3ac27cc5ff54ec1e1686aeb Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 17 Oct 2017 14:47:09 +0100 -Subject: [PATCH 04/21] Recognize ppc64le (little endian) virtualization +Subject: [PATCH 04/22] Recognize ppc64le (little endian) virtualization (RHBZ#1147876). Tested by Laurent Vivier, see: @@ -24,5 +24,5 @@ index 247348e..29b7b0d 100644 if grep -q 'model.*emulated by qemu' "${root}/proc/cpuinfo"; then echo ibm_power-kvm -- -2.23.0 +2.32.0 diff --git a/SOURCES/0005-Determine-architecture-via-uname-m.patch b/SOURCES/0005-Determine-architecture-via-uname-m.patch index e7d08f5..e7e8007 100644 --- a/SOURCES/0005-Determine-architecture-via-uname-m.patch +++ b/SOURCES/0005-Determine-architecture-via-uname-m.patch @@ -1,7 +1,7 @@ From 52870e8a264653d7921e8a4edff56d4b050614d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Sat, 27 Jan 2018 13:11:36 +0100 -Subject: [PATCH 05/21] Determine architecture via 'uname -m' +Subject: [PATCH 05/22] Determine architecture via 'uname -m' 'uname -p' only gives unknown on x86_64, i386, arm6l (rpi) and aarch64 (scaleways). @@ -26,5 +26,5 @@ index 29b7b0d..2011ff4 100644 # Check for VMware. # cpuid check added by Chetan Loke. -- -2.23.0 +2.32.0 diff --git a/SOURCES/0006-Allow-using-sysctl-for-example-when-proc-isn-t-avail.patch b/SOURCES/0006-Allow-using-sysctl-for-example-when-proc-isn-t-avail.patch index 50967ca..cd2d7ee 100644 --- a/SOURCES/0006-Allow-using-sysctl-for-example-when-proc-isn-t-avail.patch +++ b/SOURCES/0006-Allow-using-sysctl-for-example-when-proc-isn-t-avail.patch @@ -1,7 +1,7 @@ From d7fd8a7843030d2b1719353edfcd49dba3000122 Mon Sep 17 00:00:00 2001 From: Jasper Lievisse Adriaanse Date: Wed, 25 Apr 2018 16:41:32 +0200 -Subject: [PATCH 06/21] Allow using sysctl, for example when /proc isn't +Subject: [PATCH 06/22] Allow using sysctl, for example when /proc isn't available --- @@ -40,5 +40,5 @@ index 2011ff4..d037a99 100644 # This is known to fail for qemu with the explicit -cpu # option, since /proc/cpuinfo will not contain the QEMU -- -2.23.0 +2.32.0 diff --git a/SOURCES/0007-Replace-with-since-the-former-is-a-bash-ism.patch b/SOURCES/0007-Replace-with-since-the-former-is-a-bash-ism.patch index cd5d07c..28b35ed 100644 --- a/SOURCES/0007-Replace-with-since-the-former-is-a-bash-ism.patch +++ b/SOURCES/0007-Replace-with-since-the-former-is-a-bash-ism.patch @@ -1,7 +1,7 @@ From 5efe9f7a58cd0cdc6f4c279c7f0a69e57fbda56f Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 28 Aug 2018 18:32:41 +0100 -Subject: [PATCH 07/21] Replace == with = since the former is a bash-ism. +Subject: [PATCH 07/22] Replace == with = since the former is a bash-ism. Thanks: Eric Blake. @@ -24,5 +24,5 @@ index d037a99..a2f8f19 100644 fail () { -- -2.23.0 +2.32.0 diff --git a/SOURCES/0008-aws-Detect-AWS-from-dmidecode-information.patch b/SOURCES/0008-aws-Detect-AWS-from-dmidecode-information.patch index 0ce8536..fd68e10 100644 --- a/SOURCES/0008-aws-Detect-AWS-from-dmidecode-information.patch +++ b/SOURCES/0008-aws-Detect-AWS-from-dmidecode-information.patch @@ -1,7 +1,7 @@ From 147c648e950ef45b7a5b7b3e8cb30b89c435593b Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 31 Oct 2018 15:04:24 +0000 -Subject: [PATCH 08/21] aws: Detect AWS from dmidecode information. +Subject: [PATCH 08/22] aws: Detect AWS from dmidecode information. Move the AWS detection out from under Xen. AWS runs on KVM and baremetal these days. The dmidecode information for KVM and baremetal @@ -75,5 +75,5 @@ index ebfc190..5a0bdfc 100644 =item B -- -2.23.0 +2.32.0 diff --git a/SOURCES/0009-tests-Fix-tests-when-run-on-AWS.patch b/SOURCES/0009-tests-Fix-tests-when-run-on-AWS.patch index 03f9514..0260cb6 100644 --- a/SOURCES/0009-tests-Fix-tests-when-run-on-AWS.patch +++ b/SOURCES/0009-tests-Fix-tests-when-run-on-AWS.patch @@ -1,7 +1,7 @@ From 4bceb38a6102ca95bde79205efaa643a0824d3a2 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 31 Oct 2018 15:35:34 +0000 -Subject: [PATCH 09/21] tests: Fix tests when run on AWS. +Subject: [PATCH 09/22] tests: Fix tests when run on AWS. When running on AWS two of the tests failed. This was because the tests did _not_ include a working dmidecode binary, hence the platform @@ -28,5 +28,5 @@ diff --git a/tests/ppc64-baremetal/sbin/dmidecode b/tests/ppc64-baremetal/sbin/d old mode 100644 new mode 100755 -- -2.23.0 +2.32.0 diff --git a/SOURCES/0010-aws-Add-regression-test-for-AWS-on-KVM-on-x86_64-arc.patch b/SOURCES/0010-aws-Add-regression-test-for-AWS-on-KVM-on-x86_64-arc.patch index b6fdd56..834ef83 100644 --- a/SOURCES/0010-aws-Add-regression-test-for-AWS-on-KVM-on-x86_64-arc.patch +++ b/SOURCES/0010-aws-Add-regression-test-for-AWS-on-KVM-on-x86_64-arc.patch @@ -1,7 +1,7 @@ From 129a25f9854930928351c8cc3913a5b9a1c558b4 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 31 Oct 2018 15:23:45 +0000 -Subject: [PATCH 10/21] aws: Add regression test for AWS on KVM on x86_64 +Subject: [PATCH 10/22] aws: Add regression test for AWS on KVM on x86_64 architecture. --- @@ -286,5 +286,5 @@ index 0000000..db4c19f + exit 1 +fi -- -2.23.0 +2.32.0 diff --git a/SOURCES/0011-aws-Add-regression-test-for-AWS-on-baremetal-on-x86_.patch b/SOURCES/0011-aws-Add-regression-test-for-AWS-on-baremetal-on-x86_.patch index c733819..a41fc9d 100644 --- a/SOURCES/0011-aws-Add-regression-test-for-AWS-on-baremetal-on-x86_.patch +++ b/SOURCES/0011-aws-Add-regression-test-for-AWS-on-baremetal-on-x86_.patch @@ -1,7 +1,7 @@ From 298a15ead59c2dbeb9b2fabe7fb502100fdd4dc7 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 31 Oct 2018 15:43:20 +0000 -Subject: [PATCH 11/21] aws: Add regression test for AWS on baremetal on x86_64 +Subject: [PATCH 11/22] aws: Add regression test for AWS on baremetal on x86_64 architecture. --- @@ -3231,5 +3231,5 @@ index 0000000..d456163 + exit 1 +fi -- -2.23.0 +2.32.0 diff --git a/SOURCES/0012-aws-Add-regression-test-for-AWS-on-Xen-on-x86_64-arc.patch b/SOURCES/0012-aws-Add-regression-test-for-AWS-on-Xen-on-x86_64-arc.patch index fe563ad..8740e86 100644 --- a/SOURCES/0012-aws-Add-regression-test-for-AWS-on-Xen-on-x86_64-arc.patch +++ b/SOURCES/0012-aws-Add-regression-test-for-AWS-on-Xen-on-x86_64-arc.patch @@ -1,7 +1,7 @@ From 350291e1ca417eab9d2aa2408589f0259cac007c Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 31 Oct 2018 15:23:45 +0000 -Subject: [PATCH 12/21] aws: Add regression test for AWS on Xen on x86_64 +Subject: [PATCH 12/22] aws: Add regression test for AWS on Xen on x86_64 architecture. --- @@ -354,5 +354,5 @@ index 0000000..22b7f83 + exit 1 +fi -- -2.23.0 +2.32.0 diff --git a/SOURCES/0013-aws-Add-regression-test-for-AWS-on-KVM-on-ARM-archit.patch b/SOURCES/0013-aws-Add-regression-test-for-AWS-on-KVM-on-ARM-archit.patch index dcacb2e..720c42c 100644 --- a/SOURCES/0013-aws-Add-regression-test-for-AWS-on-KVM-on-ARM-archit.patch +++ b/SOURCES/0013-aws-Add-regression-test-for-AWS-on-KVM-on-ARM-archit.patch @@ -1,7 +1,7 @@ From f25e07d43db40355b321493f78758ea058fa3849 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 31 Oct 2018 15:23:45 +0000 -Subject: [PATCH 13/21] aws: Add regression test for AWS on KVM on ARM +Subject: [PATCH 13/22] aws: Add regression test for AWS on KVM on ARM architecture. --- @@ -240,5 +240,5 @@ index 0000000..8875421 + exit 1 +fi -- -2.23.0 +2.32.0 diff --git a/SOURCES/0014-build-Remove-files-on-make-clean.patch b/SOURCES/0014-build-Remove-files-on-make-clean.patch index 52e88b8..16cdd0f 100644 --- a/SOURCES/0014-build-Remove-files-on-make-clean.patch +++ b/SOURCES/0014-build-Remove-files-on-make-clean.patch @@ -1,7 +1,7 @@ From 56427ce169d5a6dc46ed6c6555ee3f7c4e0843d6 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 3 Oct 2019 09:08:19 +0100 -Subject: [PATCH 14/21] build: Remove *~ files on make clean. +Subject: [PATCH 14/22] build: Remove *~ files on make clean. --- Makefile.am | 2 +- @@ -21,5 +21,5 @@ index 67502fc..48fd518 100644 AM_CPPFLAGS = -Wall -- -2.23.0 +2.32.0 diff --git a/SOURCES/0015-Arrange-tests-in-subdirectories.patch b/SOURCES/0015-Arrange-tests-in-subdirectories.patch index cac7f88..6600692 100644 --- a/SOURCES/0015-Arrange-tests-in-subdirectories.patch +++ b/SOURCES/0015-Arrange-tests-in-subdirectories.patch @@ -1,13 +1,13 @@ From e3eeddbc857a5647135c42c97be75198929a8ce1 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 3 Oct 2019 09:53:49 +0100 -Subject: [PATCH 15/21] Arrange tests in subdirectories. +Subject: [PATCH 15/22] Arrange tests in subdirectories. This simplifies and isolates each test. --- .gitignore | 6 +- - Makefile.am | 261 +----------------- - configure.ac | 77 +++++- + Makefile.am | 263 +----------------- + configure.ac | 77 ++++- tests/Makefile.am | 20 ++ tests/aws-baremetal-x86/Makefile.am | 28 ++ .../test.sh} | 4 +- @@ -77,7 +77,7 @@ This simplifies and isolates each test. tests/{test-xen-arm.sh => xen-arm/test.sh} | 4 +- tests/zvm/Makefile.am | 29 ++ tests/{test-zvm.sh => zvm/test.sh} | 4 +- - 72 files changed, 1138 insertions(+), 361 deletions(-) + 72 files changed, 1139 insertions(+), 362 deletions(-) create mode 100644 tests/Makefile.am create mode 100644 tests/aws-baremetal-x86/Makefile.am rename tests/{test-aws-baremetal-x86.sh => aws-baremetal-x86/test.sh} (93%) @@ -173,21 +173,23 @@ diff --git a/Makefile.am b/Makefile.am index 48fd518..b62738f 100644 --- a/Makefile.am +++ b/Makefile.am -@@ -15,9 +15,13 @@ +@@ -15,10 +15,14 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -+AM_CPPFLAGS = -Wall -+ - CLEANFILES = virt-what *~ +-CLEANFILES = virt-what *~ +- + AM_CPPFLAGS = -Wall --AM_CPPFLAGS = -Wall ++CLEANFILES = virt-what *~ ++ +EXTRA_DIST = virt-what.in virt-what.pod + +SUBDIRS = . tests - ++ sbin_SCRIPTS = virt-what libexec_PROGRAMS = virt-what-cpuid-helper + if HOST_CPU_IA64 @@ -37,258 +41,3 @@ virt-what.txt: virt-what.pod pod2text $? > $@ @@ -2380,5 +2382,5 @@ index 0620db0..a22f311 100755 ibm_systemz-zvm" -- -2.23.0 +2.32.0 diff --git a/SOURCES/0016-build-Add-.gitignore-to-tarball.patch b/SOURCES/0016-build-Add-.gitignore-to-tarball.patch index ea0d391..0264272 100644 --- a/SOURCES/0016-build-Add-.gitignore-to-tarball.patch +++ b/SOURCES/0016-build-Add-.gitignore-to-tarball.patch @@ -1,7 +1,7 @@ From 5c2c251d9aae98e6a629b966bdd8cae2aa1dedaf Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 3 Oct 2019 10:16:08 +0100 -Subject: [PATCH 16/21] build: Add .gitignore to tarball. +Subject: [PATCH 16/22] build: Add .gitignore to tarball. Mainly to keep maintainer-check-extra-dist happy. --- @@ -22,5 +22,5 @@ index b62738f..1cb73b7 100644 SUBDIRS = . tests -- -2.23.0 +2.32.0 diff --git a/SOURCES/0017-maintainer-Add-rules-for-maintainers.patch b/SOURCES/0017-maintainer-Add-rules-for-maintainers.patch index 3d9dc57..1bc0244 100644 --- a/SOURCES/0017-maintainer-Add-rules-for-maintainers.patch +++ b/SOURCES/0017-maintainer-Add-rules-for-maintainers.patch @@ -1,7 +1,7 @@ From b6161b67b0bd542169e13cdfa0488a0266e3ae7a Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 3 Oct 2019 10:13:43 +0100 -Subject: [PATCH 17/21] maintainer: Add rules for maintainers. +Subject: [PATCH 17/22] maintainer: Add rules for maintainers. Adds: make maintainer-check-extra-dist @@ -47,5 +47,5 @@ index 1cb73b7..5435132 100644 +maintainer-tag: + git tag -a v$(VERSION) -m "Version $(VERSION)." -f -- -2.23.0 +2.32.0 diff --git a/SOURCES/0018-Fix-virt-what-cpuid-helper.patch b/SOURCES/0018-Fix-virt-what-cpuid-helper.patch index 537253b..39f6bbe 100644 --- a/SOURCES/0018-Fix-virt-what-cpuid-helper.patch +++ b/SOURCES/0018-Fix-virt-what-cpuid-helper.patch @@ -1,7 +1,7 @@ From a5471559e7398418f1bb9c538a7bfc8f39e9ae98 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 4 Oct 2019 15:57:42 +0300 -Subject: [PATCH 18/21] Fix virt-what-cpuid-helper. +Subject: [PATCH 18/22] Fix virt-what-cpuid-helper. The value returned in %eax is the max_entry (eg. 0x40000000 if there are no further leafs). However it is not reliable. @@ -71,13 +71,13 @@ index 7812545..0cd4a6f 100644 char sig[13]; - unsigned int base = 0x40000000, leaf = base; - unsigned int max_entries; -- -- memset (sig, 0, sizeof sig); -- max_entries = cpuid (leaf, sig); -- puts (sig); + const uint32_t base = 0x40000000; + uint32_t leaf; +- memset (sig, 0, sizeof sig); +- max_entries = cpuid (leaf, sig); +- puts (sig); +- - /* Most hypervisors only have information in leaf 0x40000000, but - * upstream Xen contains further leaf entries (in particular when - * used with Viridian [HyperV] extensions). CPUID is supposed to @@ -114,5 +114,5 @@ index 7812545..0cd4a6f 100644 } } -- -2.23.0 +2.32.0 diff --git a/SOURCES/0019-Add-support-for-Nutanix-Acropolis-Hypervisor-AHV-RHB.patch b/SOURCES/0019-Add-support-for-Nutanix-Acropolis-Hypervisor-AHV-RHB.patch index dee019e..8937018 100644 --- a/SOURCES/0019-Add-support-for-Nutanix-Acropolis-Hypervisor-AHV-RHB.patch +++ b/SOURCES/0019-Add-support-for-Nutanix-Acropolis-Hypervisor-AHV-RHB.patch @@ -1,7 +1,7 @@ From 01ea13d9813df93e294b0d9776d4cefd54b1609b Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 4 Oct 2019 16:25:55 +0300 -Subject: [PATCH 19/21] Add support for Nutanix Acropolis Hypervisor (AHV) +Subject: [PATCH 19/22] Add support for Nutanix Acropolis Hypervisor (AHV) (RHBZ#1756381). Thanks: Cristian Seres for providing access to a guest. @@ -401,5 +401,5 @@ index 5a0bdfc..ea5cb77 100644 The guest appears to be running inside an OpenVZ or Virtuozzo -- -2.23.0 +2.32.0 diff --git a/SOURCES/0020-helper-Fix-KVM-signature.patch b/SOURCES/0020-helper-Fix-KVM-signature.patch index 19acbe6..cd35558 100644 --- a/SOURCES/0020-helper-Fix-KVM-signature.patch +++ b/SOURCES/0020-helper-Fix-KVM-signature.patch @@ -1,7 +1,7 @@ From e0443f1fc78f2a79c073dbdf4133bec41c4c0591 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 4 Oct 2019 18:30:01 +0100 -Subject: [PATCH 20/21] helper: Fix KVM signature. +Subject: [PATCH 20/22] helper: Fix KVM signature. Thanks: Paolo Bonzini. --- @@ -34,5 +34,5 @@ index 0cd4a6f..9c6cdb2 100644 strcmp (sig, "Microsoft Hv") == 0 || strcmp (sig, "OpenBSDVMM58") == 0 || -- -2.23.0 +2.32.0 diff --git a/SOURCES/0021-Fix-incorrect-detection-of-MS-Surfacebook-2-as-a-vir.patch b/SOURCES/0021-Fix-incorrect-detection-of-MS-Surfacebook-2-as-a-vir.patch index 5a9474c..49eeedd 100644 --- a/SOURCES/0021-Fix-incorrect-detection-of-MS-Surfacebook-2-as-a-vir.patch +++ b/SOURCES/0021-Fix-incorrect-detection-of-MS-Surfacebook-2-as-a-vir.patch @@ -1,7 +1,7 @@ From 71ef45e9543278e9920e449b71e0da269662ebc9 Mon Sep 17 00:00:00 2001 From: willem van de velde Date: Tue, 22 Oct 2019 11:58:01 +0100 -Subject: [PATCH 21/21] Fix incorrect detection of MS Surfacebook 2 as a +Subject: [PATCH 21/22] Fix incorrect detection of MS Surfacebook 2 as a virtual machine. --- @@ -23,5 +23,5 @@ index 9eafa05..a61ce91 100644 fi -- -2.23.0 +2.32.0 diff --git a/SOURCES/0022-Add-support-for-VMware-ESXi-on-ARM.patch b/SOURCES/0022-Add-support-for-VMware-ESXi-on-ARM.patch new file mode 100644 index 0000000..0e6eef5 --- /dev/null +++ b/SOURCES/0022-Add-support-for-VMware-ESXi-on-ARM.patch @@ -0,0 +1,267 @@ +From 8640dad5eb60eced313359e7ecea19b07d77242f Mon Sep 17 00:00:00 2001 +From: Razvan Corneliu +Date: Mon, 10 May 2021 21:02:27 +0100 +Subject: [PATCH 22/22] Add support for VMware ESXi on ARM + +Virt-what doesn't recognize VMware VMs for AARCH64/ARM (with licensing +implications in ESXi Fling for ARM and Fusion v.Next for ARM). I've +created and attached a patch that adds both support for recognizing +ESXi and the automated tests for it. +--- + configure.ac | 2 + + tests/esx-arm/Makefile.am | 30 ++++++++++ + tests/esx-arm/proc/cpuinfo | 18 ++++++ + .../proc/device-tree/hypervisor/compatible | 1 + + .../esx-arm/proc/device-tree/hypervisor/name | 1 + + tests/esx-arm/proc/self/status | 55 +++++++++++++++++++ + tests/esx-arm/sbin/dmidecode | 2 + + tests/esx-arm/sbin/uname | 2 + + tests/esx-arm/sbin/virt-what-cpuid-helper | 2 + + tests/esx-arm/test.sh | 32 +++++++++++ + virt-what.in | 4 ++ + 11 files changed, 149 insertions(+) + create mode 100644 tests/esx-arm/Makefile.am + create mode 100644 tests/esx-arm/proc/cpuinfo + create mode 100644 tests/esx-arm/proc/device-tree/hypervisor/compatible + create mode 100644 tests/esx-arm/proc/device-tree/hypervisor/name + create mode 100644 tests/esx-arm/proc/self/status + create mode 100755 tests/esx-arm/sbin/dmidecode + create mode 100755 tests/esx-arm/sbin/uname + create mode 100755 tests/esx-arm/sbin/virt-what-cpuid-helper + create mode 100755 tests/esx-arm/test.sh + +diff --git a/configure.ac b/configure.ac +index f246e34..f9b3096 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -41,6 +41,7 @@ tests="\ + baremetal \ + bhyve \ + docker \ ++ esx-arm \ + esx4.1 \ + hyperv \ + kvm \ +@@ -84,6 +85,7 @@ AC_CONFIG_FILES([Makefile + tests/baremetal/Makefile + tests/bhyve/Makefile + tests/docker/Makefile ++ tests/esx-arm/Makefile + tests/esx4.1/Makefile + tests/hyperv/Makefile + tests/kvm/Makefile +diff --git a/tests/esx-arm/Makefile.am b/tests/esx-arm/Makefile.am +new file mode 100644 +index 0000000..b87ec83 +--- /dev/null ++++ b/tests/esx-arm/Makefile.am +@@ -0,0 +1,30 @@ ++# Makefile for virt-what ++# Copyright (C) 2008-2011 Red Hat Inc. ++# ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ ++CLEANFILES = *~ ++ ++TESTS = test.sh ++ ++EXTRA_DIST = \ ++ test.sh \ ++ proc/cpuinfo \ ++ proc/device-tree/hypervisor/compatible \ ++ proc/device-tree/hypervisor/name \ ++ proc/self/status \ ++ sbin/dmidecode \ ++ sbin/uname \ ++ sbin/virt-what-cpuid-helper +diff --git a/tests/esx-arm/proc/cpuinfo b/tests/esx-arm/proc/cpuinfo +new file mode 100644 +index 0000000..246b574 +--- /dev/null ++++ b/tests/esx-arm/proc/cpuinfo +@@ -0,0 +1,18 @@ ++processor : 0 ++BogoMIPS : 108.00 ++Features : fp asimd evtstrm crc32 cpuid ++CPU implementer : 0x41 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0xd08 ++CPU revision : 3 ++ ++processor : 1 ++BogoMIPS : 108.00 ++Features : fp asimd evtstrm crc32 cpuid ++CPU implementer : 0x41 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0xd08 ++CPU revision : 3 ++ +diff --git a/tests/esx-arm/proc/device-tree/hypervisor/compatible b/tests/esx-arm/proc/device-tree/hypervisor/compatible +new file mode 100644 +index 0000000..0554874 +--- /dev/null ++++ b/tests/esx-arm/proc/device-tree/hypervisor/compatible +@@ -0,0 +1 @@ ++vmware +diff --git a/tests/esx-arm/proc/device-tree/hypervisor/name b/tests/esx-arm/proc/device-tree/hypervisor/name +new file mode 100644 +index 0000000..d508e44 +--- /dev/null ++++ b/tests/esx-arm/proc/device-tree/hypervisor/name +@@ -0,0 +1 @@ ++hypervisor +diff --git a/tests/esx-arm/proc/self/status b/tests/esx-arm/proc/self/status +new file mode 100644 +index 0000000..13dd246 +--- /dev/null ++++ b/tests/esx-arm/proc/self/status +@@ -0,0 +1,55 @@ ++Name: cat ++Umask: 0022 ++State: R (running) ++Tgid: 292937 ++Ngid: 0 ++Pid: 292937 ++PPid: 10956 ++TracerPid: 0 ++Uid: 0 0 0 0 ++Gid: 0 0 0 0 ++FDSize: 256 ++Groups: 0 ++NStgid: 292937 ++NSpid: 292937 ++NSpgid: 292937 ++NSsid: 10956 ++VmPeak: 6400 kB ++VmSize: 6400 kB ++VmLck: 0 kB ++VmPin: 0 kB ++VmHWM: 960 kB ++VmRSS: 960 kB ++RssAnon: 448 kB ++RssFile: 512 kB ++RssShmem: 0 kB ++VmData: 640 kB ++VmStk: 192 kB ++VmExe: 64 kB ++VmLib: 1600 kB ++VmPTE: 384 kB ++VmSwap: 0 kB ++HugetlbPages: 0 kB ++CoreDumping: 0 ++THP_enabled: 1 ++Threads: 1 ++SigQ: 2/3947 ++SigPnd: 0000000000000000 ++ShdPnd: 0000000000000000 ++SigBlk: 0000000000000000 ++SigIgn: 0000000000000000 ++SigCgt: 0000000000000000 ++CapInh: 0000000000000000 ++CapPrm: 0000003fffffffff ++CapEff: 0000003fffffffff ++CapBnd: 0000003fffffffff ++CapAmb: 0000000000000000 ++NoNewPrivs: 0 ++Seccomp: 0 ++Speculation_Store_Bypass: vulnerable ++Cpus_allowed: 3 ++Cpus_allowed_list: 0-1 ++Mems_allowed: 01 ++Mems_allowed_list: 0 ++voluntary_ctxt_switches: 1 ++nonvoluntary_ctxt_switches: 0 +diff --git a/tests/esx-arm/sbin/dmidecode b/tests/esx-arm/sbin/dmidecode +new file mode 100755 +index 0000000..e53c12f +--- /dev/null ++++ b/tests/esx-arm/sbin/dmidecode +@@ -0,0 +1,2 @@ ++#!/bin/sh - ++exit 1 +diff --git a/tests/esx-arm/sbin/uname b/tests/esx-arm/sbin/uname +new file mode 100755 +index 0000000..bd33a2d +--- /dev/null ++++ b/tests/esx-arm/sbin/uname +@@ -0,0 +1,2 @@ ++#!/bin/sh - ++echo aarch64 +diff --git a/tests/esx-arm/sbin/virt-what-cpuid-helper b/tests/esx-arm/sbin/virt-what-cpuid-helper +new file mode 100755 +index 0000000..77a6692 +--- /dev/null ++++ b/tests/esx-arm/sbin/virt-what-cpuid-helper +@@ -0,0 +1,2 @@ ++#!/bin/sh - ++# nothing +diff --git a/tests/esx-arm/test.sh b/tests/esx-arm/test.sh +new file mode 100755 +index 0000000..344afef +--- /dev/null ++++ b/tests/esx-arm/test.sh +@@ -0,0 +1,32 @@ ++# Test for ESXi on ARM ++# Copyright (C) 2008-2011 Red Hat Inc. ++# ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ ++output="$(PATH=../..:$PATH virt-what --test-root=. 2>&1)" ++expected="vmware" ++ ++if [ "$output" != "$expected" ]; then ++ echo "$0: test failed because output did not match expected" ++ echo "Expected output was:" ++ echo "----------------------------------------" ++ echo "$expected" ++ echo "----------------------------------------" ++ echo "But the actual output of the program was:" ++ echo "----------------------------------------" ++ echo "$output" ++ echo "----------------------------------------" ++ exit 1 ++fi +diff --git a/virt-what.in b/virt-what.in +index a61ce91..59743c3 100644 +--- a/virt-what.in ++++ b/virt-what.in +@@ -264,6 +264,10 @@ elif [ "$arch" = "arm" ] || [ "$arch" = "aarch64" ]; then + echo xen + skip_qemu_kvm=true + skip_lkvm=true ++ elif [ -d "${root}/proc/device-tree/hypervisor" ] && ++ grep -q "vmware" "${root}/proc/device-tree/hypervisor/compatible"; then ++ echo vmware ++ skip_lkvm=true + fi + elif [ "$arch" = "ia64" ]; then + if [ -d "${root}/sys/bus/xen" -a ! -d "${root}/sys/bus/xen-backend" ]; then +-- +2.32.0 + diff --git a/SPECS/virt-what.spec b/SPECS/virt-what.spec index aee253c..cd0ec5e 100644 --- a/SPECS/virt-what.spec +++ b/SPECS/virt-what.spec @@ -1,6 +1,6 @@ Name: virt-what Version: 1.18 -Release: 9%{?dist} +Release: 12%{?dist} Summary: Detect if we are running in a virtual machine License: GPLv2+ @@ -13,6 +13,8 @@ Source0: http://people.redhat.com/~rjones/virt-what/files/%{name}-%{versi Source1: gitignore # Patches from upstream since 1.18 was released. +# NB: These patches are also stored in this upstream branch: +# http://git.annexia.org/?p=virt-what.git;a=shortlog;h=refs/heads/rhel-8.2 Patch0001: 0001-Missing-have_cpuinfo-check.patch Patch0002: 0002-Remove-bashisms.patch Patch0003: 0003-As-xen-pv-guest-can-access-cpuid-from-Intel-CPUs-sta.patch @@ -38,10 +40,12 @@ Patch0019: 0019-Add-support-for-Nutanix-Acropolis-Hypervisor-AHV-RHB.patch Patch0020: 0020-helper-Fix-KVM-signature.patch # Support for virtualized MS Surfacebook 2. Patch0021: 0021-Fix-incorrect-detection-of-MS-Surfacebook-2-as-a-vir.patch +# Support for VMware on aarch64 (RHBZ#1959154). +Patch0022: 0022-Add-support-for-VMware-ESXi-on-ARM.patch # Fix crash on non-KVM platforms through incorrect use of CPUID in # patch 0018 (https://bugzilla.redhat.com/show_bug.cgi?id=1756381#c15). -Patch0022: 0001-Simplify-and-fix-invocation-of-cpuid.patch +Patch0023: 0001-Simplify-and-fix-invocation-of-cpuid.patch # Patches touch Makefile.am: BuildRequires: autoconf, automake @@ -154,6 +158,18 @@ fi %changelog +* Fri Jun 18 2021 Richard W.M. Jones - 1.18-12 +- Support for VMware on aarch64 + resolves: rhbz#1959154 + +* Wed Jun 02 2021 Richard W.M. Jones - 1.18-11 +- Add gating tests + resolves: rhbz#1967094 + +* Wed Apr 28 2021 Richard W.M. Jones - 1.18-10 +- Rebuild for fixed binutils on aarch64 + resolves: rhbz#1954455 + * Tue Apr 13 2021 Richard W.M. Jones - 1.18-9 - Fix crash on non-KVM platforms through incorrect use of CPUID related: rhbz#1756381