Skip to contentSkip to conversation

tests: Prefer max cpu type when using AArch64 virt machine

PATCH In review Andrew Jones 4 participants 5 messages Jun 3, 2022

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 tests: Prefer max cpu type when using AArch64 virt machine

The max cpu type is the best default cpu type for tests to use when specifying the cpu type for AArch64 mach-virt. Switch all tests to it.

---
 tests/avocado/boot_xen.py          |  6 +++---
 tests/avocado/replay_kernel.py     |  2 +-
 tests/avocado/reverse_debugging.py |  2 +-
 tests/avocado/tcg_plugins.py       |  6 +++---
 tests/qtest/bios-tables-test.c     | 12 ++++++------
 tests/qtest/machine-none-test.c    |  4 ++--
 tests/vm/aarch64vm.py              |  2 +-
 tests/vm/ubuntu.aarch64            |  2 +-
 8 files changed, 18 insertions(+), 18 deletions(-)
tests/avocado/boot_xen.py +3 -3
index fc2faeedb559..899c396bd55c 100644
@@ -66,7 +66,7 @@ def test_arm64_xen_411_and_dom0(self):
         """
         :avocado: tags=arch:aarch64
         :avocado: tags=accel:tcg
-        :avocado: tags=cpu:cortex-a57
+        :avocado: tags=cpu:max
         :avocado: tags=machine:virt
         """
 
@@ -84,7 +84,7 @@ def test_arm64_xen_414_and_dom0(self):
         """
         :avocado: tags=arch:aarch64
         :avocado: tags=accel:tcg
-        :avocado: tags=cpu:cortex-a57
+        :avocado: tags=cpu:max
         :avocado: tags=machine:virt
         """
 
@@ -102,7 +102,7 @@ def test_arm64_xen_415_and_dom0(self):
         """
         :avocado: tags=arch:aarch64
         :avocado: tags=accel:tcg
-        :avocado: tags=cpu:cortex-a57
+        :avocado: tags=cpu:max
         :avocado: tags=machine:virt
         """
 
tests/avocado/replay_kernel.py +1 -1
index 0b2b0dc692b1..c19022ea977d 100644
@@ -147,7 +147,7 @@ def test_aarch64_virt(self):
         """
         :avocado: tags=arch:aarch64
         :avocado: tags=machine:virt
-        :avocado: tags=cpu:cortex-a53
+        :avocado: tags=cpu:max
         """
         kernel_url = ('https://archives.fedoraproject.org/pub/archive/fedora'
                       '/linux/releases/29/Everything/aarch64/os/images/pxeboot'
tests/avocado/reverse_debugging.py +1 -1
index d2921e70c3b4..d6a6d7277235 100644
@@ -198,7 +198,7 @@ def test_aarch64_virt(self):
         """
         :avocado: tags=arch:aarch64
         :avocado: tags=machine:virt
-        :avocado: tags=cpu:cortex-a53
+        :avocado: tags=cpu:max
         """
         kernel_url = ('https://archives.fedoraproject.org/pub/archive/fedora'
                       '/linux/releases/29/Everything/aarch64/os/images/pxeboot'
tests/avocado/tcg_plugins.py +3 -3
index 642d2e49e305..2bbf62f5036e 100644
@@ -68,7 +68,7 @@ def test_aarch64_virt_insn(self):
         :avocado: tags=accel:tcg
         :avocado: tags=arch:aarch64
         :avocado: tags=machine:virt
-        :avocado: tags=cpu:cortex-a53
+        :avocado: tags=cpu:max
         """
         kernel_path = self._grab_aarch64_kernel()
         kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
@@ -94,7 +94,7 @@ def test_aarch64_virt_insn_icount(self):
         :avocado: tags=accel:tcg
         :avocado: tags=arch:aarch64
         :avocado: tags=machine:virt
-        :avocado: tags=cpu:cortex-a53
+        :avocado: tags=cpu:max
         """
         kernel_path = self._grab_aarch64_kernel()
         kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
@@ -120,7 +120,7 @@ def test_aarch64_virt_mem_icount(self):
         :avocado: tags=accel:tcg
         :avocado: tags=arch:aarch64
         :avocado: tags=machine:virt
-        :avocado: tags=cpu:cortex-a53
+        :avocado: tags=cpu:max
         """
         kernel_path = self._grab_aarch64_kernel()
         kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
tests/qtest/bios-tables-test.c +6 -6
index a4a46e97f0b8..7c3a58a97460 100644
@@ -1270,7 +1270,7 @@ static void test_acpi_virt_tcg_memhp(void)
 
     data.variant = ".memhp";
     test_acpi_one(" -machine nvdimm=on"
-                  " -cpu cortex-a57"
+                  " -cpu max"
                   " -m 256M,slots=3,maxmem=1G"
                   " -object memory-backend-ram,id=ram0,size=128M"
                   " -object memory-backend-ram,id=ram1,size=128M"
@@ -1363,7 +1363,7 @@ static void test_acpi_virt_tcg_numamem(void)
     };
 
     data.variant = ".numamem";
-    test_acpi_one(" -cpu cortex-a57"
+    test_acpi_one(" -cpu max"
                   " -object memory-backend-ram,id=ram0,size=128M"
                   " -numa node,memdev=ram0",
                   &data);
@@ -1397,7 +1397,7 @@ static void test_acpi_virt_tcg_pxb(void)
                   "if=none,media=cdrom,id=drive-scsi0-0-0-1,readonly=on"
                   " -device scsi-cd,bus=scsi0.0,scsi-id=0,"
                   "drive=drive-scsi0-0-0-1,id=scsi0-0-0-1,bootindex=1"
-                  " -cpu cortex-a57"
+                  " -cpu max"
                   " -device pxb-pcie,bus_nr=128",
                   &data);
 
@@ -1511,7 +1511,7 @@ static void test_acpi_virt_tcg(void)
 
     data.smbios_cpu_max_speed = 2900;
     data.smbios_cpu_curr_speed = 2700;
-    test_acpi_one("-cpu cortex-a57 "
+    test_acpi_one("-cpu max "
                   "-smbios type=4,max-speed=2900,current-speed=2700", &data);
     free_test_data(&data);
 }
@@ -1591,7 +1591,7 @@ static void test_acpi_virt_viot(void)
         .scan_len = 128ULL * 1024 * 1024,
     };
 
-    test_acpi_one("-cpu cortex-a57 "
+    test_acpi_one("-cpu max "
                   "-device virtio-iommu-pci", &data);
     free_test_data(&data);
 }
@@ -1699,7 +1699,7 @@ static void test_acpi_oem_fields_virt(void)
     char *args;
 
     args = test_acpi_create_args(&data,
-                                 "-cpu cortex-a57 "OEM_TEST_ARGS, true);
+                                 "-cpu max "OEM_TEST_ARGS, true);
     data.qts = qtest_init(args);
     test_acpi_load_tables(&data, true);
     test_oem_fields(&data);
tests/qtest/machine-none-test.c +2 -2
index d0f8cd990245..d47533a835b7 100644
@@ -24,8 +24,8 @@ struct arch2cpu {
 
 static struct arch2cpu cpus_map[] = {
     /* tested targets list */
-    { "arm", "cortex-a15" },
-    { "aarch64", "cortex-a57" },
+    { "arm", "max" },
+    { "aarch64", "max" },
     { "avr", "avr6-avr-cpu" },
     { "x86_64", "qemu64,apic-id=0" },
     { "i386", "qemu32,apic-id=0" },
tests/vm/aarch64vm.py +1 -1
index b00cce07eb81..a82b4dd7a91a 100644
@@ -31,7 +31,7 @@
 # parameters that works for backwards compatibility.
 DEFAULT_CONFIG = {'kvm' : {'cpu'          : "host",
                            'machine'      : "virt,gic-version=host"},
-                  'tcg' : {'cpu'          : "cortex-a57",
+                  'tcg' : {'cpu'          : "max",
                            'machine'      : "virt"},
 }
 
tests/vm/ubuntu.aarch64 +1 -1
index b291945a7e9d..e2958ccd2a44 100755
@@ -18,7 +18,7 @@ import aarch64vm
 import ubuntuvm
 
 DEFAULT_CONFIG = {
-    'cpu'          : "cortex-a57",
+    'cpu'          : "max",
     'machine'      : "virt,gic-version=3",
     'install_cmds' : "apt-get update,"\
                      "apt-get build-dep -y --arch-only qemu,"\
Signature · 1 line
2.34.3
Reviewed-by on v2 1/1
#1 lore raw
Quoted 6 lines · Andrew Jones

The max cpu type is the best default cpu type for tests to use when specifying the cpu type for AArch64 mach-virt. Switch all tests to it.

Quoted 10 lines
---
 tests/avocado/boot_xen.py          |  6 +++---
 tests/avocado/replay_kernel.py     |  2 +-
 tests/avocado/reverse_debugging.py |  2 +-
 tests/avocado/tcg_plugins.py       |  6 +++---
 tests/qtest/bios-tables-test.c     | 12 ++++++------
 tests/qtest/machine-none-test.c    |  4 ++--
 tests/vm/aarch64vm.py              |  2 +-
 tests/vm/ubuntu.aarch64            |  2 +-
 8 files changed, 18 insertions(+), 18 deletions(-)
Reviewed-by on v2 1/1
#2 lore raw
In reply to Andrew Jones
Quoted 6 lines · Andrew Jones

The max cpu type is the best default cpu type for tests to use when specifying the cpu type for AArch64 mach-virt. Switch all tests to it.

Quoted 11 lines
---
  tests/avocado/boot_xen.py          |  6 +++---
  tests/avocado/replay_kernel.py     |  2 +-
  tests/avocado/reverse_debugging.py |  2 +-
  tests/avocado/tcg_plugins.py       |  6 +++---
  tests/qtest/bios-tables-test.c     | 12 ++++++------
  tests/qtest/machine-none-test.c    |  4 ++--
  tests/vm/aarch64vm.py              |  2 +-
  tests/vm/ubuntu.aarch64            |  2 +-
  8 files changed, 18 insertions(+), 18 deletions(-)
Quoted 188 lines
tests/avocado/boot_xen.py +3 -3
index fc2faeedb559..899c396bd55c 100644
@@ -66,7 +66,7 @@ def test_arm64_xen_411_and_dom0(self):
          """
          :avocado: tags=arch:aarch64
          :avocado: tags=accel:tcg
-        :avocado: tags=cpu:cortex-a57
+        :avocado: tags=cpu:max
          :avocado: tags=machine:virt
          """
 
@@ -84,7 +84,7 @@ def test_arm64_xen_414_and_dom0(self):
          """
          :avocado: tags=arch:aarch64
          :avocado: tags=accel:tcg
-        :avocado: tags=cpu:cortex-a57
+        :avocado: tags=cpu:max
          :avocado: tags=machine:virt
          """
 
@@ -102,7 +102,7 @@ def test_arm64_xen_415_and_dom0(self):
          """
          :avocado: tags=arch:aarch64
          :avocado: tags=accel:tcg
-        :avocado: tags=cpu:cortex-a57
+        :avocado: tags=cpu:max
          :avocado: tags=machine:virt
          """
 
tests/avocado/replay_kernel.py +1 -1
index 0b2b0dc692b1..c19022ea977d 100644
@@ -147,7 +147,7 @@ def test_aarch64_virt(self):
          """
          :avocado: tags=arch:aarch64
          :avocado: tags=machine:virt
-        :avocado: tags=cpu:cortex-a53
+        :avocado: tags=cpu:max
          """
          kernel_url = ('https://archives.fedoraproject.org/pub/archive/fedora'
                        '/linux/releases/29/Everything/aarch64/os/images/pxeboot'
tests/avocado/reverse_debugging.py +1 -1
index d2921e70c3b4..d6a6d7277235 100644
@@ -198,7 +198,7 @@ def test_aarch64_virt(self):
          """
          :avocado: tags=arch:aarch64
          :avocado: tags=machine:virt
-        :avocado: tags=cpu:cortex-a53
+        :avocado: tags=cpu:max
          """
          kernel_url = ('https://archives.fedoraproject.org/pub/archive/fedora'
                        '/linux/releases/29/Everything/aarch64/os/images/pxeboot'
tests/avocado/tcg_plugins.py +3 -3
index 642d2e49e305..2bbf62f5036e 100644
@@ -68,7 +68,7 @@ def test_aarch64_virt_insn(self):
          :avocado: tags=accel:tcg
          :avocado: tags=arch:aarch64
          :avocado: tags=machine:virt
-        :avocado: tags=cpu:cortex-a53
+        :avocado: tags=cpu:max
          """
          kernel_path = self._grab_aarch64_kernel()
          kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
@@ -94,7 +94,7 @@ def test_aarch64_virt_insn_icount(self):
          :avocado: tags=accel:tcg
          :avocado: tags=arch:aarch64
          :avocado: tags=machine:virt
-        :avocado: tags=cpu:cortex-a53
+        :avocado: tags=cpu:max
          """
          kernel_path = self._grab_aarch64_kernel()
          kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
@@ -120,7 +120,7 @@ def test_aarch64_virt_mem_icount(self):
          :avocado: tags=accel:tcg
          :avocado: tags=arch:aarch64
          :avocado: tags=machine:virt
-        :avocado: tags=cpu:cortex-a53
+        :avocado: tags=cpu:max
          """
          kernel_path = self._grab_aarch64_kernel()
          kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
tests/qtest/bios-tables-test.c +6 -6
index a4a46e97f0b8..7c3a58a97460 100644
@@ -1270,7 +1270,7 @@ static void test_acpi_virt_tcg_memhp(void)
 
      data.variant = ".memhp";
      test_acpi_one(" -machine nvdimm=on"
-                  " -cpu cortex-a57"
+                  " -cpu max"
                    " -m 256M,slots=3,maxmem=1G"
                    " -object memory-backend-ram,id=ram0,size=128M"
                    " -object memory-backend-ram,id=ram1,size=128M"
@@ -1363,7 +1363,7 @@ static void test_acpi_virt_tcg_numamem(void)
      };
 
      data.variant = ".numamem";
-    test_acpi_one(" -cpu cortex-a57"
+    test_acpi_one(" -cpu max"
                    " -object memory-backend-ram,id=ram0,size=128M"
                    " -numa node,memdev=ram0",
                    &data);
@@ -1397,7 +1397,7 @@ static void test_acpi_virt_tcg_pxb(void)
                    "if=none,media=cdrom,id=drive-scsi0-0-0-1,readonly=on"
                    " -device scsi-cd,bus=scsi0.0,scsi-id=0,"
                    "drive=drive-scsi0-0-0-1,id=scsi0-0-0-1,bootindex=1"
-                  " -cpu cortex-a57"
+                  " -cpu max"
                    " -device pxb-pcie,bus_nr=128",
                    &data);
 
@@ -1511,7 +1511,7 @@ static void test_acpi_virt_tcg(void)
 
      data.smbios_cpu_max_speed = 2900;
      data.smbios_cpu_curr_speed = 2700;
-    test_acpi_one("-cpu cortex-a57 "
+    test_acpi_one("-cpu max "
                    "-smbios type=4,max-speed=2900,current-speed=2700", &data);
      free_test_data(&data);
  }
@@ -1591,7 +1591,7 @@ static void test_acpi_virt_viot(void)
          .scan_len = 128ULL * 1024 * 1024,
      };
 
-    test_acpi_one("-cpu cortex-a57 "
+    test_acpi_one("-cpu max "
                    "-device virtio-iommu-pci", &data);
      free_test_data(&data);
  }
@@ -1699,7 +1699,7 @@ static void test_acpi_oem_fields_virt(void)
      char *args;
 
      args = test_acpi_create_args(&data,
-                                 "-cpu cortex-a57 "OEM_TEST_ARGS, true);
+                                 "-cpu max "OEM_TEST_ARGS, true);
      data.qts = qtest_init(args);
      test_acpi_load_tables(&data, true);
      test_oem_fields(&data);
