Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
2355dc2
KVM: update TDX module initialization info
fanchen2 May 8, 2026
54236c9
KVM: add wrmsrns cpuid check variant
fanchen2 May 22, 2026
e5df607
KVM: add cpu_aia test cases
VZstless May 25, 2026
6c2dab6
KVM: remove waitpkg from SPR cpu model
xhao22 May 27, 2026
ea52fc1
KVM: add tdx_without_nographic case
VZstless May 21, 2026
065de36
KVM: add avx512_bf16 and vm-only amx_vm_icx cpuid cases
fanchen2 May 22, 2026
d12e6e5
KVM: remove `Don't create/remove guest images` comment in 2 cases
VZstless May 25, 2026
c1d2a29
KVM: add tdx_ve_reduction test cases
fanchen2 May 12, 2026
fa744fc
KVM: add vm save/restore test cases
fanchen2 May 22, 2026
f5403a0
KVM: add live migration test cases
fanchen2 May 27, 2026
8cdab96
KVM: add tdx_numa_set test case
fanchen2 Jun 9, 2026
834c1ea
KVM: add shell_prompt and remove force_create_image from cfg files
fanchen2 Jun 9, 2026
36ecb47
KVM: add cpu model variants and update model versions
fanchen2 Jun 10, 2026
bccdfeb
KVM: add nmis_nonmis CPUID negative validation case
fanchen2 Jun 11, 2026
3d201cf
KVM: add tdx_QGS_socket test case
fanchen2 Jun 9, 2026
dd4dd0f
KVM: add cpuid_1f topology validation cases
fanchen2 Jun 10, 2026
0b0bc44
KVM: add cpuid verification after live migration
fanchen2 Jun 11, 2026
b72c2ea
KVM: install cpuid in guest for lm verify
fanchen2 Jun 17, 2026
69d8064
KVM: add vcpu_boot test for oversubscribed vCPU configuration
fanchen2 Jun 17, 2026
ec57bc2
KVM: add kvm_memory_hotplug_1G case
VZstless Jun 23, 2026
83c72f7
KVM: add boot_win11 case
VZstless Jun 12, 2026
654b24f
KVM: add tdx_hdevents_in5sec case
fanchen2 Jul 9, 2026
96c40c8
KVM: add vcpu hotplug cases
fanchen2 Jul 9, 2026
8a28c63
KVM: add avx2 variant to x86_cpu_flags
fanchen2 Jul 10, 2026
c7a3798
KVM: add buslock_ve cases
fanchen2 Jul 28, 2026
fffe930
KVM: add pf_intercepts_ept case
fanchen2 Jul 10, 2026
a6b92e4
KVM: add xsaves variant to x86_cpu_flags
fanchen2 Jul 10, 2026
a56ed4d
KVM: add xsaves_workload case
fanchen2 Jul 10, 2026
b5ca033
KVM: add xsaves_persistence case
fanchen2 Jul 10, 2026
1632986
KVM: add mce_hmp/mce_einj LMCE cases and extend RAS with LMCE local d…
fanchen2 Jul 28, 2026
f2db7be
KVM: add Adaptive PEBS tests on feature_test
xhao22 Jul 28, 2026
ca210d5
KVM: add stress-ng workload case
fanchen2 Jul 24, 2026
c009700
KVM: add virt_interrupt tracepoint verification case
fanchen2 Jul 24, 2026
3c9e167
KVM: add SierraForest VMX, live migration, and cache model cases
fanchen2 Jul 24, 2026
1c582a6
KVM: add VMX, live migration, cache model, and CPUID extended cases
fanchen2 Jul 24, 2026
84ca8c4
KVM: remove amx_tf32 case from x86_cpuid
xhao22 Aug 21, 2026
f446d0e
KVM: add nested KVM L2 boot and feature (PKU/vPMU) tests
fanchen2 Aug 20, 2026
9abb051
KVM: add avx2 cpuid check case
fanchen2 Sep 2, 2026
e6aa5a0
KVM: add CPU topology guest tests for DMR module topology
fanchen2 Sep 14, 2026
7016b5a
KVM: add 2031M memory boot check case
fanchen2 Sep 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 28 additions & 4 deletions BM/instruction-check/feature_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
"cpuid": ['7', '0', '0', '0', 'b', '15'],
"platforms": {"SPR", "EMR", "GNR", "SRF", "CWF"}
},
"AVX2": {
"cpuid": ['7', '0', '0', '0', 'b', '5'],
"platforms": {"SPR", "EMR", "GNR", "SRF", "CWF"}
},
"AVX512_F": {
"cpuid": ['7', '0', '0', '0', 'b', '16'],
"platforms": {"SPR", "EMR", "GNR"}
Expand Down Expand Up @@ -142,6 +146,10 @@
"cpuid": ['7', '0', '0', '0', 'd', '8'],
"platforms": {}
},
"AVX512_BF16": {
"cpuid": ['7', '0', '1', '0', 'a', '5'],
"platforms": {"SPR", "EMR", "GNR", "DMR"}
},
"SERIALIZE": {
"cpuid": ['7', '0', '0', '0', 'd', '14'],
"platforms": {"SPR", "EMR", "GNR", "SRF", "CWF"}
Expand Down Expand Up @@ -294,17 +302,33 @@
"cpuid": ['1E', '0', '1', '0', 'a', '4'],
"platforms": {"DMR"}
},
"AMX_TF32": {
"cpuid": ['1E', '0', '1', '0', 'a', '6'],
"platforms": {"DMR"}
},
"AMX_AVX512": {
"cpuid": ['1E', '0', '1', '0', 'a', '7'],
"platforms": {"DMR"}
},
"AMX_MOVRS": {
"cpuid": ['1E', '0', '1', '0', 'a', '8'],
"platforms": {"DMR"}
},
"ADX": {
"cpuid": ['7', '0', '0', '0', 'b', '19'],
"platforms": {"SPR", "EMR", "GNR", "SRF", "CWF", "DMR"}
},
"VMX": {
"cpuid": ['1', '0', '0', '0', 'c', '5'],
"platforms": {"SPR", "EMR", "GNR", "SRF", "CWF", "DMR"}
},
"IBRS": {
"cpuid": ['7', '0', '0', '0', 'd', '26'],
"platforms": {"SPR", "EMR", "GNR", "SRF", "CWF", "DMR"}
},
"ARCH_CAPABILITIES": {
"cpuid": ['7', '0', '0', '0', 'd', '29'],
"platforms": {"SPR", "EMR", "GNR", "SRF", "CWF", "DMR"}
},
"SSBD": {
"cpuid": ['7', '0', '0', '0', 'd', '31'],
"platforms": {"SPR", "EMR", "GNR", "SRF", "CWF", "DMR"}
}
# Add more feature_info here
}
Expand Down
11 changes: 8 additions & 3 deletions BM/tdx-compliance/tdx-compliance.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
#define X86_CR4_CET_BIT 23 /* enable Control-flow Enforcement Technology */
#define X86_CR4_CET _BITUL(X86_CR4_CET_BIT)
#define MSR_IA32_VMX_PROCBASED_CTLS3 0x00000492
/* Compatibility: kzalloc_obj may not be available in older kernels */
#ifndef kzalloc_obj
#define kzalloc_obj(type, flags) ((type *)kzalloc(sizeof(type), flags))
#endif

