mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
Revert "ANDROID: KVM: arm64: pkvm: Rerge get_num_hvc_args into handle_pvm_exit_hvc64"
This reverts commit addb3e1f47.
Bug: 233587962
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: Ia08e9c250eb792229249e650f521aa5c9945bd14
This commit is contained in:
@@ -251,11 +251,11 @@ static void handle_pvm_exit_sys64(struct kvm_vcpu *host_vcpu, struct kvm_vcpu *s
|
||||
}
|
||||
}
|
||||
|
||||
static void handle_pvm_exit_hvc64(struct kvm_vcpu *host_vcpu, struct kvm_vcpu *shadow_vcpu)
|
||||
static int get_num_hvc_args(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
int n, i;
|
||||
u32 psci_fn = smccc_get_function(vcpu);
|
||||
|
||||
switch (smccc_get_function(shadow_vcpu)) {
|
||||
switch (psci_fn) {
|
||||
/*
|
||||
* CPU_ON takes 3 arguments, however, to wake up the target vcpu the
|
||||
* host only needs to know the target's cpu_id, which is passed as the
|
||||
@@ -263,34 +263,37 @@ static void handle_pvm_exit_hvc64(struct kvm_vcpu *host_vcpu, struct kvm_vcpu *s
|
||||
*/
|
||||
case PSCI_0_2_FN_CPU_ON:
|
||||
case PSCI_0_2_FN64_CPU_ON:
|
||||
n = 2;
|
||||
break;
|
||||
return 1;
|
||||
|
||||
case PSCI_0_2_FN_CPU_OFF:
|
||||
case PSCI_0_2_FN_SYSTEM_OFF:
|
||||
|
||||
/* The KVM implementation of suspend doesn't use any arguments. */
|
||||
case PSCI_0_2_FN_CPU_SUSPEND:
|
||||
case PSCI_0_2_FN64_CPU_SUSPEND:
|
||||
n = 1;
|
||||
break;
|
||||
return 0;
|
||||
|
||||
case ARM_SMCCC_VENDOR_HYP_KVM_MEM_SHARE_FUNC_ID:
|
||||
fallthrough;
|
||||
case ARM_SMCCC_VENDOR_HYP_KVM_MEM_UNSHARE_FUNC_ID:
|
||||
n = 4;
|
||||
break;
|
||||
return 3;
|
||||
|
||||
/*
|
||||
* The rest are either blocked or handled by HYP, so we should
|
||||
* really never be here.
|
||||
*/
|
||||
/* The rest are either blocked or handled by hyp. */
|
||||
default:
|
||||
BUG();
|
||||
return -1;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
static void handle_pvm_exit_hvc64(struct kvm_vcpu *host_vcpu, struct kvm_vcpu *shadow_vcpu)
|
||||
{
|
||||
int i;
|
||||
|
||||
host_vcpu->arch.fault.esr_el2 = shadow_vcpu->arch.fault.esr_el2;
|
||||
|
||||
/* Pass the hvc function id (r0) as well as any potential arguments. */
|
||||
for (i = 0; i < n; i++)
|
||||
for (i = 0; i < get_num_hvc_args(shadow_vcpu) + 1; i++)
|
||||
vcpu_set_reg(host_vcpu, i, vcpu_get_reg(shadow_vcpu, i));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user