Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
1244210
arm64/sysreg: Add definition for ID_AA64PFR2_EL1
broonie Dec 9, 2023
723d688
arm64/sysreg: Update ID_AA64ISAR2_EL1 defintion for DDI0601 2023-09
broonie Dec 9, 2023
0d03de5
arm64/sysreg: Add definition for ID_AA64ISAR3_EL1
broonie Dec 9, 2023
24fc9aa
arm64/sysreg: Add definition for ID_AA64FPFR0_EL1
broonie Dec 9, 2023
fece9c8
arm64/sysreg: Update ID_AA64SMFR0_EL1 definition for DDI0601 2023-09
broonie Dec 9, 2023
3fdec64
arm64/sysreg: Update SCTLR_EL1 for DDI0601 2023-09
broonie Dec 9, 2023
4aa9c59
arm64/sysreg: Update HCRX_EL2 definition for DDI0601 2023-09
broonie Dec 9, 2023
54a33da
arm64/sysreg: Add definition for FPMR
broonie Dec 9, 2023
ae20126
arm64/fpsimd: Add fpsimd_save_and_flush_current_state()
mrutland-arm Apr 9, 2025
973a914
arm64/fpsimd: signal32: Always save+flush state early
mrutland-arm Apr 9, 2025
446a96e
arm64/sve: Report FEAT_SVE_B16B16 to userspace
broonie Sep 15, 2023
646c529
kselftest/arm64: Verify HWCAP2_SVE_B16B16
broonie Sep 15, 2023
eb84abb
arm64/cpufeature: Hook new identification registers up to cpufeature
broonie Mar 6, 2024
8d1eae2
arm64/fpsimd: Enable host kernel access to FPMR
broonie Mar 6, 2024
c154713
arm64/fpsimd: Support FEAT_FPMR
broonie Mar 6, 2024
061e877
arm64/signal: Add FPMR signal handling
broonie Mar 6, 2024
4170e5f
arm64/ptrace: Expose FPMR via ptrace
broonie Mar 6, 2024
3781baf
arm64/hwcap: Define hwcaps for 2023 DPISA features
broonie Mar 6, 2024
71eef2b
kselftest/arm64: Handle FPMR context in generic signal frame parser
broonie Mar 6, 2024
484c0f7
kselftest/arm64: Add basic FPMR test
broonie Mar 6, 2024
ba736db
kselftest/arm64: Add 2023 DPISA hwcap test coverage
broonie Mar 6, 2024
83c2279
arm64: ptrace: fix partial SETREGSET for NT_ARM_FPMR
mrutland-arm Dec 5, 2024
2a943c9
arm64/fpsimd: Don't corrupt FPMR when streaming mode changes
broonie Apr 9, 2025
7ee62e4
arm64/fpsimd: Reset FPMR upon exec()
mrutland-arm Apr 9, 2025
12dc55f
kselftest/arm64: hwcap: fix f8dp2 cpuinfo name
Andre-ARM Aug 16, 2024
3c65fd8
kselftest/arm64: Fix encoding for SVE B16B16 test
broonie Oct 28, 2024
a381a55
arm64/fpsimd: signal: Always save+flush state early
mrutland-arm Apr 9, 2025
939cf75
arm64/fpsimd: Avoid warning when sve_to_fpsimd() is unused
mrutland-arm Apr 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Documentation/arch/arm64/cpu-feature-registers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,8 @@ infrastructure:
+------------------------------+---------+---------+
| SHA3 | [35-32] | y |
+------------------------------+---------+---------+
| B16B16 | [27-24] | y |
+------------------------------+---------+---------+
| BF16 | [23-20] | y |
+------------------------------+---------+---------+
| BitPerm | [19-16] | y |
Expand Down
52 changes: 52 additions & 0 deletions Documentation/arch/arm64/elf_hwcaps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -320,12 +320,64 @@ HWCAP2_MOPS
HWCAP2_HBC
Functionality implied by ID_AA64ISAR2_EL1.BC == 0b0001.

HWCAP2_SVE_B16B16
Functionality implied by ID_AA64ZFR0_EL1.B16B16 == 0b0001.

HWCAP3_LS64
Functionality implied by ID_AA64ISAR1_EL1.LS64 == 0b0001.

HWCAP3_LS64_V
Functionality implied by ID_AA64ISAR1_EL1.LS64 == 0b0010.

HWCAP2_FPMR
Functionality implied by ID_AA64PFR2_EL1.FMR == 0b0001.

HWCAP2_LUT
Functionality implied by ID_AA64ISAR2_EL1.LUT == 0b0001.

HWCAP2_FAMINMAX
Functionality implied by ID_AA64ISAR3_EL1.FAMINMAX == 0b0001.

HWCAP2_F8CVT
Functionality implied by ID_AA64FPFR0_EL1.F8CVT == 0b1.

HWCAP2_F8FMA
Functionality implied by ID_AA64FPFR0_EL1.F8FMA == 0b1.

HWCAP2_F8DP4
Functionality implied by ID_AA64FPFR0_EL1.F8DP4 == 0b1.

HWCAP2_F8DP2
Functionality implied by ID_AA64FPFR0_EL1.F8DP2 == 0b1.

