mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
Revert "ANDROID: KVM: arm64: relay entropy requests from protected guests directly to secure"
This reverts commit 888643ea37.
Bug: 233587962
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: Id3a09089934bf4aa1ad283d79cf8710bab9775d5
This commit is contained in:
@@ -124,5 +124,4 @@ extern u64 kvm_nvhe_sym(id_aa64mmfr1_el1_sys_val);
|
||||
extern u64 kvm_nvhe_sym(id_aa64mmfr2_el1_sys_val);
|
||||
|
||||
extern unsigned long kvm_nvhe_sym(__icache_flags);
|
||||
extern bool kvm_nvhe_sym(smccc_trng_available);
|
||||
#endif /* __ARM64_KVM_HYP_H__ */
|
||||
|
||||
@@ -2021,7 +2021,6 @@ static int kvm_hyp_init_protection(u32 hyp_va_bits)
|
||||
kvm_nvhe_sym(id_aa64mmfr1_el1_sys_val) = read_sanitised_ftr_reg(SYS_ID_AA64MMFR1_EL1);
|
||||
kvm_nvhe_sym(id_aa64mmfr2_el1_sys_val) = read_sanitised_ftr_reg(SYS_ID_AA64MMFR2_EL1);
|
||||
kvm_nvhe_sym(__icache_flags) = __icache_flags;
|
||||
kvm_nvhe_sym(smccc_trng_available) = smccc_trng_available;
|
||||
|
||||
ret = create_hyp_mappings(addr, addr + hyp_mem_size, PAGE_HYP);
|
||||
if (ret)
|
||||
|
||||
@@ -1137,35 +1137,6 @@ static bool pkvm_install_ioguard_page(struct kvm_vcpu *vcpu, u64 *exit_code)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool smccc_trng_available;
|
||||
|
||||
static bool pkvm_forward_trng(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
u32 fn = smccc_get_function(vcpu);
|
||||
struct arm_smccc_res res;
|
||||
unsigned long arg1 = 0;
|
||||
|
||||
/*
|
||||
* Forward TRNG calls to EL3, as we can't trust the host to handle
|
||||
* these for us.
|
||||
*/
|
||||
switch (fn) {
|
||||
case ARM_SMCCC_TRNG_FEATURES:
|
||||
case ARM_SMCCC_TRNG_RND32:
|
||||
case ARM_SMCCC_TRNG_RND64:
|
||||
arg1 = smccc_get_arg1(vcpu);
|
||||
fallthrough;
|
||||
case ARM_SMCCC_TRNG_VERSION:
|
||||
case ARM_SMCCC_TRNG_GET_UUID:
|
||||
arm_smccc_1_1_smc(fn, arg1, &res);
|
||||
smccc_set_retval(vcpu, res.a0, res.a1, res.a2, res.a3);
|
||||
memzero_explicit(&res, sizeof(res));
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* Handler for protected VM HVC calls.
|
||||
*
|
||||
@@ -1222,11 +1193,6 @@ bool kvm_handle_pvm_hvc64(struct kvm_vcpu *vcpu, u64 *exit_code)
|
||||
return pkvm_memshare_call(vcpu, exit_code);
|
||||
case ARM_SMCCC_VENDOR_HYP_KVM_MEM_UNSHARE_FUNC_ID:
|
||||
return pkvm_memunshare_call(vcpu);
|
||||
case ARM_SMCCC_TRNG_VERSION ... ARM_SMCCC_TRNG_RND32:
|
||||
case ARM_SMCCC_TRNG_RND64:
|
||||
if (smccc_trng_available)
|
||||
return pkvm_forward_trng(vcpu);
|
||||
break;
|
||||
default:
|
||||
return pkvm_handle_psci(vcpu);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user