Hi there,

I used this[0] script to test the different series. The most relevant
parts of it are those parameters for qemu:

-smbios type=0,vendor='Hyper-V test',version=1.2.3 \
-smbios 
type=1,manufacturer=t1manufacturer,product=t1product,version=t1version,serial=t1serial,uuid=11111111-1111-1111-1111-111111111111,sku=t1sku,family=t1family
 \

You can read more about them here[1]. In short, it configures the DMI
table as follows:

ubuntu@impish:~$ cat /sys/class/dmi/id/product_name
t1product
ubuntu@impish:~$ cat /sys/class/dmi/id/sys_vendor
t1manufacturer
ubuntu@impish:~$ cat /sys/class/dmi/id/bios_vendor
Hyper-V test
ubuntu@impish:~$ cat /sys/class/dmi/id/product_version
t1version

Thus, the old systemd should not detect any virt ("none") and the new
one should detect "microsoft"[2].

Test results:

Bionic
======

ubuntu@bionic:~$ dpkg -l systemd ; systemd-detect-virt
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                                   Version              
            Architecture                     Description
+++-======================================================-================================-================================-=================================================================================================================
ii  systemd                                                237-3ubuntu10.52     
            arm64                            system and service manager
none
ubuntu@bionic:~$ sudo apt-get install -y systemd
...
ubuntu@bionic:~$ dpkg -l systemd ; systemd-detect-virt
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                                   Version              
            Architecture                     Description
+++-======================================================-================================-================================-=================================================================================================================
ii  systemd                                                237-3ubuntu10.53     
            arm64                            system and service manager
microsoft

Focal
=====

ubuntu@focal:~$ dpkg -l systemd ; systemd-detect-virt
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version           Architecture Description
+++-==============-=================-============-=================================
ii  systemd        245.4-4ubuntu3.13 arm64        system and service manager
none
ubuntu@focal:~$ sudo apt-get install -y systemd
...
ubuntu@focal:~$ dpkg -l systemd ; systemd-detect-virt
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version           Architecture Description
+++-==============-=================-============-=================================
ii  systemd        245.4-4ubuntu3.14 arm64        system and service manager
microsoft

Impish
======

ubuntu@impish:~$ dpkg -l systemd ; systemd-detect-virt
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version        Architecture Description
+++-==============-==============-============-=================================
ii  systemd        248.3-1ubuntu8 arm64        system and service manager
none
ubuntu@impish:~$ sudo apt-get install -y systemd
...
ubuntu@impish:~$ dpkg -l systemd ; systemd-detect-virt
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version          Architecture Description
+++-==============-================-============-=================================
ii  systemd        248.3-1ubuntu8.1 arm64        system and service manager
microsoft


[0] https://pastebin.canonical.com/p/WCqqyCK7Qj/
[1] https://gist.github.com/smoser/290f74c256c89cb3f3bd434a27b9f64c
[2] https://github.com/systemd/systemd/blob/main/src/basic/virt.c#L144-L193

** Tags removed: verification-needed-bionic verification-needed-focal 
verification-needed-impish
** Tags added: verification-done-bionic verification-done-focal 
verification-done-impish

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/1952599

Title:
  virt: Support detection for ARM64 Hyper-V guests (fixed upstream)

Status in systemd package in Ubuntu:
  Fix Released
Status in systemd source package in Bionic:
  Fix Committed
Status in systemd source package in Focal:
  Fix Committed
Status in systemd source package in Hirsute:
  New
Status in systemd source package in Impish:
  Fix Committed
Status in systemd source package in Jammy:
  Fix Released

Bug description:
  [Impact]

   * The detection of Microsoft Hyper-V VMs is done by cpuid currently,
  however there is no cpuid on ARM64. And since ARM64 is now a supported
  architecture for Microsoft Hyper-V guests[0], then introduce a more
  generic way to detect whether a guest is running as a Hyper-V guest: check 
  if /sys/class/dmi/id/product_version starts with "Hyper-V".

   * This bug has already been fixed upstream[1][2]

  [Test Plan]

   * While changes have been made in the kernel for ARM64 on Hyper-V,
  there is no way to start an ARM64 VM on Hyper-V at the moment. Thus we
  just want to make sure no regression is introduced.

   * start an Hyper-V amd64 VM and make sure "systemd-detect-virt" still
  return MSFT (should still rely on cpuid here)

  [Where problems could occur]

   * The main risk is for the system to detect Hyper-V virt erroneously.
  An issue was reported upstream after the first commit was merged[3].
  For this reason, systemd is now looking for "Hyper-V" (in
  /sys/class/dmi/id/product_version) and not "Microsoft" (in
  /sys/class/dmi/id/bios_vendor)

   * This change might also break virt detection on hyper-v AMD64.
  That's why we need testing. However, AMD64 virt detection should still
  rely on cpuid instead of DMI as cpuid takes priority over DMI.

  [0] 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7aff79e297ee1aa0126924921fd87a4ae59d2467
  [1] https://github.com/systemd/systemd/pull/20998/files
  [2] https://github.com/systemd/systemd/pull/21475/files
  [3] https://github.com/systemd/systemd/issues/21468

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1952599/+subscriptions


-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to