mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 02:21:52 +09:00
Revert "ANDROID: KVM: arm64: Use enum instead of helper for fp state"
This reverts commit 26d24625b3, which
didn't introduce any functional change. This is reverted because
backported commits rely on the helpers that the commit has removed.
Reverting it makes it easier and cleaner to apply the backports.
No functional change intended.
Bug: 411040189
Change-Id: Ie29ece274cfc970cf116f8781b841b9ac2c5aa56
Signed-off-by: Fuad Tabba <tabba@google.com>
This commit is contained in:
@@ -37,6 +37,12 @@ struct kvm_exception_table_entry {
|
||||
extern struct kvm_exception_table_entry __start___kvm_ex_table;
|
||||
extern struct kvm_exception_table_entry __stop___kvm_ex_table;
|
||||
|
||||
/* Check whether the FP regs are owned by the guest */
|
||||
static inline bool guest_owns_fp_regs(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
return vcpu->arch.fp_state == FP_STATE_GUEST_OWNED;
|
||||
}
|
||||
|
||||
/* Save the 32-bit only FPSIMD system register state */
|
||||
static inline void __fpsimd_save_fpexc32(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
|
||||
@@ -45,7 +45,7 @@ static void __activate_traps(struct kvm_vcpu *vcpu)
|
||||
|
||||
val = vcpu->arch.cptr_el2;
|
||||
val |= CPTR_EL2_TTA | CPTR_EL2_TAM;
|
||||
if (vcpu->arch.fp_state != FP_STATE_GUEST_OWNED) {
|
||||
if (!guest_owns_fp_regs(vcpu)) {
|
||||
val |= CPTR_EL2_TFP | CPTR_EL2_TZ;
|
||||
__activate_traps_fpsimd32(vcpu);
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ static void __activate_traps(struct kvm_vcpu *vcpu)
|
||||
|
||||
val |= CPTR_EL2_TAM;
|
||||
|
||||
if (vcpu->arch.fp_state == FP_STATE_GUEST_OWNED) {
|
||||
if (guest_owns_fp_regs(vcpu)) {
|
||||
if (vcpu_has_sve(vcpu))
|
||||
val |= CPACR_EL1_ZEN_EL0EN | CPACR_EL1_ZEN_EL1EN;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user