2024-08-30 16:38:15 +03:00
|
|
|
#!/usr/bin/env python3
|
2019-06-28 03:28:39 +03:00
|
|
|
#
|
|
|
|
# Basic validation of x86 versioned CPU models and CPU model aliases
|
|
|
|
#
|
|
|
|
# Copyright (c) 2019 Red Hat Inc
|
|
|
|
#
|
|
|
|
# Author:
|
|
|
|
# Eduardo Habkost <ehabkost@redhat.com>
|
|
|
|
#
|
|
|
|
# This library is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU Lesser General Public
|
|
|
|
# License as published by the Free Software Foundation; either
|
2020-11-10 21:42:22 +03:00
|
|
|
# version 2.1 of the License, or (at your option) any later version.
|
2019-06-28 03:28:39 +03:00
|
|
|
#
|
|
|
|
# This library 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
|
|
|
|
# Lesser General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU Lesser General Public
|
|
|
|
# License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
|
|
|
#
|
|
|
|
|
|
|
|
import re
|
|
|
|
|
2024-08-30 16:38:15 +03:00
|
|
|
from qemu_test import QemuSystemTest
|
|
|
|
|
|
|
|
class X86CPUModelAliases(QemuSystemTest):
|
2019-06-28 03:28:39 +03:00
|
|
|
"""
|
|
|
|
Validation of PC CPU model versions and CPU model aliases
|
|
|
|
"""
|
|
|
|
def validate_aliases(self, cpus):
|
|
|
|
for c in cpus.values():
|
|
|
|
if 'alias-of' in c:
|
|
|
|
# all aliases must point to a valid CPU model name:
|
|
|
|
self.assertIn(c['alias-of'], cpus,
|
|
|
|
'%s.alias-of (%s) is not a valid CPU model name' % (c['name'], c['alias-of']))
|
|
|
|
# aliases must not point to aliases
|
|
|
|
self.assertNotIn('alias-of', cpus[c['alias-of']],
|
|
|
|
'%s.alias-of (%s) points to another alias' % (c['name'], c['alias-of']))
|
|
|
|
|
|
|
|
# aliases must not be static
|
|
|
|
self.assertFalse(c['static'])
|
|
|
|
|
|
|
|
def validate_variant_aliases(self, cpus):
|
|
|
|
# -noTSX, -IBRS and -IBPB variants of CPU models are special:
|
|
|
|
# they shouldn't have their own versions:
|
|
|
|
self.assertNotIn("Haswell-noTSX-v1", cpus,
|
|
|
|
"Haswell-noTSX shouldn't be versioned")
|
|
|
|
self.assertNotIn("Broadwell-noTSX-v1", cpus,
|
|
|
|
"Broadwell-noTSX shouldn't be versioned")
|
|
|
|
self.assertNotIn("Nehalem-IBRS-v1", cpus,
|
|
|
|
"Nehalem-IBRS shouldn't be versioned")
|
|
|
|
self.assertNotIn("Westmere-IBRS-v1", cpus,
|
|
|
|
"Westmere-IBRS shouldn't be versioned")
|
|
|
|
self.assertNotIn("SandyBridge-IBRS-v1", cpus,
|
|
|
|
"SandyBridge-IBRS shouldn't be versioned")
|
|
|
|
self.assertNotIn("IvyBridge-IBRS-v1", cpus,
|
|
|
|
"IvyBridge-IBRS shouldn't be versioned")
|
|
|
|
self.assertNotIn("Haswell-noTSX-IBRS-v1", cpus,
|
|
|
|
"Haswell-noTSX-IBRS shouldn't be versioned")
|
|
|
|
self.assertNotIn("Haswell-IBRS-v1", cpus,
|
|
|
|
"Haswell-IBRS shouldn't be versioned")
|
|
|
|
self.assertNotIn("Broadwell-noTSX-IBRS-v1", cpus,
|
|
|
|
"Broadwell-noTSX-IBRS shouldn't be versioned")
|
|
|
|
self.assertNotIn("Broadwell-IBRS-v1", cpus,
|
|
|
|
"Broadwell-IBRS shouldn't be versioned")
|
|
|
|
self.assertNotIn("Skylake-Client-IBRS-v1", cpus,
|
|
|
|
"Skylake-Client-IBRS shouldn't be versioned")
|
|
|
|
self.assertNotIn("Skylake-Server-IBRS-v1", cpus,
|
|
|
|
"Skylake-Server-IBRS shouldn't be versioned")
|
|
|
|
self.assertNotIn("EPYC-IBPB-v1", cpus,
|
|
|
|
"EPYC-IBPB shouldn't be versioned")
|
|
|
|
|
|
|
|
def test_4_0_alias_compatibility(self):
|
2019-11-04 18:13:18 +03:00
|
|
|
"""
|
|
|
|
Check if pc-*-4.0 unversioned CPU model won't be reported as aliases
|
|
|
|
"""
|
2024-08-30 16:38:15 +03:00
|
|
|
self.set_machine('pc-i440fx-4.0')
|
2019-06-28 03:28:39 +03:00
|
|
|
# pc-*-4.0 won't expose non-versioned CPU models as aliases
|
|
|
|
# We do this to help management software to keep compatibility
|
|
|
|
# with older QEMU versions that didn't have the versioned CPU model
|
|
|
|
self.vm.add_args('-S')
|
|
|
|
self.vm.launch()
|
2023-10-06 18:41:15 +03:00
|
|
|
cpus = dict((m['name'], m) for m in
|
|
|
|
self.vm.cmd('query-cpu-definitions'))
|
2019-06-28 03:28:39 +03:00
|
|
|
|
|
|
|
self.assertFalse(cpus['Cascadelake-Server']['static'],
|
|
|
|
'unversioned Cascadelake-Server CPU model must not be static')
|
|
|
|
self.assertNotIn('alias-of', cpus['Cascadelake-Server'],
|
|
|
|
'Cascadelake-Server must not be an alias')
|
|
|
|
self.assertNotIn('alias-of', cpus['Cascadelake-Server-v1'],
|
|
|
|
'Cascadelake-Server-v1 must not be an alias')
|
|
|
|
|
|
|
|
self.assertFalse(cpus['qemu64']['static'],
|
|
|
|
'unversioned qemu64 CPU model must not be static')
|
|
|
|
self.assertNotIn('alias-of', cpus['qemu64'],
|
|
|
|
'qemu64 must not be an alias')
|
|
|
|
self.assertNotIn('alias-of', cpus['qemu64-v1'],
|
|
|
|
'qemu64-v1 must not be an alias')
|
|
|
|
|
|
|
|
self.validate_variant_aliases(cpus)
|
|
|
|
|
|
|
|
# On pc-*-4.0, no CPU model should be reported as an alias:
|
|
|
|
for name,c in cpus.items():
|
|
|
|
self.assertNotIn('alias-of', c, "%s shouldn't be an alias" % (name))
|
2019-06-28 03:28:42 +03:00
|
|
|
|
|
|
|
def test_4_1_alias(self):
|
2019-11-04 18:13:18 +03:00
|
|
|
"""
|
|
|
|
Check if unversioned CPU model is an alias pointing to right version
|
|
|
|
"""
|
2024-08-30 16:38:15 +03:00
|
|
|
self.set_machine('pc-i440fx-4.1')
|
2019-06-28 03:28:42 +03:00
|
|
|
self.vm.add_args('-S')
|
|
|
|
self.vm.launch()
|
|
|
|
|
2023-10-06 18:41:15 +03:00
|
|
|
cpus = dict((m['name'], m) for m in
|
|
|
|
self.vm.cmd('query-cpu-definitions'))
|
2019-06-28 03:28:42 +03:00
|
|
|
|
|
|
|
self.assertFalse(cpus['Cascadelake-Server']['static'],
|
|
|
|
'unversioned Cascadelake-Server CPU model must not be static')
|
2023-11-14 16:43:26 +03:00
|
|
|
self.assertEqual(cpus['Cascadelake-Server'].get('alias-of'),
|
|
|
|
'Cascadelake-Server-v1',
|
|
|
|
'Cascadelake-Server must be an alias of Cascadelake-Server-v1')
|
2019-06-28 03:28:42 +03:00
|
|
|
self.assertNotIn('alias-of', cpus['Cascadelake-Server-v1'],
|
|
|
|
'Cascadelake-Server-v1 must not be an alias')
|
|
|
|
|
|
|
|
self.assertFalse(cpus['qemu64']['static'],
|
|
|
|
'unversioned qemu64 CPU model must not be static')
|
2023-11-14 16:43:26 +03:00
|
|
|
self.assertEqual(cpus['qemu64'].get('alias-of'), 'qemu64-v1',
|
|
|
|
'qemu64 must be an alias of qemu64-v1')
|
2019-06-28 03:28:42 +03:00
|
|
|
self.assertNotIn('alias-of', cpus['qemu64-v1'],
|
|
|
|
'qemu64-v1 must not be an alias')
|
|
|
|
|
|
|
|
self.validate_variant_aliases(cpus)
|
|
|
|
|
|
|
|
# On pc-*-4.1, -noTSX and -IBRS models should be aliases:
|
2023-11-14 16:43:26 +03:00
|
|
|
self.assertEqual(cpus["Haswell"].get('alias-of'),
|
|
|
|
"Haswell-v1",
|
2019-06-28 03:28:42 +03:00
|
|
|
"Haswell must be an alias")
|
2023-11-14 16:43:26 +03:00
|
|
|
self.assertEqual(cpus["Haswell-noTSX"].get('alias-of'),
|
|
|
|
"Haswell-v2",
|
2019-06-28 03:28:42 +03:00
|
|
|
"Haswell-noTSX must be an alias")
|
2023-11-14 16:43:26 +03:00
|
|
|
self.assertEqual(cpus["Haswell-IBRS"].get('alias-of'),
|
|
|
|
"Haswell-v3",
|
2019-06-28 03:28:42 +03:00
|
|
|
"Haswell-IBRS must be an alias")
|
2023-11-14 16:43:26 +03:00
|
|
|
self.assertEqual(cpus["Haswell-noTSX-IBRS"].get('alias-of'),
|
|
|
|
"Haswell-v4",
|
2019-06-28 03:28:42 +03:00
|
|
|
"Haswell-noTSX-IBRS must be an alias")
|
|
|
|
|
2023-11-14 16:43:26 +03:00
|
|
|
self.assertEqual(cpus["Broadwell"].get('alias-of'),
|
|
|
|
"Broadwell-v1",
|
2019-06-28 03:28:42 +03:00
|
|
|
"Broadwell must be an alias")
|
2023-11-14 16:43:26 +03:00
|
|
|
self.assertEqual(cpus["Broadwell-noTSX"].get('alias-of'),
|
|
|
|
"Broadwell-v2",
|
2019-06-28 03:28:42 +03:00
|
|
|
"Broadwell-noTSX must be an alias")
|
2023-11-14 16:43:26 +03:00
|
|
|
self.assertEqual(cpus["Broadwell-IBRS"].get('alias-of'),
|
|
|
|
"Broadwell-v3",
|
2019-06-28 03:28:42 +03:00
|
|
|
"Broadwell-IBRS must be an alias")
|
2023-11-14 16:43:26 +03:00
|
|
|
self.assertEqual(cpus["Broadwell-noTSX-IBRS"].get('alias-of'),
|
|
|
|
"Broadwell-v4",
|
2019-06-28 03:28:42 +03:00
|
|
|
"Broadwell-noTSX-IBRS must be an alias")
|
|
|
|
|
2023-11-14 16:43:26 +03:00
|
|
|
self.assertEqual(cpus["Nehalem"].get('alias-of'),
|
|
|
|
"Nehalem-v1",
|
2019-06-28 03:28:42 +03:00
|
|
|
"Nehalem must be an alias")
|
2023-11-14 16:43:26 +03:00
|
|
|
self.assertEqual(cpus["Nehalem-IBRS"].get('alias-of'),
|
|
|
|
"Nehalem-v2",
|
2019-06-28 03:28:42 +03:00
|
|
|
"Nehalem-IBRS must be an alias")
|
|
|
|
|
2023-11-14 16:43:26 +03:00
|
|
|
self.assertEqual(cpus["Westmere"].get('alias-of'),
|
|
|
|
"Westmere-v1",
|
2019-06-28 03:28:42 +03:00
|
|
|
"Westmere must be an alias")
|
2023-11-14 16:43:26 +03:00
|
|
|
self.assertEqual(cpus["Westmere-IBRS"].get('alias-of'),
|
|
|
|
"Westmere-v2",
|
2019-06-28 03:28:42 +03:00
|
|
|
"Westmere-IBRS must be an alias")
|
|
|
|
|
2023-11-14 16:43:26 +03:00
|
|
|
self.assertEqual(cpus["SandyBridge"].get('alias-of'),
|
|
|
|
"SandyBridge-v1",
|
2019-06-28 03:28:42 +03:00
|
|
|
"SandyBridge must be an alias")
|
2023-11-14 16:43:26 +03:00
|
|
|
self.assertEqual(cpus["SandyBridge-IBRS"].get('alias-of'),
|
|
|
|
"SandyBridge-v2",
|
2019-06-28 03:28:42 +03:00
|
|
|
"SandyBridge-IBRS must be an alias")
|
|
|
|
|
2023-11-14 16:43:26 +03:00
|
|
|
self.assertEqual(cpus["IvyBridge"].get('alias-of'),
|
|
|
|
"IvyBridge-v1",
|
2019-06-28 03:28:42 +03:00
|
|
|
"IvyBridge must be an alias")
|
2023-11-14 16:43:26 +03:00
|
|
|
self.assertEqual(cpus["IvyBridge-IBRS"].get('alias-of'),
|
|
|
|
"IvyBridge-v2",
|
2019-06-28 03:28:42 +03:00
|
|
|
"IvyBridge-IBRS must be an alias")
|
|
|
|
|
2023-11-14 16:43:26 +03:00
|
|
|
self.assertEqual(cpus["Skylake-Client"].get('alias-of'),
|
|
|
|
"Skylake-Client-v1",
|
2019-06-28 03:28:42 +03:00
|
|
|
"Skylake-Client must be an alias")
|
2023-11-14 16:43:26 +03:00
|
|
|
self.assertEqual(cpus["Skylake-Client-IBRS"].get('alias-of'),
|
|
|
|
"Skylake-Client-v2",
|
2019-06-28 03:28:42 +03:00
|
|
|
"Skylake-Client-IBRS must be an alias")
|
|
|
|
|
2023-11-14 16:43:26 +03:00
|
|
|
self.assertEqual(cpus["Skylake-Server"].get('alias-of'),
|
|
|
|
"Skylake-Server-v1",
|
2019-06-28 03:28:42 +03:00
|
|
|
"Skylake-Server must be an alias")
|
2023-11-14 16:43:26 +03:00
|
|
|
self.assertEqual(cpus["Skylake-Server-IBRS"].get('alias-of'),
|
|
|
|
"Skylake-Server-v2",
|
2019-06-28 03:28:42 +03:00
|
|
|
"Skylake-Server-IBRS must be an alias")
|
|
|
|
|
2023-11-14 16:43:26 +03:00
|
|
|
self.assertEqual(cpus["EPYC"].get('alias-of'),
|
|
|
|
"EPYC-v1",
|
2019-06-28 03:28:42 +03:00
|
|
|
"EPYC must be an alias")
|
2023-11-14 16:43:26 +03:00
|
|
|
self.assertEqual(cpus["EPYC-IBPB"].get('alias-of'),
|
|
|
|
"EPYC-v2",
|
2019-06-28 03:28:42 +03:00
|
|
|
"EPYC-IBPB must be an alias")
|
|
|
|
|
|
|
|
self.validate_aliases(cpus)
|
|
|
|
|
|
|
|
def test_none_alias(self):
|
2019-11-04 18:13:18 +03:00
|
|
|
"""
|
|
|
|
Check if unversioned CPU model is an alias pointing to some version
|
|
|
|
"""
|
2024-08-30 16:38:15 +03:00
|
|
|
self.set_machine('none')
|
2019-06-28 03:28:42 +03:00
|
|
|
self.vm.add_args('-S')
|
|
|
|
self.vm.launch()
|
|
|
|
|
2023-10-06 18:41:15 +03:00
|
|
|
cpus = dict((m['name'], m) for m in
|
|
|
|
self.vm.cmd('query-cpu-definitions'))
|
2019-06-28 03:28:42 +03:00
|
|
|
|
|
|
|
self.assertFalse(cpus['Cascadelake-Server']['static'],
|
|
|
|
'unversioned Cascadelake-Server CPU model must not be static')
|
|
|
|
self.assertTrue(re.match('Cascadelake-Server-v[0-9]+', cpus['Cascadelake-Server']['alias-of']),
|
|
|
|
'Cascadelake-Server must be an alias of versioned CPU model')
|
|
|
|
self.assertNotIn('alias-of', cpus['Cascadelake-Server-v1'],
|
|
|
|
'Cascadelake-Server-v1 must not be an alias')
|
|
|
|
|
|
|
|
self.assertFalse(cpus['qemu64']['static'],
|
|
|
|
'unversioned qemu64 CPU model must not be static')
|
|
|
|
self.assertTrue(re.match('qemu64-v[0-9]+', cpus['qemu64']['alias-of']),
|
|
|
|
'qemu64 must be an alias of versioned CPU model')
|
|
|
|
self.assertNotIn('alias-of', cpus['qemu64-v1'],
|
|
|
|
'qemu64-v1 must not be an alias')
|
|
|
|
|
|
|
|
self.validate_aliases(cpus)
|
2019-06-28 03:28:44 +03:00
|
|
|
|
2019-08-28 22:36:28 +03:00
|
|
|
|
2024-08-30 16:38:15 +03:00
|
|
|
class CascadelakeArchCapabilities(QemuSystemTest):
|
2019-08-28 22:36:28 +03:00
|
|
|
"""
|
|
|
|
Validation of Cascadelake arch-capabilities
|
|
|
|
"""
|
2019-09-24 22:44:59 +03:00
|
|
|
def get_cpu_prop(self, prop):
|
2023-10-06 18:41:15 +03:00
|
|
|
cpu_path = self.vm.cmd('query-cpus-fast')[0].get('qom-path')
|
|
|
|
return self.vm.cmd('qom-get', path=cpu_path, property=prop)
|
2019-09-24 22:44:59 +03:00
|
|
|
|
2019-08-28 22:36:28 +03:00
|
|
|
def test_4_1(self):
|
2024-08-30 16:38:15 +03:00
|
|
|
self.set_machine('pc-i440fx-4.1')
|
2019-06-28 03:28:44 +03:00
|
|
|
# machine-type only:
|
2019-09-24 22:44:59 +03:00
|
|
|
self.vm.add_args('-S')
|
2021-04-30 16:34:14 +03:00
|
|
|
self.set_vm_arg('-cpu',
|
|
|
|
'Cascadelake-Server,x-force-features=on,check=off,'
|
|
|
|
'enforce=off')
|
2019-09-24 22:44:59 +03:00
|
|
|
self.vm.launch()
|
|
|
|
self.assertFalse(self.get_cpu_prop('arch-capabilities'),
|
2019-06-28 03:28:44 +03:00
|
|
|
'pc-i440fx-4.1 + Cascadelake-Server should not have arch-capabilities')
|
|
|
|
|
2019-08-28 22:36:28 +03:00
|
|
|
def test_4_0(self):
|
2024-08-30 16:38:15 +03:00
|
|
|
self.set_machine('pc-i440fx-4.0')
|
2019-09-24 22:44:59 +03:00
|
|
|
self.vm.add_args('-S')
|
2021-04-30 16:34:14 +03:00
|
|
|
self.set_vm_arg('-cpu',
|
|
|
|
'Cascadelake-Server,x-force-features=on,check=off,'
|
|
|
|
'enforce=off')
|
2019-09-24 22:44:59 +03:00
|
|
|
self.vm.launch()
|
|
|
|
self.assertFalse(self.get_cpu_prop('arch-capabilities'),
|
2019-06-28 03:28:44 +03:00
|
|
|
'pc-i440fx-4.0 + Cascadelake-Server should not have arch-capabilities')
|
|
|
|
|
2019-08-28 22:36:28 +03:00
|
|
|
def test_set_4_0(self):
|
2024-08-30 16:38:15 +03:00
|
|
|
self.set_machine('pc-i440fx-4.0')
|
2019-06-28 03:28:44 +03:00
|
|
|
# command line must override machine-type if CPU model is not versioned:
|
2019-09-24 22:44:59 +03:00
|
|
|
self.vm.add_args('-S')
|
2021-04-30 16:34:14 +03:00
|
|
|
self.set_vm_arg('-cpu',
|
|
|
|
'Cascadelake-Server,x-force-features=on,check=off,'
|
|
|
|
'enforce=off,+arch-capabilities')
|
2019-09-24 22:44:59 +03:00
|
|
|
self.vm.launch()
|
|
|
|
self.assertTrue(self.get_cpu_prop('arch-capabilities'),
|
2019-06-28 03:28:44 +03:00
|
|
|
'pc-i440fx-4.0 + Cascadelake-Server,+arch-capabilities should have arch-capabilities')
|
|
|
|
|
2019-08-28 22:36:28 +03:00
|
|
|
def test_unset_4_1(self):
|
2024-08-30 16:38:15 +03:00
|
|
|
self.set_machine('pc-i440fx-4.1')
|
2019-09-24 22:44:59 +03:00
|
|
|
self.vm.add_args('-S')
|
2021-04-30 16:34:14 +03:00
|
|
|
self.set_vm_arg('-cpu',
|
|
|
|
'Cascadelake-Server,x-force-features=on,check=off,'
|
|
|
|
'enforce=off,-arch-capabilities')
|
2019-09-24 22:44:59 +03:00
|
|
|
self.vm.launch()
|
|
|
|
self.assertFalse(self.get_cpu_prop('arch-capabilities'),
|
2019-06-28 03:28:44 +03:00
|
|
|
'pc-i440fx-4.1 + Cascadelake-Server,-arch-capabilities should not have arch-capabilities')
|
|
|
|
|
2019-08-28 22:36:28 +03:00
|
|
|
def test_v1_4_0(self):
|
2024-08-30 16:38:15 +03:00
|
|
|
self.set_machine('pc-i440fx-4.0')
|
2019-06-28 03:28:44 +03:00
|
|
|
# versioned CPU model overrides machine-type:
|
2019-09-24 22:44:59 +03:00
|
|
|
self.vm.add_args('-S')
|
2021-04-30 16:34:14 +03:00
|
|
|
self.set_vm_arg('-cpu',
|
|
|
|
'Cascadelake-Server-v1,x-force-features=on,check=off,'
|
|
|
|
'enforce=off')
|
2019-09-24 22:44:59 +03:00
|
|
|
self.vm.launch()
|
|
|
|
self.assertFalse(self.get_cpu_prop('arch-capabilities'),
|
2019-08-28 22:36:27 +03:00
|
|
|
'pc-i440fx-4.0 + Cascadelake-Server-v1 should not have arch-capabilities')
|
2019-06-28 03:28:44 +03:00
|
|
|
|
2019-08-28 22:36:28 +03:00
|
|
|
def test_v2_4_0(self):
|
2024-08-30 16:38:15 +03:00
|
|
|
self.set_machine('pc-i440fx-4.0')
|
2019-09-24 22:44:59 +03:00
|
|
|
self.vm.add_args('-S')
|
2021-04-30 16:34:14 +03:00
|
|
|
self.set_vm_arg('-cpu',
|
|
|
|
'Cascadelake-Server-v2,x-force-features=on,check=off,'
|
|
|
|
'enforce=off')
|
2019-09-24 22:44:59 +03:00
|
|
|
self.vm.launch()
|
|
|
|
self.assertTrue(self.get_cpu_prop('arch-capabilities'),
|
|
|
|
'pc-i440fx-4.0 + Cascadelake-Server-v2 should have arch-capabilities')
|
2019-06-28 03:28:44 +03:00
|
|
|
|
2019-08-28 22:36:28 +03:00
|
|
|
def test_v1_set_4_0(self):
|
2024-08-30 16:38:15 +03:00
|
|
|
self.set_machine('pc-i440fx-4.0')
|
2019-06-28 03:28:44 +03:00
|
|
|
# command line must override machine-type and versioned CPU model:
|
2019-09-24 22:44:59 +03:00
|
|
|
self.vm.add_args('-S')
|
2021-04-30 16:34:14 +03:00
|
|
|
self.set_vm_arg('-cpu',
|
|
|
|
'Cascadelake-Server-v1,x-force-features=on,check=off,'
|
|
|
|
'enforce=off,+arch-capabilities')
|
2019-09-24 22:44:59 +03:00
|
|
|
self.vm.launch()
|
|
|
|
self.assertTrue(self.get_cpu_prop('arch-capabilities'),
|
|
|
|
'pc-i440fx-4.0 + Cascadelake-Server-v1,+arch-capabilities should have arch-capabilities')
|
2019-06-28 03:28:44 +03:00
|
|
|
|
2019-08-28 22:36:28 +03:00
|
|
|
def test_v2_unset_4_1(self):
|
2024-08-30 16:38:15 +03:00
|
|
|
self.set_machine('pc-i440fx-4.1')
|
2019-09-24 22:44:59 +03:00
|
|
|
self.vm.add_args('-S')
|
2021-04-30 16:34:14 +03:00
|
|
|
self.set_vm_arg('-cpu',
|
|
|
|
'Cascadelake-Server-v2,x-force-features=on,check=off,'
|
|
|
|
'enforce=off,-arch-capabilities')
|
2019-09-24 22:44:59 +03:00
|
|
|
self.vm.launch()
|
|
|
|
self.assertFalse(self.get_cpu_prop('arch-capabilities'),
|
2019-06-28 03:28:44 +03:00
|
|
|
'pc-i440fx-4.1 + Cascadelake-Server-v2,-arch-capabilities should not have arch-capabilities')
|
2024-08-30 16:38:15 +03:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
QemuSystemTest.main()
|