ANDROID: KVM: arm64: Use enum instead of helper for fp state

Before the conversion of the various booleans into an enum
representing the state,  this helper clarified things. Since the
introduction of the enum, the helper obfuscates rather than
helps.

No functional change intended.

Signed-off-by: Fuad Tabba <tabba@google.com>

Bug: 267291591
Change-Id: I83c870146ed2d910bf10d625d1048b95c8b23736
This commit is contained in:
Fuad Tabba
2023-02-06 13:06:45 +00:00
committed by Lee Jones
parent d5a33d3bbd
commit fe89068583
3 changed files with 2 additions and 8 deletions

View File

@@ -33,12 +33,6 @@
extern struct exception_table_entry __start___kvm_ex_table;
extern struct 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)
{

View File

@@ -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 (!guest_owns_fp_regs(vcpu)) {
if (vcpu->arch.fp_state != FP_STATE_GUEST_OWNED) {
val |= CPTR_EL2_TFP | CPTR_EL2_TZ;
__activate_traps_fpsimd32(vcpu);
}

View File

@@ -55,7 +55,7 @@ static void __activate_traps(struct kvm_vcpu *vcpu)
val |= CPTR_EL2_TAM;
if (guest_owns_fp_regs(vcpu)) {
if (vcpu->arch.fp_state == FP_STATE_GUEST_OWNED) {
if (vcpu_has_sve(vcpu))
val |= CPACR_EL1_ZEN_EL0EN | CPACR_EL1_ZEN_EL1EN;
} else {