mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
Revert "ANDROID: KVM: arm64: Do not pass host struct pointers to pkvm_vcpu_put()"
This reverts commit 0e6b940fce.
Bug: 233587962
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I9224bc31e330d201c5fe13b5bfe92fdcc270fcd9
This commit is contained in:
@@ -567,7 +567,7 @@ void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu)
|
||||
if (is_protected_kvm_enabled()) {
|
||||
kvm_call_hyp(__vgic_v3_save_vmcr_aprs,
|
||||
&vcpu->arch.vgic_cpu.vgic_v3);
|
||||
kvm_call_hyp_nvhe(__pkvm_vcpu_put);
|
||||
kvm_call_hyp_nvhe(__pkvm_vcpu_put, vcpu);
|
||||
|
||||
/* __pkvm_vcpu_put implies a sync of the state */
|
||||
if (!kvm_vm_is_protected(vcpu->kvm))
|
||||
|
||||
@@ -665,17 +665,19 @@ static void handle___pkvm_vcpu_load(struct kvm_cpu_context *host_ctxt)
|
||||
|
||||
static void handle___pkvm_vcpu_put(struct kvm_cpu_context *host_ctxt)
|
||||
{
|
||||
DECLARE_REG(struct kvm_vcpu *, vcpu, host_ctxt, 1);
|
||||
|
||||
if (unlikely(is_protected_kvm_enabled())) {
|
||||
struct pkvm_loaded_state *state = this_cpu_ptr(&loaded_state);
|
||||
|
||||
if (state->vcpu) {
|
||||
struct kvm_vcpu *host_vcpu = state->vcpu->arch.pkvm.host_vcpu;
|
||||
vcpu = kern_hyp_va(vcpu);
|
||||
|
||||
if (state->vcpu && state->vcpu->arch.pkvm.host_vcpu == vcpu) {
|
||||
if (state->vcpu->arch.flags & KVM_ARM64_FP_ENABLED)
|
||||
fpsimd_host_restore();
|
||||
|
||||
if (!state->is_protected &&
|
||||
!(READ_ONCE(host_vcpu->arch.flags) & KVM_ARM64_PKVM_STATE_DIRTY))
|
||||
!(READ_ONCE(vcpu->arch.flags) & KVM_ARM64_PKVM_STATE_DIRTY))
|
||||
__sync_vcpu_state(state->vcpu);
|
||||
|
||||
put_shadow_vcpu(state->vcpu);
|
||||
|
||||
Reference in New Issue
Block a user