Bug 2165285

Summary: virt-what fails to detect kvm for aarch64 on Alibaba Cloud
Product: Red Hat Enterprise Linux 9 Reporter: YongkuiGuo <yoguo>
Component: virt-whatAssignee: Richard W.M. Jones <rjones>
Status: CLOSED ERRATA QA Contact: YongkuiGuo <yoguo>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 9.2CC: qzhang, rjones, virt-maint, ymao, yoguo
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: aarch64   
OS: Linux   
Whiteboard:
Fixed In Version: virt-what-1.25-3.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2165518 (view as bug list) Environment:
Last Closed: 2023-05-09 08:24:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2165518    

Description YongkuiGuo 2023-01-29 04:39:34 UTC
Description of problem:
virt-what cannot detect kvm for aarch64 on Alibaba Cloud.


Version-Release number of selected component (if applicable):
virt-what-1.25-2.el9.aarch64


How reproducible:
100%


Steps:

1. Create a g6r.large instance with rhel9.0 arm image on Alibaba Cloud
2. Upgrade the latest virt-what package and run virt-what
[root@iZ2ze46i66z31ag56sdo5qZ ~]# rpm -q virt-what
virt-what-1.25-2.el9.aarch64
[root@iZ2ze46i66z31ag56sdo5qZ ~]# virt-what
alibaba_cloud
3. 
[root@iZ2ze46i66z31ag56sdo5qZ ~]# dmidecode
# dmidecode 3.3
Getting SMBIOS data from sysfs.
SMBIOS 3.0.0 present.
Table at 0x2348C0000.

Handle 0x0100, DMI type 1, 27 bytes
System Information
	Manufacturer: Alibaba Cloud
	Product Name: Alibaba Cloud ECS
	Version: virt-rhel7.6.0
	Serial Number: 8c43355a-242e-42c2-bdf7-9fae99316221
	UUID: 8c43355a-242e-42c2-bdf7-9fae99316221
	Wake-up Type: Power Switch
	SKU Number: Not Specified
	Family: Red Hat Enterprise Linux

Handle 0x0300, DMI type 3, 21 bytes
Chassis Information
	Manufacturer: Alibaba Cloud
	Type: Other
	Lock: Not Present
	Version: virt-rhel7.6.0
	Serial Number: Not Specified
	Asset Tag: Not Specified
	Boot-up State: Safe
	Power Supply State: Safe
	Thermal State: Safe
	Security Status: Unknown
	OEM Information: 0x00000000
	Height: Unspecified
	Number Of Power Cords: Unspecified
	Contained Elements: 0

Handle 0x0400, DMI type 4, 42 bytes
Processor Information
	Socket Designation: CPU 0
	Type: Central Processor
	Family: Other
	Manufacturer: Alibaba Cloud
	ID: 00 00 00 00 00 00 00 00
	Version: virt-rhel7.6.0
	Voltage: Unknown
	External Clock: Unknown
	Max Speed: 2000 MHz
	Current Speed: 2000 MHz
	Status: Populated, Enabled
	Upgrade: Other
	L1 Cache Handle: Not Provided
	L2 Cache Handle: Not Provided
	L3 Cache Handle: Not Provided
	Serial Number: Not Specified
	Asset Tag: Not Specified
	Part Number: Not Specified
	Core Count: 2
	Core Enabled: 2
	Thread Count: 1
	Characteristics: None

Handle 0x1000, DMI type 16, 23 bytes
Physical Memory Array
	Location: Other
	Use: System Memory
	Error Correction Type: Multi-bit ECC
	Maximum Capacity: 8 GB
	Error Information Handle: Not Provided
	Number Of Devices: 1

Handle 0x1100, DMI type 17, 40 bytes
Memory Device
	Array Handle: 0x1000
	Error Information Handle: Not Provided
	Total Width: Unknown
	Data Width: Unknown
	Size: 8 GB
	Form Factor: DIMM
	Set: None
	Locator: DIMM 0
	Bank Locator: Not Specified
	Type: RAM
	Type Detail: Other
	Speed: Unknown
	Manufacturer: Alibaba Cloud
	Serial Number: Not Specified
	Asset Tag: Not Specified
	Part Number: Not Specified
	Rank: Unknown
	Configured Memory Speed: Unknown
	Minimum Voltage: Unknown
	Maximum Voltage: Unknown
	Configured Voltage: Unknown

Handle 0x2000, DMI type 32, 11 bytes
System Boot Information
	Status: No errors detected

Handle 0x0000, DMI type 0, 26 bytes
BIOS Information
	Vendor: EFI Development Kit II / OVMF
	Version: 0.0.0
	Release Date: 02/06/2015
	Address: 0xE8000
	Runtime Size: 96 kB
	ROM Size: 64 kB
	Characteristics:
		BIOS characteristics not supported
		Targeted content distribution is supported
		UEFI is supported
		System is a virtual machine
	BIOS Revision: 0.0

Handle 0xFEFF, DMI type 127, 4 bytes
End Of Table



Actual results:
As above

Expected results:
[root@iZ2ze46i66z31ag56sdo5qZ ~]# virt-what
alibaba_cloud
kvm

Additional info:
After applying the below changes, virt-what works as expected. It's similar to the previous upstream commit(39001e7c458d798225814c04e920583fa7e2a41c) for the AWS arm instance.

diff --git a/virt-what.in b/virt-what.in
index 1a1101d..01e9aca 100644
--- a/virt-what.in
+++ b/virt-what.in
@@ -354,6 +354,11 @@ if ! "$skip_qemu_kvm"; then
         # This is for AWS Graviton (Arm) systems which don't have CPUID.
         echo kvm
         skip_lkvm=true
+    elif echo "$dmi" | grep -q 'Manufacturer: Alibaba Cloud' &&
+        echo "$dmi" | grep -q 'System is a virtual machine'; then
+        # This is for Alibaba Arm systems which don't have CPUID.
+        echo kvm
+        skip_lkvm=true
     elif echo "$dmi" | grep -q 'Manufacturer: QEMU'; then
         # The test for KVM above failed, so now we know we're
         # not using KVM acceleration.

Comment 1 Richard W.M. Jones 2023-01-30 10:34:41 UTC
Upstream fix (same as proposed, but includes tests):

http://git.annexia.org/?p=virt-what.git;a=commitdiff;h=805604762468b754ea60e5dc176fa26f68d211b8

Comment 2 YongkuiGuo 2023-01-31 10:18:42 UTC
Tested with the following package:
virt-what-1.25-3.el9.aarch64


Steps:

1. Inside aarch64 instance on Alibaba Cloud
[root@iZ2ze46i66z31ag56sdo5qZ ~]# rpm -q virt-what
virt-what-1.25-3.el9.aarch64
[root@iZ2ze46i66z31ag56sdo5qZ ~]# virt-what
alibaba_cloud
kvm

The output of virt-what is as expected.

Comment 6 YongkuiGuo 2023-02-16 06:08:48 UTC
Set the status to VERIFIED per comment 2.

Comment 8 errata-xmlrpc 2023-05-09 08:24:47 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (virt-what bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:2557