Fix diagnostics and capability probes for protected VMs
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest5 patches 11 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | arm64: Do not abort on register-dump failuresarm64/ | +24 | 4 replies | |
| 2/5 | kvm: Bound-check the exit-reason string lookupbuiltin-run.c include/ kvm.c | +11 | 1 reply | |
| 3/5 | kvm: Name every exit reason the UAPI header defineskvm.c | +25 | 1 reply | |
| 4/5 | arm64: Query steal-time support on the VM fdarm64/ | +2 | 1 reply | |
| 5/5 | arm64: Query counter-offset support on the VM fdarm64/ | +1 | 1 reply |
Reviews trailers per patch
All 5 patches have a Reviewed-by or Acked-by.
| Patch | Suzuki K Poulose |
|---|---|
| 1/5 | R-b |
| 2/5 | R-b |
| 3/5 | R-b |
| 4/5 | R-b |
| 5/5 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH kvmtool 0/5] Fix diagnostics and capability probes for protected VMs
Hi folks,
These are the kvmtool changes that go with the pKVM series confining a protected VM's vCPU state to EL2 [1].
That series stops the host reading a protected vCPU's registers once it has run, and stops it setting the PVTIME attribute. kvmtool dies on both. Its arm64 register-dump helpers call die() when KVM_GET_ONE_REG fails, which turns a diagnostic into a VMM abort. kvm_cpu__setup_pvtime() runs into the new -EPERM and fails vCPU init.
The PVTIME failure is a probe on the wrong fd. kvmtool asks the global /dev/kvm fd whether steal-time is available, and that fd advertises it for a protected VM, which cannot use it.
The last patch fixes the same wrong-fd probe for the counter offset, where "lkvm run --protected --counter-offset" already fails on Linux 7.3-rc1, without the kernel series.
The same conversion went in for the vCPU feature probes in July [2].
Patches 2 and 3 are not specific to protected VMs. They fix the exit-reason table on the same panic path as patch 1. The lookup ran off the end of it, and the table had stopped naming anything KVM added after KVM_EXIT_INTERNAL_ERROR, which on arm64 includes KVM_EXIT_SYSTEM_EVENT and KVM_EXIT_ARM_NISV.
Patch 1's path needs a protected VM that is already running: "lkvm debug -d" against one kills the VMM without this series, and prints the errno with it.
Based on kvmtool master (f67bc0b).
Cheers,
/fuad
[1] https://lore.kernel.org/all/[email protected]/
[2] https://lore.kernel.org/all/[email protected]/
Fuad Tabba (5):
arm64: Do not abort on register-dump failures
kvm: Bound-check the exit-reason string lookup
kvm: Name every exit reason the UAPI header defines
arm64: Query steal-time support on the VM fd
arm64: Query counter-offset support on the VM fd
arm64/kvm-cpu.c | 36 ++++++++++++++++++++++++------------ arm64/kvm.c | 2 +- arm64/pvtime.c | 4 ++-- builtin-run.c | 2 +- include/kvm/kvm.h | 2 +- kvm.c | 37 ++++++++++++++++++++++++++++++++++--- 6 files changed, 63 insertions(+), 20 deletions(-)
base-commit: f67bc0bdae9433a9cfd05e65ea2c1bb6102566d9
Signature · 1 line
2.39.5