Skip to content

Commit 3a300a3

Browse files
mrutland-armMarc Zyngier
authored andcommitted
KVM: arm64: Remove cpacr_clear_set()
We no longer use cpacr_clear_set(). Remove cpacr_clear_set() and its helper functions. Signed-off-by: Mark Rutland <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Fuad Tabba <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Mark Brown <[email protected]> Cc: Oliver Upton <[email protected]> Cc: Will Deacon <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Zyngier <[email protected]>
1 parent 186b58b commit 3a300a3

File tree

1 file changed

+0
-62
lines changed

1 file changed

+0
-62
lines changed

arch/arm64/include/asm/kvm_emulate.h

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -561,68 +561,6 @@ static __always_inline void kvm_incr_pc(struct kvm_vcpu *vcpu)
561561
vcpu_set_flag((v), e); \
562562
} while (0)
563563

564-
#define __build_check_all_or_none(r, bits) \
565-
BUILD_BUG_ON(((r) & (bits)) && ((r) & (bits)) != (bits))
566-
567-
#define __cpacr_to_cptr_clr(clr, set) \
568-
({ \
569-
u64 cptr = 0; \
570-
\
571-
if ((set) & CPACR_EL1_FPEN) \
572-
cptr |= CPTR_EL2_TFP; \
573-
if ((set) & CPACR_EL1_ZEN) \
574-
cptr |= CPTR_EL2_TZ; \
575-
if ((set) & CPACR_EL1_SMEN) \
576-
cptr |= CPTR_EL2_TSM; \
577-
if ((clr) & CPACR_EL1_TTA) \
578-
cptr |= CPTR_EL2_TTA; \
579-
if ((clr) & CPTR_EL2_TAM) \
580-
cptr |= CPTR_EL2_TAM; \
581-
if ((clr) & CPTR_EL2_TCPAC) \
582-
cptr |= CPTR_EL2_TCPAC; \
583-
\
584-
cptr; \
585-
})
586-
587-
#define __cpacr_to_cptr_set(clr, set) \
588-
({ \
589-
u64 cptr = 0; \
590-
\
591-
if ((clr) & CPACR_EL1_FPEN) \
592-
cptr |= CPTR_EL2_TFP; \
593-
if ((clr) & CPACR_EL1_ZEN) \
594-
cptr |= CPTR_EL2_TZ; \
595-
if ((clr) & CPACR_EL1_SMEN) \
596-
cptr |= CPTR_EL2_TSM; \
597-
if ((set) & CPACR_EL1_TTA) \
598-
cptr |= CPTR_EL2_TTA; \
599-
if ((set) & CPTR_EL2_TAM) \
600-
cptr |= CPTR_EL2_TAM; \
601-
if ((set) & CPTR_EL2_TCPAC) \
602-
cptr |= CPTR_EL2_TCPAC; \
603-
\
604-
cptr; \
605-
})
606-
607-
#define cpacr_clear_set(clr, set) \
608-
do { \
609-
BUILD_BUG_ON((set) & CPTR_VHE_EL2_RES0); \
610-
BUILD_BUG_ON((clr) & CPACR_EL1_E0POE); \
611-
__build_check_all_or_none((clr), CPACR_EL1_FPEN); \
612-
__build_check_all_or_none((set), CPACR_EL1_FPEN); \
613-
__build_check_all_or_none((clr), CPACR_EL1_ZEN); \
614-
__build_check_all_or_none((set), CPACR_EL1_ZEN); \
615-
__build_check_all_or_none((clr), CPACR_EL1_SMEN); \
616-
__build_check_all_or_none((set), CPACR_EL1_SMEN); \
617-
\
618-
if (has_vhe() || has_hvhe()) \
619-
sysreg_clear_set(cpacr_el1, clr, set); \
620-
else \
621-
sysreg_clear_set(cptr_el2, \
622-
__cpacr_to_cptr_clr(clr, set), \
623-
__cpacr_to_cptr_set(clr, set));\
624-
} while (0)
625-
626564
/*
627565
* Returns a 'sanitised' view of CPTR_EL2, translating from nVHE to the VHE
628566
* format if E2H isn't set.

0 commit comments

Comments
 (0)