This repository was archived by the owner on Nov 8, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +14
-19
lines changed Expand file tree Collapse file tree 6 files changed +14
-19
lines changed Original file line number Diff line number Diff line change 146
146
/* Coprocessor traps */
147
147
.macro __init_el2_cptr
148
148
__check_hvhe .LnVHE_ \@, x1
149
- mov x0 , #( CPACR_EL1_FPEN_EL1EN | CPACR_EL1_FPEN_EL0EN )
149
+ mov x0 , #CPACR_ELx_FPEN
150
150
msr cpacr_el1 , x0
151
151
b .Lskip_set_cptr_ \@
152
152
.LnVHE_ \@:
277
277
278
278
// (h)VHE case
279
279
mrs x0 , cpacr_el1 // Disable SVE traps
280
- orr x0 , x0 , #( CPACR_EL1_ZEN_EL1EN | CPACR_EL1_ZEN_EL0EN )
280
+ orr x0 , x0 , #CPACR_ELx_ZEN
281
281
msr cpacr_el1 , x0
282
282
b .Lskip_set_cptr_ \@
283
283
298
298
299
299
// (h)VHE case
300
300
mrs x0 , cpacr_el1 // Disable SME traps
301
- orr x0 , x0 , #( CPACR_EL1_SMEN_EL0EN | CPACR_EL1_SMEN_EL1EN )
301
+ orr x0 , x0 , #CPACR_ELx_SMEN
302
302
msr cpacr_el1 , x0
303
303
b .Lskip_set_cptr_sme_ \@
304
304
Original file line number Diff line number Diff line change @@ -632,17 +632,16 @@ static __always_inline u64 kvm_get_reset_cptr_el2(struct kvm_vcpu *vcpu)
632
632
u64 val ;
633
633
634
634
if (has_vhe ()) {
635
- val = (CPACR_EL1_FPEN_EL0EN | CPACR_EL1_FPEN_EL1EN |
636
- CPACR_EL1_ZEN_EL1EN );
635
+ val = (CPACR_ELx_FPEN | CPACR_EL1_ZEN_EL1EN );
637
636
if (cpus_have_final_cap (ARM64_SME ))
638
637
val |= CPACR_EL1_SMEN_EL1EN ;
639
638
} else if (has_hvhe ()) {
640
- val = ( CPACR_EL1_FPEN_EL0EN | CPACR_EL1_FPEN_EL1EN ) ;
639
+ val = CPACR_ELx_FPEN ;
641
640
642
641
if (!vcpu_has_sve (vcpu ) || !guest_owns_fp_regs ())
643
- val |= CPACR_EL1_ZEN_EL1EN | CPACR_EL1_ZEN_EL0EN ;
642
+ val |= CPACR_ELx_ZEN ;
644
643
if (cpus_have_final_cap (ARM64_SME ))
645
- val |= CPACR_EL1_SMEN_EL1EN | CPACR_EL1_SMEN_EL0EN ;
644
+ val |= CPACR_ELx_SMEN ;
646
645
} else {
647
646
val = CPTR_NVHE_EL2_RES1 ;
648
647
Original file line number Diff line number Diff line change @@ -161,9 +161,7 @@ void kvm_arch_vcpu_put_fp(struct kvm_vcpu *vcpu)
161
161
if (has_vhe () && system_supports_sme ()) {
162
162
/* Also restore EL0 state seen on entry */
163
163
if (vcpu_get_flag (vcpu , HOST_SME_ENABLED ))
164
- sysreg_clear_set (CPACR_EL1 , 0 ,
165
- CPACR_EL1_SMEN_EL0EN |
166
- CPACR_EL1_SMEN_EL1EN );
164
+ sysreg_clear_set (CPACR_EL1 , 0 , CPACR_ELx_SMEN );
167
165
else
168
166
sysreg_clear_set (CPACR_EL1 ,
169
167
CPACR_EL1_SMEN_EL0EN ,
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ static void pvm_init_traps_aa64pfr0(struct kvm_vcpu *vcpu)
65
65
/* Trap SVE */
66
66
if (!FIELD_GET (ARM64_FEATURE_MASK (ID_AA64PFR0_EL1_SVE ), feature_ids )) {
67
67
if (has_hvhe ())
68
- cptr_clear |= CPACR_EL1_ZEN_EL0EN | CPACR_EL1_ZEN_EL1EN ;
68
+ cptr_clear |= CPACR_ELx_ZEN ;
69
69
else
70
70
cptr_set |= CPTR_EL2_TZ ;
71
71
}
Original file line number Diff line number Diff line change @@ -48,15 +48,14 @@ static void __activate_traps(struct kvm_vcpu *vcpu)
48
48
val |= has_hvhe () ? CPACR_EL1_TTA : CPTR_EL2_TTA ;
49
49
if (cpus_have_final_cap (ARM64_SME )) {
50
50
if (has_hvhe ())
51
- val &= ~( CPACR_EL1_SMEN_EL1EN | CPACR_EL1_SMEN_EL0EN ) ;
51
+ val &= ~CPACR_ELx_SMEN ;
52
52
else
53
53
val |= CPTR_EL2_TSM ;
54
54
}
55
55
56
56
if (!guest_owns_fp_regs ()) {
57
57
if (has_hvhe ())
58
- val &= ~(CPACR_EL1_FPEN_EL0EN | CPACR_EL1_FPEN_EL1EN |
59
- CPACR_EL1_ZEN_EL0EN | CPACR_EL1_ZEN_EL1EN );
58
+ val &= ~(CPACR_ELx_FPEN | CPACR_ELx_ZEN );
60
59
else
61
60
val |= CPTR_EL2_TFP | CPTR_EL2_TZ ;
62
61
Original file line number Diff line number Diff line change @@ -93,8 +93,7 @@ static void __activate_traps(struct kvm_vcpu *vcpu)
93
93
94
94
val = read_sysreg (cpacr_el1 );
95
95
val |= CPACR_ELx_TTA ;
96
- val &= ~(CPACR_EL1_ZEN_EL0EN | CPACR_EL1_ZEN_EL1EN |
97
- CPACR_EL1_SMEN_EL0EN | CPACR_EL1_SMEN_EL1EN );
96
+ val &= ~(CPACR_ELx_ZEN | CPACR_ELx_SMEN );
98
97
99
98
/*
100
99
* With VHE (HCR.E2H == 1), accesses to CPACR_EL1 are routed to
@@ -109,9 +108,9 @@ static void __activate_traps(struct kvm_vcpu *vcpu)
109
108
110
109
if (guest_owns_fp_regs ()) {
111
110
if (vcpu_has_sve (vcpu ))
112
- val |= CPACR_EL1_ZEN_EL0EN | CPACR_EL1_ZEN_EL1EN ;
111
+ val |= CPACR_ELx_ZEN ;
113
112
} else {
114
- val &= ~( CPACR_EL1_FPEN_EL0EN | CPACR_EL1_FPEN_EL1EN ) ;
113
+ val &= ~CPACR_ELx_FPEN ;
115
114
__activate_traps_fpsimd32 (vcpu );
116
115
}
117
116
You can’t perform that action at this time.
0 commit comments