Skip to content
Snippets Groups Projects
Commit 0405a25a authored by Pierre-Clément Tosi's avatar Pierre-Clément Tosi
Browse files

ANDROID: KVM: arm64: Fix corrupted PSTATE during guest debug


When running non-protected guests for which the host has enabled
hardware-assisted debugging, pKVM "flushes" PSTATE and MDSCR_EL1 from
the host-controlled vCPU struct to its internal struct before actually
running the vCPU. However, on guest exit, it was failing to record
("sync") any change that the guest might have made to those registers.
As a result, the following vCPU flush discards those changes and the
following vCPU run happens with potentially corrupted registers. This
is particularly noticeable during Linux boot when guest updates to
PSTATE.{I,BTYPE} are lost.

Instead, sync PSTATE and MDSCR if they were flushed before the vCPU run.

Bug: 389970357
Fixes: 0a1f3a1f ("ANDROID: KVM: arm64: Monitor Debug support for non-protected guests")
Change-Id: Idaf68516782dc3cd284f6a4e65f8c89cbad7d273
Signed-off-by: default avatarPierre-Clément Tosi <ptosi@google.com>
parent d12538e9
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment