Commit 7cea3cee authored by Marc Zyngier's avatar Marc Zyngier Committed by Marc Zyngier
Browse files

ANDROID: KVM: arm64: Make the use of host or shadow vcpu less error prone



It isn't always obvious what vcpu (host or shadow) should be used
in which context, nor whether the provided vcpu is valid or not.

To make this less error prone, provide a helper that will always
return a vcpu in the HYP address space as well as the corresponding
shadow state if we're in protected mode. If the host-provided vcpu
doesn't match the loaded vcpu, NULL is returned for both pointers.

In non-protected mode, no state is provided, of course, but the vcpu
is converted to its HYP pointer.

Bug: 227292021
Bug: 227768863
Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
Signed-off-by: default avatarMarc Zyngier <mzyngier@google.com>
Change-Id: Idcfc4e042ff05d97ae52f7991666935c1c570f10
parent 176c157b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment