mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 20:32:04 +09:00
Revert "ANDROID: KVM: arm64: Do not pass host struct pointers to pkvm_vcpu_sync_state()"
This reverts commit 6733943e55.
Bug: 233587962
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I074a996bc6344119c6edb732ae86d230f4f1ad35
This commit is contained in:
@@ -210,7 +210,7 @@ static int handle_trap_exceptions(struct kvm_vcpu *vcpu)
|
||||
if (is_protected_kvm_enabled() && !kvm_vm_is_protected(vcpu->kvm)) {
|
||||
preempt_disable();
|
||||
if (!(vcpu->arch.flags & KVM_ARM64_PKVM_STATE_DIRTY)) {
|
||||
kvm_call_hyp_nvhe(__pkvm_vcpu_sync_state);
|
||||
kvm_call_hyp_nvhe(__pkvm_vcpu_sync_state, vcpu);
|
||||
vcpu->arch.flags |= KVM_ARM64_PKVM_STATE_DIRTY;
|
||||
}
|
||||
preempt_enable();
|
||||
|
||||
@@ -690,10 +690,15 @@ static void handle___pkvm_vcpu_put(struct kvm_cpu_context *host_ctxt)
|
||||
|
||||
static void handle___pkvm_vcpu_sync_state(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 || state->is_protected)
|
||||
vcpu = kern_hyp_va(vcpu);
|
||||
|
||||
if (!state->vcpu || state->is_protected ||
|
||||
state->vcpu->arch.pkvm.host_vcpu != vcpu)
|
||||
return;
|
||||
|
||||
__sync_vcpu_state(state->vcpu);
|
||||
|
||||
Reference in New Issue
Block a user