riscv-non-isa/riscv-ap-tee

[Qualcomm feedback] Chapter 8.1.1. TVM-defined Shared memory regions

rsahita opened this issue · 2 comments

Reference: link

The calling TVM vCPU is considered blocked until the assignment-change is completed. Attempts to
run it with sbi_covh_run_tvm_vcpu() will fail. Any guest page faults taken by other TVM vCPUs in the
invalidated pages continue to be reported to the host.

How can it be blocked if the host is supposed to continue the TVM execution after the pages have been reclaimed? Also considering they'll be mapped as shared only on page-fault, which can happen only if the TVM is running to cause it.

The TVM vcpu is blocked until the host completes the conversion to shared memory - this sequence where the TVM vcpu gets blocked is triggered by the TVM via the sbi_covg_share_memory_region - and happens in two parts - invalidation of references to confidential memory (and address translation cache flushes if any) and second, the addition of the mapping to shared memory - the host may run the TVM vcpu after the first part, and lazily handle the fault for the second part. also the reclamation is of the confidential pages, and the shared memory pages provided by the host may be unique from those pages so that host has the option to service the request on the TVM synchronously or asynchronously.

The language may be a bit confusing here - I will clarify the description as above. cc @ozkoyuncu

addressed by PR #67