Repository navigation
xtest: RISC-V vector context switching (regression 1046) - #827
Conversation
|
D/TA: TA_CreateEntryPoint:20 TA_CreateEntryPoint xtest output |
6430f08 to
5dbe819
Compare
5dbe819 to
06d05fe
Compare
|
Please rebase to resolve the conflicts. |
ok will resolve it, thanks. |
06d05fe to
344f40e
Compare
|
Rebased onto current master. The conflicts were the new ASAN test (regression 1042) landing next to the vector helpers and an os_test command-number clash: 1042 is kept as-is and TA_OS_TEST_CMD_RISCV_VEC_CONTEXT moved to 43 (ASAN took 38-42). The three vector commits are otherwise unchanged. Thanks! |
344f40e to
283cfcb
Compare
283cfcb to
4e1473a
Compare
4e1473a to
1bdbacd
Compare
1bdbacd to
a5bd678
Compare
|
This pull request has been marked as a stale pull request because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment, otherwise this pull request will automatically be closed in 5 days. Note that you can always re-open a closed pull request at any time. |
|
Please rebase. Is this PR otherwise ready to be merged (once it's reviewed)? |
Hi @jenswikl thanks for heads up, this xtest is dependent on #7961 and hence we need to wait for the optee_os feature to be merged upstream. |
a5bd678 to
83519c6
Compare
9c54195 to
b63f036
Compare
|
@jenswikl please can you trigger CI re-run looks like qemu crashed. Thanks |
|
Restarting the job. |
|
Hi @jenswikl please can this PR be reviewed and confirmed? |
|
I'd appreciate it if someone who knows riscv better than I would review this. |
b63f036 to
f2745dc
Compare
Add riscv_vector_ctx.h, shared by the os_test TA and the xtest host, to lay a known pattern into the vector registers, read it back, and diff it, so a test can check the register file survives an excursion. The register moves use the whole-register vs8r.v/vl8r.v forms with the vector ISA enabled per block by .option arch, and the header compiles to nothing when the build has no vector extension. Signed-off-by: Dave Patel <dave.patel@riscstar.com> Acked-by: Jens Wiklander <jens.wiklander@oss.qualcomm.com>
Add TA_OS_TEST_CMD_RISCV_VEC_CONTEXT and its sub-tests, handled by ta_entry_riscv_vec_context(): install a vector pattern, cross a syscall, an RPC or a crypto operation, and verify the registers came back, plus a taint/check-taint pair to confirm a fresh TA does not inherit another's registers. Returns TEE_ERROR_NOT_SUPPORTED when the TA was built without the vector extension. Signed-off-by: Dave Patel <dave.patel@riscstar.com> Acked-by: Jens Wiklander <jens.wiklander@oss.qualcomm.com>
Add regression 1046, the vector counterpart of 1045. It drives the TA sub-tests (context across a syscall, a vector CSR read, and that a TA does not inherit another's registers), checks the normal-world registers survive a call into the TEE when the host is built with the vector extension, and runs the TA case from several threads at once. Sub-tests that need a capability the build lacks report themselves skipped. Signed-off-by: Dave Patel <dave.patel@riscstar.com> Acked-by: Jens Wiklander <jens.wiklander@oss.qualcomm.com>
The regression 1046 vector helpers are guarded by __riscv_v, which the compiler defines only when the TA is built with a V-enabled -march. The OP-TEE core dev-kit used to force V onto every rv64 TA; it no longer does, so without this the vector test code is compiled out and 1046 has nothing to exercise on the TA side. Opt the os_test TA in to V when the core supports vector context switching (CFG_RISCV_ISA_V, exported by the dev-kit). The vector asm is enabled per block with '.option arch', so the -march only serves to define __riscv_v. Signed-off-by: Dave Patel <dave.patel@riscstar.com> Acked-by: Jens Wiklander <jens.wiklander@oss.qualcomm.com>
f2745dc to
27d50e9
Compare
|
@jenswikl this PR is ready to merge. |
Add xtest regression 1046, the RISC-V vector counterpart of the FP test
(regression 1045). Companion to OP-TEE/optee_os#7961.
Three commits: a shared helper header to observe the vector registers across
a call, the os_test TA support (TA_OS_TEST_CMD_RISCV_VEC_CONTEXT and its
sub-tests), and the regression 1046 host test.
Coverage
1046 has six subcases mirroring 1045: TA context across a syscall, a vector
CSR read, that a TA does not inherit another TA's registers, the normal-world
registers surviving a call using vector and one not using it, and the TA case
run concurrently from several threads.
The two normal-world subcases run only when the host xtest is built with the
vector extension; on a host toolchain without it they report themselves
skipped, exactly as 1045's normal-world subcases depend on host FP support.
The TA sub-tests, which exercise the OP-TEE vector context switch, run
whenever the TA is built with the vector extension.
Testing
Built and booted on QEMU virt (
-cpu rv64,v=true,vlen=128, 2 harts, OpenSBIwith domain context switching) against OP-TEE/optee_os#7961:
xtest 1046passes (vlenb 16), the four TA/concurrent subcases run and the two
normal-world subcases skip because this host xtest is built without vector.