ANDROID: pkvm: x86: Hotfix non-working SMP in old guest kernels
Somehow I missed the fact that if a pVM hasn't issued the PKVM_GHC_START_CPU hypercall, pKVM's sipi_vector remains uninitialized (i.e. zero). So in order to prevent regressing pVM kernels that haven't been updated to start CPUs via the hypercall to pKVM instead of INIT/SIPI, it is not enough to temporarily allow the host to start a secondary vCPU at any time, we also need to temporarily avoid overriding the host's sipi_vector with pKVM's one (unless pKVM's sipi_vector is already non-zero, so we are sure that the pVM has actually issued the hypercall). Otherwise the vCPU starts executing random code at zero address and crashes. Bug: 374338925 Test: run microdroid or any other pVM with SMP whose kernel was compiled without the patch aosp/3796083 Upstream-Task: 402758258 Fixes: f944ef34 ("ANDROID: pkvm: x86: Implement secure startup of secondary vCPUs") Change-Id: I6338c0fd801691efe76e0f5d899fbcf9d26ecbf0 Signed-off-by:Dmytro Maluka <dmaluka@google.com>
Loading
Please sign in to comment