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 146146/* Coprocessor traps */
147147.macro __init_el2_cptr
148148 __check_hvhe .LnVHE_ \@, x1
149- mov x0 , #( CPACR_EL1_FPEN_EL1EN | CPACR_EL1_FPEN_EL0EN )
149+ mov x0 , #CPACR_ELx_FPEN
150150 msr cpacr_el1 , x0
151151 b .Lskip_set_cptr_ \@
152152.LnVHE_ \@:
277277
278278 // (h)VHE case
279279 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
281281 msr cpacr_el1 , x0
282282 b .Lskip_set_cptr_ \@
283283
298298
299299 // (h)VHE case
300300 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
302302 msr cpacr_el1 , x0
303303 b .Lskip_set_cptr_sme_ \@
304304
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)
632632 u64 val ;
633633
634634 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 );
637636 if (cpus_have_final_cap (ARM64_SME ))
638637 val |= CPACR_EL1_SMEN_EL1EN ;
639638 } else if (has_hvhe ()) {
640- val = ( CPACR_EL1_FPEN_EL0EN | CPACR_EL1_FPEN_EL1EN ) ;
639+ val = CPACR_ELx_FPEN ;
641640
642641 if (!vcpu_has_sve (vcpu ) || !guest_owns_fp_regs ())
643- val |= CPACR_EL1_ZEN_EL1EN | CPACR_EL1_ZEN_EL0EN ;
642+ val |= CPACR_ELx_ZEN ;
644643 if (cpus_have_final_cap (ARM64_SME ))
645- val |= CPACR_EL1_SMEN_EL1EN | CPACR_EL1_SMEN_EL0EN ;
644+ val |= CPACR_ELx_SMEN ;
646645 } else {
647646 val = CPTR_NVHE_EL2_RES1 ;
648647
Original file line number Diff line number Diff line change @@ -161,9 +161,7 @@ void kvm_arch_vcpu_put_fp(struct kvm_vcpu *vcpu)
161161 if (has_vhe () && system_supports_sme ()) {
162162 /* Also restore EL0 state seen on entry */
163163 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 );
167165 else
168166 sysreg_clear_set (CPACR_EL1 ,
169167 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)
6565 /* Trap SVE */
6666 if (!FIELD_GET (ARM64_FEATURE_MASK (ID_AA64PFR0_EL1_SVE ), feature_ids )) {
6767 if (has_hvhe ())
68- cptr_clear |= CPACR_EL1_ZEN_EL0EN | CPACR_EL1_ZEN_EL1EN ;
68+ cptr_clear |= CPACR_ELx_ZEN ;
6969 else
7070 cptr_set |= CPTR_EL2_TZ ;
7171 }
Original file line number Diff line number Diff line change @@ -48,15 +48,14 @@ static void __activate_traps(struct kvm_vcpu *vcpu)
4848 val |= has_hvhe () ? CPACR_EL1_TTA : CPTR_EL2_TTA ;
4949 if (cpus_have_final_cap (ARM64_SME )) {
5050 if (has_hvhe ())
51- val &= ~( CPACR_EL1_SMEN_EL1EN | CPACR_EL1_SMEN_EL0EN ) ;
51+ val &= ~CPACR_ELx_SMEN ;
5252 else
5353 val |= CPTR_EL2_TSM ;
5454 }
5555
5656 if (!guest_owns_fp_regs ()) {
5757 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 );
6059 else
6160 val |= CPTR_EL2_TFP | CPTR_EL2_TZ ;
6261
Original file line number Diff line number Diff line change @@ -93,8 +93,7 @@ static void __activate_traps(struct kvm_vcpu *vcpu)
9393
9494 val = read_sysreg (cpacr_el1 );
9595 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 );
9897
9998 /*
10099 * With VHE (HCR.E2H == 1), accesses to CPACR_EL1 are routed to
@@ -109,9 +108,9 @@ static void __activate_traps(struct kvm_vcpu *vcpu)
109108
110109 if (guest_owns_fp_regs ()) {
111110 if (vcpu_has_sve (vcpu ))
112- val |= CPACR_EL1_ZEN_EL0EN | CPACR_EL1_ZEN_EL1EN ;
111+ val |= CPACR_ELx_ZEN ;
113112 } else {
114- val &= ~( CPACR_EL1_FPEN_EL0EN | CPACR_EL1_FPEN_EL1EN ) ;
113+ val &= ~CPACR_ELx_FPEN ;
115114 __activate_traps_fpsimd32 (vcpu );
116115 }
117116
You can’t perform that action at this time.
0 commit comments