On Tue, Apr 09, 2024 at 03:52:40PM -0700, Atish Patra wrote:
On 4/5/24 06:11, Andrew Jones wrote:...
On Wed, Apr 03, 2024 at 01:04:50AM -0700, Atish Patra wrote:
We can start a VM on a host with SBI v2.0, but tell KVM to tell the VMAgreed. I will send a separate series for that as it is an ABI change.+ probe = guest_sbi_probe_extension(SBI_EXT_PMU, &out_val);It's a pity we can't check the SBI spec version that KVM is advertising
+ GUEST_ASSERT(probe && out_val == 1);
+
+ if (get_host_sbi_spec_version() < sbi_mk_version(2, 0))
+ __GUEST_ASSERT(0, "SBI implementation version doesn't support PMU Snapshot");
+}
from KVM userspace. Normally we'd want to check something like this at
the start of the test with TEST_REQUIRE() before running a VCPU in order
to generate a skip exit.
(We probably should allow reading and even writing the SBI spec versionHow that would work for SBI spec version write use case ? For migraiton, you
from the VMM in order to better support migration.)
can't go back to older SBI versions in the host. Isn't it ?
Considering this case your VM is running with PMU snapshot as the host has
SBI v2.0. It can't be migrated to v1.0 and expecting it work. Correct ?
that it has v1.0. Then, the guest shouldn't use any features from SBI
that appear after v1.0 and it should be safe to migrate to a host with
v1.0.
A more likely scenario might be this though:
1. KVM userspace checks and captures the SBI version of the host where
the VM is first being launched, e.g. v2.0
2. The VM gets migrated to another host which supports something later,
e.g. v3.0, but to
- avoid possibly confusing the guest we tell the destination host
that it should expose v2.0 as the SBI version
- allow rollback to the source host without concern that the guest
has already seen v3.0 and started to use something that the
source can't provide
Thanks,
drew