tests/qtest/machine-none-test.c +2 -2
index d0f8cd990245..d47533a835b7 100644
@@ -24,8 +24,8 @@ struct arch2cpu {
 
  static struct arch2cpu cpus_map[] = {
      /* tested targets list */
-    { "arm", "cortex-a15" },
-    { "aarch64", "cortex-a57" },
+    { "arm", "max" },
+    { "aarch64", "max" },
      { "avr", "avr6-avr-cpu" },
      { "x86_64", "qemu64,apic-id=0" },
      { "i386", "qemu32,apic-id=0" },
tests/vm/aarch64vm.py +1 -1
index b00cce07eb81..a82b4dd7a91a 100644
@@ -31,7 +31,7 @@
  # parameters that works for backwards compatibility.
  DEFAULT_CONFIG = {'kvm' : {'cpu'          : "host",
                             'machine'      : "virt,gic-version=host"},
-                  'tcg' : {'cpu'          : "cortex-a57",
+                  'tcg' : {'cpu'          : "max",
                             'machine'      : "virt"},
  }
 
tests/vm/ubuntu.aarch64 +1 -1
index b291945a7e9d..e2958ccd2a44 100755
@@ -18,7 +18,7 @@ import aarch64vm
  import ubuntuvm
 
  DEFAULT_CONFIG = {
-    'cpu'          : "cortex-a57",
+    'cpu'          : "max",
      'machine'      : "virt,gic-version=3",
      'install_cmds' : "apt-get update,"\
                       "apt-get build-dep -y --arch-only qemu,"\
#3 lore raw
In reply to Andrew Jones
Quoted 6 lines · Andrew Jones

The max cpu type is the best default cpu type for tests to use when specifying the cpu type for AArch64 mach-virt. Switch all tests to it.

For avoidance of doubt, copying v1 comment to v2:

tests/avocado/replay_kernel.py def test_aarch64_virt(self): · line 153

Quoted 13 lines
tests/avocado/replay_kernel.py +1 -1
index 0b2b0dc692b1..c19022ea977d 100644
@@ -147,7 +147,7 @@ def test_aarch64_virt(self):
          """
          :avocado: tags=arch:aarch64
          :avocado: tags=machine:virt
-        :avocado: tags=cpu:cortex-a53
+        :avocado: tags=cpu:max
          """
          kernel_url = ('https://archives.fedoraproject.org/pub/archive/fedora'
                        '/linux/releases/29/Everything/aarch64/os/images/pxeboot'

This will *not* work without further changes. Fedora 29 will is old, and will not boot a cpu with FEAT_LPA2 enabled.

See 11593544df6f ("tests/avocado: update aarch64_virt test to exercise -cpu max")

Which makes me wonder if you've actually tested this?

r~

#4 lore raw
Quoted 27 lines · Richard Henderson
Quoted 6 lines · Andrew Jones

The max cpu type is the best default cpu type for tests to use when specifying the cpu type for AArch64 mach-virt. Switch all tests to it.

For avoidance of doubt, copying v1 comment to v2:

tests/avocado/replay_kernel.py def test_aarch64_virt(self): · line 153

Quoted 13 lines
tests/avocado/replay_kernel.py +1 -1
index 0b2b0dc692b1..c19022ea977d 100644
@@ -147,7 +147,7 @@ def test_aarch64_virt(self):
          """
          :avocado: tags=arch:aarch64
          :avocado: tags=machine:virt
-        :avocado: tags=cpu:cortex-a53
+        :avocado: tags=cpu:max
          """
          kernel_url = ('https://archives.fedoraproject.org/pub/archive/fedora'
                        '/linux/releases/29/Everything/aarch64/os/images/pxeboot'

This will *not* work without further changes. Fedora 29 will is old, and will not boot a cpu with FEAT_LPA2 enabled.

Quoted 3 lines

See 11593544df6f ("tests/avocado: update aarch64_virt test to exercise -cpu max")

Which makes me wonder if you've actually tested this?

I only did 'make check'. I'll also do 'make check-avocado' for v3.

Thanks,
drew