HWCAP2_F8E4M3
Functionality implied by ID_AA64FPFR0_EL1.F8E4M3 == 0b1.

HWCAP2_F8E5M2
Functionality implied by ID_AA64FPFR0_EL1.F8E5M2 == 0b1.

HWCAP2_SME_LUTV2
Functionality implied by ID_AA64SMFR0_EL1.LUTv2 == 0b1.

HWCAP2_SME_F8F16
Functionality implied by ID_AA64SMFR0_EL1.F8F16 == 0b1.

HWCAP2_SME_F8F32
Functionality implied by ID_AA64SMFR0_EL1.F8F32 == 0b1.

HWCAP2_SME_SF8FMA
Functionality implied by ID_AA64SMFR0_EL1.SF8FMA == 0b1.

HWCAP2_SME_SF8DP4
Functionality implied by ID_AA64SMFR0_EL1.SF8DP4 == 0b1.

HWCAP2_SME_SF8DP2
Functionality implied by ID_AA64SMFR0_EL1.SF8DP2 == 0b1.

HWCAP2_SME_SF8DP4
Functionality implied by ID_AA64SMFR0_EL1.SF8DP4 == 0b1.


4. Unused AT_HWCAP bits
-----------------------

Expand Down
3 changes: 3 additions & 0 deletions arch/arm64/include/asm/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,17 @@ struct cpuinfo_arm64 {
u64 reg_id_aa64isar0;
u64 reg_id_aa64isar1;
u64 reg_id_aa64isar2;
u64 reg_id_aa64isar3;
u64 reg_id_aa64mmfr0;
u64 reg_id_aa64mmfr1;
u64 reg_id_aa64mmfr2;
u64 reg_id_aa64mmfr3;
u64 reg_id_aa64pfr0;
u64 reg_id_aa64pfr1;
u64 reg_id_aa64pfr2;
u64 reg_id_aa64zfr0;
u64 reg_id_aa64smfr0;
u64 reg_id_aa64fpfr0;

struct cpuinfo_32bit aarch32;

Expand Down
5 changes: 5 additions & 0 deletions arch/arm64/include/asm/cpufeature.h
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,11 @@ static __always_inline bool system_supports_tpidr2(void)
return system_supports_sme();
}

static __always_inline bool system_supports_fpmr(void)
{
return alternative_has_cap_unlikely(ARM64_HAS_FPMR);
}

static __always_inline bool system_supports_cnp(void)
{
return alternative_has_cap_unlikely(ARM64_HAS_CNP);
Expand Down
4 changes: 3 additions & 1 deletion arch/arm64/include/asm/fpsimd.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ extern void fpsimd_load_state(struct user_fpsimd_state *state);
extern void fpsimd_thread_switch(struct task_struct *next);
extern void fpsimd_flush_thread(void);

extern void fpsimd_signal_preserve_current_state(void);
extern void fpsimd_preserve_current_state(void);
extern void fpsimd_restore_current_state(void);
extern void fpsimd_update_current_state(struct user_fpsimd_state const *state);
Expand All @@ -90,6 +89,7 @@ struct cpu_fp_state {
void *sve_state;
void *sme_state;
u64 *svcr;
u64 *fpmr;
unsigned int sve_vl;
unsigned int sme_vl;
enum fp_type *fp_type;
Expand All @@ -101,6 +101,7 @@ DECLARE_PER_CPU(struct cpu_fp_state, fpsimd_last_state);
extern void fpsimd_bind_state_to_cpu(struct cpu_fp_state *fp_state);

extern void fpsimd_flush_task_state(struct task_struct *target);
extern void fpsimd_save_and_flush_current_state(void);
extern void fpsimd_save_and_flush_cpu_state(void);

static inline bool thread_sm_enabled(struct thread_struct *thread)
Expand Down Expand Up @@ -157,6 +158,7 @@ extern void cpu_enable_sve(const struct arm64_cpu_capabilities *__unused);
extern void cpu_enable_sme(const struct arm64_cpu_capabilities *__unused);
extern void cpu_enable_sme2(const struct arm64_cpu_capabilities *__unused);
extern void cpu_enable_fa64(const struct arm64_cpu_capabilities *__unused);
extern void cpu_enable_fpmr(const struct arm64_cpu_capabilities *__unused);

extern u64 read_zcr_features(void);
extern u64 read_smcr_features(void);
Expand Down
16 changes: 16 additions & 0 deletions arch/arm64/include/asm/hwcap.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,22 @@
#define KERNEL_HWCAP_SME_F16F16 __khwcap2_feature(SME_F16F16)
#define KERNEL_HWCAP_MOPS __khwcap2_feature(MOPS)
#define KERNEL_HWCAP_HBC __khwcap2_feature(HBC)
#define KERNEL_HWCAP_SVE_B16B16 __khwcap2_feature(SVE_B16B16)
#define KERNEL_HWCAP_FPMR __khwcap2_feature(FPMR)
#define KERNEL_HWCAP_LUT __khwcap2_feature(LUT)
#define KERNEL_HWCAP_FAMINMAX __khwcap2_feature(FAMINMAX)
#define KERNEL_HWCAP_F8CVT __khwcap2_feature(F8CVT)
#define KERNEL_HWCAP_F8FMA __khwcap2_feature(F8FMA)
#define KERNEL_HWCAP_F8DP4 __khwcap2_feature(F8DP4)
#define KERNEL_HWCAP_F8DP2 __khwcap2_feature(F8DP2)
#define KERNEL_HWCAP_F8E4M3 __khwcap2_feature(F8E4M3)
#define KERNEL_HWCAP_F8E5M2 __khwcap2_feature(F8E5M2)
#define KERNEL_HWCAP_SME_LUTV2 __khwcap2_feature(SME_LUTV2)
#define KERNEL_HWCAP_SME_F8F16 __khwcap2_feature(SME_F8F16)
#define KERNEL_HWCAP_SME_F8F32 __khwcap2_feature(SME_F8F32)
#define KERNEL_HWCAP_SME_SF8FMA __khwcap2_feature(SME_SF8FMA)
#define KERNEL_HWCAP_SME_SF8DP4 __khwcap2_feature(SME_SF8DP4)
#define KERNEL_HWCAP_SME_SF8DP2 __khwcap2_feature(SME_SF8DP2)

#define __khwcap3_feature(x) (const_ilog2(HWCAP3_ ## x) + 128)
#define KERNEL_HWCAP_LS64 __khwcap3_feature(LS64)
Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/include/asm/kvm_arm.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
#define HCR_HOST_VHE_FLAGS (HCR_RW | HCR_TGE | HCR_E2H)

#define HCRX_GUEST_FLAGS (HCRX_EL2_SMPME | HCRX_EL2_TCR2En)
#define HCRX_HOST_FLAGS (HCRX_EL2_MSCEn | HCRX_EL2_TCR2En)
#define HCRX_HOST_FLAGS (HCRX_EL2_MSCEn | HCRX_EL2_TCR2En | HCRX_EL2_EnFPM)

/* TCR_EL2 Registers bits */
#define TCR_EL2_DS (1UL << 32)
Expand Down
1 change: 1 addition & 0 deletions arch/arm64/include/asm/kvm_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@ struct kvm_vcpu_arch {
enum fp_type fp_type;
unsigned int sve_max_vl;
u64 svcr;
u64 fpmr;

/* Stage 2 paging state used by the hardware on next switch */
struct kvm_s2_mmu *hw_mmu;
Expand Down
4 changes: 4 additions & 0 deletions arch/arm64/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ struct thread_struct {
struct {
unsigned long tp_value; /* TLS register */
unsigned long tp2_value;
u64 fpmr;
unsigned long pad;
struct user_fpsimd_state fpsimd_state;
} uw;

Expand Down Expand Up @@ -250,6 +252,8 @@ static inline void arch_thread_struct_whitelist(unsigned long *offset,
BUILD_BUG_ON(sizeof_field(struct thread_struct, uw) !=
sizeof_field(struct thread_struct, uw.tp_value) +
sizeof_field(struct thread_struct, uw.tp2_value) +
sizeof_field(struct thread_struct, uw.fpmr) +
sizeof_field(struct thread_struct, uw.pad) +
sizeof_field(struct thread_struct, uw.fpsimd_state));

*offset = offsetof(struct thread_struct, uw);
Expand Down
16 changes: 16 additions & 0 deletions arch/arm64/include/uapi/asm/hwcap.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,22 @@
#define HWCAP2_SME_F16F16 (1UL << 42)
#define HWCAP2_MOPS (1UL << 43)
#define HWCAP2_HBC (1UL << 44)
#define HWCAP2_SVE_B16B16 (1UL << 45)
#define HWCAP2_FPMR (1UL << 48)
#define HWCAP2_LUT (1UL << 49)
#define HWCAP2_FAMINMAX (1UL << 50)
#define HWCAP2_F8CVT (1UL << 51)
#define HWCAP2_F8FMA (1UL << 52)
#define HWCAP2_F8DP4 (1UL << 53)
#define HWCAP2_F8DP2 (1UL << 54)
#define HWCAP2_F8E4M3 (1UL << 55)
#define HWCAP2_F8E5M2 (1UL << 56)
#define HWCAP2_SME_LUTV2 (1UL << 57)
#define HWCAP2_SME_F8F16 (1UL << 58)
#define HWCAP2_SME_F8F32 (1UL << 59)
#define HWCAP2_SME_SF8FMA (1UL << 60)
#define HWCAP2_SME_SF8DP4 (1UL << 61)
#define HWCAP2_SME_SF8DP2 (1UL << 62)

/*
* HWCAP3 flags - for AT_HWCAP3
Expand Down
8 changes: 8 additions & 0 deletions arch/arm64/include/uapi/asm/sigcontext.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,14 @@ struct tpidr2_context {
__u64 tpidr2;
};

/* FPMR context */
#define FPMR_MAGIC 0x46504d52

struct fpmr_context {
struct _aarch64_ctx head;
__u64 fpmr;
};

#define ZA_MAGIC 0x54366345

struct za_context {
Expand Down
Loading