Files
qemu/tests/tcg/riscv64/system/meson.build
T
Zephyr Li 9b6fc2a751 target/riscv: mask vsepc according to IALIGN
vsepc is the VS-mode counterpart of sepc and is a WARL register, but
unlike mepc and sepc its accessors do not mask the low address bits
according to IALIGN.  As a result, values with invalid low bits can be
observed through vsepc.

Apply get_xepc_mask() to both vsepc reads and writes, matching the
existing mepc/sepc handling.

Add a TCG regression test covering both IALIGN=16 and IALIGN=32.

Fixes: 8747c9eeb2 ("target/riscv: Add Hypervisor virtual CSRs accesses")
Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4420
Signed-off-by: Zephyr Li <fritchleybohrer@gmail.com>
Reviewed-by: Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>
Message-ID: <20260915024945.32329-1-fritchleybohrer@gmail.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2026-10-26 11:15:05 +10:00

105 lines
2.8 KiB
Meson

tests = []
# Multi arch tests are not supported
# tests += tcg_tests['multiarch-softmmu']['tests']
link_script = files('../semihost.ld')[0]
cflags = ['-nostdlib',
'-ffreestanding',
'-Wa,--noexecstack',
'-Wl,-T', link_script]
qemu_args = ['-M', 'virt',
'-display', 'none',
'-serial', 'stdio',
'-semihosting',
'-bios']
setup = {'cflags': cflags, 'qemu_args': qemu_args}
tests += {
'doubletrap.S': setup + {'plugin_test': {'plugin': 'discons'}},
'interruptedmemory.S': setup + {'plugin_test': {'plugin': 'discons'}},
'issue1060.S': setup,
'test-mepc-masking.S': setup,
'test-crc32.S': setup + {'qemu_args': ['-cpu', 'rv64,xlrbr=true', qemu_args]},
'test-minstret-ecall.S': setup + {'qemu_args': ['-icount', 'shift=1', qemu_args]},
'test-minstret-wfi.S': setup + {'qemu_args': ['-icount', 'shift=1', qemu_args]},
'test-misa-w.S': setup + {'qemu_args': ['-cpu', 'rv64,x-misa-w=true,c=true,v=true', qemu_args]},
'test-zvabd.S': setup + {'qemu_args': ['-cpu', 'rv64,v=true,vlen=256,x-zvabd=true', qemu_args]},
'test-vsepc-masking.S': setup + {
'test_name': 'test-vsepc-masking-c',
'qemu_args': ['-cpu', 'rv64,h=true,c=true', qemu_args],
},
}
tests += {
'test-vsepc-masking.S': {
'test_name': 'test-vsepc-masking-no-c',
'qemu_args': ['-cpu', 'rv64,h=true,c=false,zca=false', qemu_args],
},
}
tests += {
'test-rv128-mstatus.S': {
'cflags': cflags,
'qemu_args': ['-cpu', 'x-rv128', qemu_args],
}
}
tests += {
'test-rv128-sstatus.S': {
'cflags': cflags,
'qemu_args': ['-cpu', 'x-rv128', qemu_args],
}
}
tests += {
'test-vle32ff.S': {
'cflags': cflags + ['-march=rv64gcv'],
'qemu_args': ['-cpu', 'rv64,v=true', qemu_args],
}
}
tests += {
'test-zicclsm.S': {
'cflags': cflags + ['-march=rv64gcv_zfh'],
'qemu_args': ['-cpu', 'rv64,v=true,zfh=true,zicclsm=true', qemu_args],
}
}
tests += {
'test-zicclsm.S': {
'exe_name': 'test-zicclsm-off',
'cflags': cflags + ['-march=rv64gcv_zfh', '-DZICCLSM_DISABLED'],
'qemu_args': ['-cpu', 'rv64,v=true,zfh=true,zicclsm=false', qemu_args],
}
}
tests += {
'test-sdext-sigill.S': {
'exe_name': 'test-sdext-sigill',
'cflags': cflags + ['-march=rv64gcv'],
'qemu_args': ['-cpu', 'rv64,sdtrig=true,sdext=true', qemu_args],
}
}
tests += {
'test-xsfvqmacc.S': {
'cflags': cflags,
'qemu_args': ['-cpu', 'rv64,v=true,vlen=256,xsfvqmaccdod=true,xsfvqmaccqoq=true', qemu_args],
}
}
if 'qemu-system-riscv64' in emulators
tcg_tests += {
'riscv64-softmmu': {
'cc': 'riscv64-linux-gnu-gcc',
'cc_alt': ['riscv64-redhat-linux-gnu-gcc', 'riscv64-elf-gcc'],
'cc_dockerfile': 'debian-all-test-cross',
'folder': 'riscv64',
'gdb_arch': 'riscv64',
'qemu': emulators['qemu-system-riscv64'],
'tests': tests,
}
}
endif