Commit 95737ba9 authored by Will Deacon's avatar Will Deacon
Browse files

ANDROID: KVM: arm64: Only re-paint "warm reset" SYSTEM_RESET2 PSCI calls



The PSCI relay code in pKVM converts SYSTEM_RESET2 requests from the
host into SYSTEM_RESET requests when unpoisoned protected guest memory
is present in the system (tracked using the PSCI MEM_PROTECT call).
This ensures that memory will be cleared by the firmware as a result of
forcing a "cold" reset.

The specification for MEM_PROTECT states:

  | When MEM_PROTECT is called, the implementation must ensure that all
  | volatile memory that is accessible by the caller is overwritten on
  | the following boot, if this is due to:
  |
  | * A non-architectural reset that follows a SYSTEM_RESET2 call.
  | * An architectural reset that was invoked through calling
  |   SYSTEM_RESET2 with a request other than a SYSTEM_WARM_RESET.
  | * A system reset that follows a SYSTEM_RESET call.
  | * Removal of power, or any mechanism to reset or shutdown the system
  |   that is not described by this specification.

So, in fact, SYSTEM_RESET2 can be propagated to the firmware as-is for
reset types other than SYSTEM_WARM_RESET. This then permits the host to
pass additional information as part of a vendor reset type which is not
supported with SYSTEM_RESET.

Tweak the pKVM PSCI relay to repaint SYSTEM_RESET2 only when the reset
type is not an architected warm reset.

Bug: 395181307
Reported-by: default avatarKurt Huang <kurthuang@google.com>
Signed-off-by: default avatarWill Deacon <willdeacon@google.com>
Change-Id: I1e6196e197aa5935f559040bc4672d0cd3a148f6
parent 19e49dd6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment