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:Marc Zyngier <maz@kernel.org> Signed-off-by:
Marc Zyngier <mzyngier@google.com> Change-Id: Idcfc4e042ff05d97ae52f7991666935c1c570f10
Loading
Please sign in to comment