#define MSR_IA32_U_CET 0x000006a0 /* user mode cet */
#define MSR_IA32_S_CET 0x000006a2 /* kernel mode cet */
#define MSR_IA32_PL0_SSP 0x000006a4 /* ring-0 shadow stack pointer */
Expand Down Expand Up @@ -98,9 +103,9 @@ struct tdx_module_args {
};

/* Used to communicate with the TDX module */
extern u64 __tdcall(u64 fn, struct tdx_module_args *args);
extern u64 __tdcall_ret(u64 fn, struct tdx_module_args *args);
extern u64 __tdcall_saved_ret(u64 fn, struct tdx_module_args *args);
u64 __tdcall(u64 fn, struct tdx_module_args *args);
u64 __tdcall_ret(u64 fn, struct tdx_module_args *args);
u64 __tdcall_saved_ret(u64 fn, struct tdx_module_args *args);
u64 tdcall(u64 fn, struct tdx_module_args *args);

/* Used to request services from the VMM */
Expand Down
10 changes: 10 additions & 0 deletions BM/topology/tests-cache_topo
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This file collects the CPU Topology case that verifies DMR cache topology
# (leaf 0x04H L1/L2/L3 sharing) inside a guest booted with a single socket
# DMR topology:
# -smp cpus=192,sockets=1,dies=4,modules=24,cores=2,threads=1 \
# -machine smp-cache.0.cache=l2,smp-cache.0.topology=module
# @hw_dep:
# @other_dep:
# @other_warn: which cpuid 2>/dev/null @ cpuid tool is required

cpu_topology.sh -t verify_qemu_dmr_cache_topo_cpuid
8 changes: 8 additions & 0 deletions BM/topology/tests-cores_per_socket
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file collects the CPU Topology case that verifies the number of cores
# per socket is consistent between sysfs and lscpu inside a guest booted with
# a two sockets topology:
# -smp cpus=192,sockets=2,dies=2,modules=24,cores=2,threads=1
# @hw_dep:
# @other_dep:

cpu_topology.sh -t verify_cores_per_socket
10 changes: 10 additions & 0 deletions BM/topology/tests-die_cluster_1
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This file collects the CPU Topology case that verifies DMR CPUID 0x1f
# level types (thread/core/module/die) inside a guest booted with a single
# socket DMR topology:
# -smp cpus=192,sockets=1,dies=4,modules=24,cores=2,threads=1 \
# -machine smp-cache.0.cache=l2,smp-cache.0.topology=module
# @hw_dep:
# @other_dep:
# @other_warn: which cpuid 2>/dev/null @ cpuid tool is required

cpu_topology.sh -t verify_qemu_dmr_one_socket_cpuid
10 changes: 10 additions & 0 deletions BM/topology/tests-die_cluster_2
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This file collects the CPU Topology case that verifies DMR CPUID 0x1f
# level types (thread/core/module/die) inside a guest booted with a two
# sockets DMR topology:
# -smp cpus=192,sockets=2,dies=2,modules=24,cores=2,threads=1 \
# -machine smp-cache.0.cache=l2,smp-cache.0.topology=module
# @hw_dep:
# @other_dep:
# @other_warn: which cpuid 2>/dev/null @ cpuid tool is required

cpu_topology.sh -t verify_qemu_dmr_two_sockets_cpuid
9 changes: 9 additions & 0 deletions BM/topology/tests-sockets_number
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This file collects the CPU Topology case that verifies the number of sockets
# is consistent between lscpu and sysfs (and matches the NUMA node count)
# inside a guest booted with a two sockets, two NUMA nodes topology:
# -smp cpus=192,sockets=2,dies=2,modules=24,cores=2,threads=1
# with one NUMA node per socket
# @hw_dep:
# @other_dep:

cpu_topology.sh -t verify_socket_num
6 changes: 6 additions & 0 deletions KVM/docs/tdx_temp.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ image_name = /root/avocado/data/avocado-vt/images/rhel-guest-image-9.4-20240419.
image_format = qcow2
#image_name = /root/avocado/data/avocado-vt/images/tdx_guest
#image_format = raw
# image_name = /root/avocado/data/avocado-vt/images/ia32e_win11
# image_format = raw

#For RHEL9.4 guest
shell_prompt = "^\[.*\][\#\$]\s*$"
Expand Down Expand Up @@ -74,9 +76,13 @@ only x86_64
only RHEL.9
#For Ubuntu guest
#only Linux.Ubuntu.14.04.3-server.x86_64
#For Windows guest
#only Windows
#only Win10
only smallpages
only virtio_blk
only qcow2
#only raw
only bridge
only virtio_net
only no_virtio_rng
Expand Down
2 changes: 2 additions & 0 deletions KVM/qemu/apic_timer_v.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
- apic_timer_v:
type = apic_timer_v
# Default value for centos image, you can overwrite it in runtime cfg for other OS image.
shell_prompt = "^\[.*\][\#\$]\s*$"
vms = ""
auto_cpu_policy = "virttest"
# MSR_IA32_VMX_PROCBASED_CTLS3 (0x492) VMX_FEATURE_GUEST_APIC_TIMER feature flag (bit8)
Expand Down
11 changes: 8 additions & 3 deletions KVM/qemu/boot_check.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
type = boot_check
virt_test_type = qemu
vm_accelerator = kvm
# Don't create/remove guest images
force_create_image = no
remove_image = no
start_vm = no
# Stop VM after testing
kill_vm = yes
# Default value for centos image, you can overwrite it in runtime cfg for other OS image.
shell_prompt = "^\[.*\][\#\$]\s*$"
vga = std
variants:
Expand All @@ -33,6 +31,13 @@
- 1G:
no 208_cpu, 256_cpu, 288_cpu
mem = 1024
- 2031M:
# 2031 is not aligned to the guest memory block size, so the
# in-guest total memory can not match it exactly. Only require
# the guest to boot up successfully with this memory size.
only 1_cpu
mem = 2031
check_mem = no
- 4G:
mem = 4096
- 16G:
Expand Down
2 changes: 2 additions & 0 deletions KVM/qemu/boot_repeat.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
- boot_repeat:
# Default value for centos image, you can overwrite it in runtime cfg for other OS image.
shell_prompt = "^\[.*\][\#\$]\s*$"
variants:
- one_vm_repeat:
virt_test_type = qemu
Expand Down
2 changes: 2 additions & 0 deletions KVM/qemu/boot_vm_in_hugepage.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
virt_test_type = qemu
type = boot
kill_vm_on_error = yes
# Default value for centos image, you can overwrite it in runtime cfg for other OS image.
shell_prompt = "^\[.*\][\#\$]\s*$"
login_timeout = 240
setup_hugepages = yes
pre_command_noncritical = yes
Expand Down
19 changes: 19 additions & 0 deletions KVM/qemu/boot_win11.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
- boot_win11:
type = boot_win11
# In this testcase you should change image_name & image format into correct format for windows guest.
# Also you should change `display` parameter among (vnc, sdl, spice) according to your machine config
# and comment `display` parameter in your avocado config file.
display = "vnc"
# Finally comment `only RHEL.9` and `only qcow2`, so as other similar parameter which limits
# host os_variant or image type, add following contents to your avocado config file:
# only Windows
# only Win10
# only raw
virt_test_type = qemu
vm_accelerator = kvm
start_vm = no
# Stop VM after testing
kill_vm = yes
vga = std
auto_cpu_model = "no"
cpu_model = host
4 changes: 2 additions & 2 deletions KVM/qemu/buslock_de.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
only Linux
virt_test_type = qemu
vm_accelerator = kvm
force_create_image = no
remove_image = no
start_vm = yes
kill_vm = yes
# Default value for centos image, you can overwrite it in runtime cfg for other OS image.
shell_prompt = "^\[.*\][\#\$]\s*$"
auto_cpu_model = "no"
cpu_model = host
vga = std
Expand Down
41 changes: 41 additions & 0 deletions KVM/qemu/buslock_ve.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
- buslock_ve:
type = buslock_ve
only Linux
virt_test_type = qemu
vm_accelerator = kvm
start_vm = no
kill_vm = yes
# Default value for centos image, you can overwrite it in runtime cfg for other OS image.
shell_prompt = "^\[.*\][\#\$]\s*$"
auto_cpu_model = "no"
cpu_model = host
vga = std
test_dir = '/tmp'
login_timeout = 240
deps_subdir = "bus_lock"
bus_lock_common_file = bus_lock_common.h
# IA32_VMX_PROCBASED_CTLS2 MSR must have bit 62 (BUS_LOCK_DETECT) set on host.
host_msr_probe = "rdmsr 0x48b -0 --bitfield 62:62"
variants:
- buslock_ve_01:
buslock_ve_action = bus_lock_exit
machine_type_extra_params = "bus-lock-ratelimit=20"
bus_lock_source_file = bus_lock.c
bus_lock_exec_file = bus_lock.out
trace_settle_time = 3
- buslock_ve_02:
buslock_ve_action = ratelimit_effect
bus_lock_source_file = bus_lock_ct.c
bus_lock_exec_file = bus_lock_ct.out
# Modernized: use the named split-locks PMU event instead of the
# legacy raw SQ_MISC encoding (cpu/event=0x2c,umask=0x10/), which
# no longer exists on current Intel server CPUs. bus_lock.split_locks
# counts split locks issued by any core and is available on the
# HW target used for validation.
perf_event = "bus_lock.split_locks"
perf_interval_ms = 1000
perf_interval_count = 2
# Two runs: baseline (no ratelimit) then bus-lock-ratelimit=20.
ratelimit_runs = "baseline ratelimited"
machine_extra_baseline = ""
machine_extra_ratelimited = "bus-lock-ratelimit=20"
38 changes: 38 additions & 0 deletions KVM/qemu/cache_model.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
- cache_model:
type = cache_model
virt_test_type = qemu
vm_accelerator = kvm
force_create_image = no
remove_image = no
image_snapshot = yes
start_vm = no
kill_vm = yes
shell_prompt = "^\[.*\][\#\$]\s*$"
vga = std
auto_cpu_model = no
# avocado-vt has no 'modules' knob. It builds -smp from
# sockets/dies/cores/threads only. We provide the module axis via
# extra_params '-smp modules=2', which QEMU merges into the same
# -smp option, so the final product is:
# sockets(2) * dies(1) * modules(2) * cores(16) * threads(2) = 128
smp = 128
vcpu_maxcpus = 128
vcpu_sockets = 2
vcpu_cores = 16
vcpu_threads = 2
extra_params += " -smp modules=2"
# Guest package that provides the `cpuid` tool (used for CPUID.4 check)
cpuid_pkg = cpuid
variants:
- srf:
cpu_model = SierraForest-v6
# Expected CPUID.4 sharing / associativity for cache 0..3
# (L1d, L1i, L2, L3). Format: 8 space-separated hex values:
# c0_sharing c0_assoc c1_sharing c1_assoc c2_sharing c2_assoc c3_sharing c3_assoc
cpuid_cache_expect = "0x1 0x8 0x1 0x8 0x1f 0x10 0x3f 0xc"
- gnr:
cpu_model = GraniteRapids-v7
cpuid_cache_expect = "0x1 0xc 0x1 0x10 0x1 0x10 0x3f 0x10"
- spr:
cpu_model = SapphireRapids-v8
cpuid_cache_expect = "0x1 0xc 0x1 0x8 0x1 0x10 0x3f 0xf"
19 changes: 19 additions & 0 deletions KVM/qemu/cpu_aia.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
- cpu_aia:
type = cpu_aia
virt_test_type = qemu
vm_accelerator = kvm
start_vm = no
# Stop VM after testing
kill_vm = yes
# Default value for centos image, you can overwrite it in runtime cfg for other OS image.
shell_prompt = "^\[.*\][\#\$]\s*$"
vga = std
auto_cpu_model = "no"
cpu_model = host
variants:
- waitpkg:
test_command = "tpause umwait umonitor"
- movdir64b:
test_command = "movdir64b"
- movdiri:
test_command = "movdiri"
Loading
Loading