Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
ce2bcab
arm64/sve: Report FEAT_SVE_B16B16 to userspace
broonie Sep 15, 2023
9b5c98f
arm64: add FEAT_LRCPC3 HWCAP
jgouly Sep 19, 2023
9da9b21
arm64: add FEAT_LSE128 HWCAP
jgouly Oct 3, 2023
de596b0
arm64: Rename reserved values for CTR_EL0.L1Ip
Dec 4, 2023
6e12716
arm64/sysreg: Update HFGITR_EL2 definiton to DDI0601 2023-09
Dec 9, 2023
4b7dc8c
arm64/sysreg: Add definition for HAFGRTR_EL2
Dec 9, 2023
8ff0c93
arm64/sysreg: add system register POR_EL{0,1}
jgouly Dec 9, 2023
95537ba
arm64/sysreg: update CPACR_EL1 register
jgouly Dec 9, 2023
182c5b4
arm64/sysreg: Add definition for ID_AA64PFR2_EL1
broonie Dec 9, 2023
b2b0801
arm64/sysreg: Update ID_AA64ISAR2_EL1 defintion for DDI0601 2023-09
broonie Dec 9, 2023
04f5bd6
arm64/sysreg: Add definition for ID_AA64ISAR3_EL1
broonie Dec 9, 2023
fb3b616
arm64/sysreg: Add definition for ID_AA64FPFR0_EL1
broonie Dec 9, 2023
ad5bbdb
arm64/sysreg: Update ID_AA64SMFR0_EL1 definition for DDI0601 2023-09
broonie Dec 9, 2023
2f5ae8f
arm64/sysreg: Update SCTLR_EL1 for DDI0601 2023-09
broonie Dec 9, 2023
8080505
arm64/sysreg: Update HCRX_EL2 definition for DDI0601 2023-09
broonie Dec 9, 2023
70a9aaf
arm64/sysreg: Add definition for FPMR
broonie Dec 9, 2023
b481328
arm64/sysreg: Add new system registers for GCS
broonie Dec 9, 2023
27da7e5
arm64/sysreg: Add missing Pauth_LR field definitions to ID_AA64ISAR1_EL1
Dec 14, 2023
9ee9c99
arm64/sysreg: Add missing ExtTrcBuff field definition to ID_AA64DFR0_EL1
Dec 14, 2023
8f9bf7e
arm64/sysreg: Add missing system register definitions for FGT
Dec 14, 2023
794d3fc
arm64: sysreg: Add layout for ID_AA64MMFR4_EL1
Jan 22, 2024
f266636
arm64: Use Signed/Unsigned enums for TGRAN{4,16,64} and VARange
Avenger-285714 Apr 13, 2026
6e1f6d0
arm64: sysreg: Add missing ID_AA64ISAR[13]_EL1 fields and variants
Feb 14, 2024
1de55ce
arm64/sysreg: Add register fields for ID_AA64DFR1_EL1
Feb 20, 2024
332b7f6
arm64/sysreg: Update ID_DFR0_EL1 register fields
Feb 20, 2024
d3afe61
arm64/sysreg: Update ID_AA64DFR0_EL1 register
Feb 20, 2024
739fdbe
arm64/sysreg: Correct the values for GICv4.1
rananta468 Jul 18, 2024
3d3558f
arm64: perf/kvm: Use a common PMU cycle counter define
robherring Jul 31, 2024
55657c5
KVM: arm64: pmu: Use generated define for PMSELR_EL0.SEL access
robherring Jul 31, 2024
82c6d9b
perf: arm_pmuv3: Add support for Armv9.4 PMU instruction counter
robherring Jul 31, 2024
64f4a4e
arm64/sysreg: Update ID_AA64MMFR1_EL1 to DDI0601 2024-09
broonie Oct 11, 2024
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
9 changes: 9 additions & 0 deletions Documentation/arch/arm64/elf_hwcaps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,15 @@ HWCAP3_LS64
HWCAP3_LS64_V
Functionality implied by ID_AA64ISAR1_EL1.LS64 == 0b0010.

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

HWCAP2_LRCPC3
Functionality implied by ID_AA64ISAR1_EL1.LRCPC == 0b0011.

HWCAP2_LSE128
Functionality implied by ID_AA64ISAR0_EL1.Atomic == 0b0011.

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

Expand Down
20 changes: 20 additions & 0 deletions arch/arm/include/asm/arm_pmuv3.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@ static inline u32 read_pmuver(void)
return (dfr0 >> 24) & 0xf;
}

static inline bool pmuv3_has_icntr(void)
{
/* FEAT_PMUv3_ICNTR not accessible for 32-bit */
return false;
}

static inline void write_pmcr(u32 val)
{
write_sysreg(val, PMCR);
Expand All @@ -152,6 +158,13 @@ static inline u64 read_pmccntr(void)
return read_sysreg(PMCCNTR);
}

static inline void write_pmicntr(u64 val) {}

static inline u64 read_pmicntr(void)
{
return 0;
}

static inline void write_pmcntenset(u32 val)
{
write_sysreg(val, PMCNTENSET);
Expand All @@ -177,6 +190,13 @@ static inline void write_pmccfiltr(u32 val)
write_sysreg(val, PMCCFILTR);
}

static inline void write_pmicfiltr(u64 val) {}

static inline u64 read_pmicfiltr(void)
{
return 0;
}

static inline void write_pmovsclr(u32 val)
{
write_sysreg(val, PMOVSR);
Expand Down
55 changes: 48 additions & 7 deletions arch/arm64/include/asm/arm_pmuv3.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#ifndef __ASM_PMUV3_H
#define __ASM_PMUV3_H

#include <linux/kvm_host.h>
#include <asm/kvm_host.h>

#include <asm/cpufeature.h>
#include <asm/sysreg.h>
Expand All @@ -33,6 +33,14 @@ static inline void write_pmevtypern(int n, unsigned long val)
PMEVN_SWITCH(n, WRITE_PMEVTYPERN);
}

#define RETURN_READ_PMEVTYPERN(n) \
return read_sysreg(pmevtyper##n##_el0)
static inline unsigned long read_pmevtypern(int n)
{
PMEVN_SWITCH(n, RETURN_READ_PMEVTYPERN);
return 0;
}

static inline unsigned long read_pmmir(void)
{
return read_cpuid(PMMIR_EL1);
Expand All @@ -46,6 +54,14 @@ static inline u32 read_pmuver(void)
ID_AA64DFR0_EL1_PMUVer_SHIFT);
}

static inline bool pmuv3_has_icntr(void)
{
u64 dfr1 = read_sysreg(id_aa64dfr1_el1);

return !!cpuid_feature_extract_unsigned_field(dfr1,
ID_AA64DFR1_EL1_PMICNTR_SHIFT);
}

static inline void write_pmcr(u64 val)
{
write_sysreg(val, pmcr_el0);
Expand All @@ -71,22 +87,32 @@ static inline u64 read_pmccntr(void)
return read_sysreg(pmccntr_el0);
}

static inline void write_pmcntenset(u32 val)
static inline void write_pmicntr(u64 val)
{
write_sysreg_s(val, SYS_PMICNTR_EL0);
}

static inline u64 read_pmicntr(void)
{
return read_sysreg_s(SYS_PMICNTR_EL0);
}

static inline void write_pmcntenset(u64 val)
{
write_sysreg(val, pmcntenset_el0);
}

static inline void write_pmcntenclr(u32 val)
static inline void write_pmcntenclr(u64 val)
{
write_sysreg(val, pmcntenclr_el0);
}

static inline void write_pmintenset(u32 val)
static inline void write_pmintenset(u64 val)
{
write_sysreg(val, pmintenset_el1);
}

static inline void write_pmintenclr(u32 val)
static inline void write_pmintenclr(u64 val)
{
write_sysreg(val, pmintenclr_el1);
}
Expand All @@ -96,12 +122,27 @@ static inline void write_pmccfiltr(u64 val)
write_sysreg(val, pmccfiltr_el0);
}

static inline void write_pmovsclr(u32 val)
static inline u64 read_pmccfiltr(void)
{
return read_sysreg(pmccfiltr_el0);
}

static inline void write_pmicfiltr(u64 val)
{
write_sysreg_s(val, SYS_PMICFILTR_EL0);
}

static inline u64 read_pmicfiltr(void)
{
return read_sysreg_s(SYS_PMICFILTR_EL0);
}

static inline void write_pmovsclr(u64 val)
{
write_sysreg(val, pmovsclr_el0);
}

static inline u32 read_pmovsclr(void)
static inline u64 read_pmovsclr(void)
{
return read_sysreg(pmovsclr_el0);
}
Expand Down
3 changes: 3 additions & 0 deletions arch/arm64/include/asm/hwcap.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@
#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_LRCPC3 __khwcap2_feature(LRCPC3)
#define KERNEL_HWCAP_LSE128 __khwcap2_feature(LSE128)

#define __khwcap3_feature(x) (const_ilog2(HWCAP3_ ## x) + 128)
#define KERNEL_HWCAP_LS64 __khwcap3_feature(LS64)
Expand Down
14 changes: 13 additions & 1 deletion arch/arm64/include/asm/sysreg.h
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,6 @@
#define SYS_PMCNTENCLR_EL0 sys_reg(3, 3, 9, 12, 2)
#define SYS_PMOVSCLR_EL0 sys_reg(3, 3, 9, 12, 3)
#define SYS_PMSWINC_EL0 sys_reg(3, 3, 9, 12, 4)
#define SYS_PMSELR_EL0 sys_reg(3, 3, 9, 12, 5)
#define SYS_PMCEID0_EL0 sys_reg(3, 3, 9, 12, 6)
#define SYS_PMCEID1_EL0 sys_reg(3, 3, 9, 12, 7)
#define SYS_PMCCNTR_EL0 sys_reg(3, 3, 9, 13, 0)
Expand Down Expand Up @@ -1020,6 +1019,19 @@

#define PIRx_ELx_PERM(idx, perm) ((perm) << ((idx) * 4))

/*
* Permission Overlay Extension (POE) permission encodings.
*/
#define POE_NONE UL(0x0)
#define POE_R UL(0x1)
#define POE_X UL(0x2)
#define POE_RX UL(0x3)
#define POE_W UL(0x4)
#define POE_RW UL(0x5)
#define POE_XW UL(0x6)
#define POE_RXW UL(0x7)
#define POE_MASK UL(0xf)

#define ARM64_FEATURE_FIELD_BITS 4

/* Defined for compatibility only, do not add new users. */
Expand Down
3 changes: 3 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,9 @@
#define HWCAP2_SME_F16F16 (1UL << 42)
#define HWCAP2_MOPS (1UL << 43)
#define HWCAP2_HBC (1UL << 44)
#define HWCAP2_SVE_B16B16 (1UL << 45)
#define HWCAP2_LRCPC3 (1UL << 46)
#define HWCAP2_LSE128 (1UL << 47)

/*
* HWCAP3 flags - for AT_HWCAP3
Expand Down
5 changes: 5 additions & 0 deletions arch/arm64/kernel/cpufeature.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,8 @@ static const struct arm64_ftr_bits ftr_id_aa64zfr0[] = {
FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ZFR0_EL1_SM4_SHIFT, 4, 0),
ARM64_FTR_BITS(FTR_VISIBLE_IF_IS_ENABLED(CONFIG_ARM64_SVE),
FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ZFR0_EL1_SHA3_SHIFT, 4, 0),
ARM64_FTR_BITS(FTR_VISIBLE_IF_IS_ENABLED(CONFIG_ARM64_SVE),
FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ZFR0_EL1_B16B16_SHIFT, 4, 0),
ARM64_FTR_BITS(FTR_VISIBLE_IF_IS_ENABLED(CONFIG_ARM64_SVE),
FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ZFR0_EL1_BF16_SHIFT, 4, 0),
ARM64_FTR_BITS(FTR_VISIBLE_IF_IS_ENABLED(CONFIG_ARM64_SVE),
Expand Down Expand Up @@ -3021,6 +3023,7 @@ static const struct arm64_cpu_capabilities arm64_elf_hwcaps[] = {
HWCAP_CAP(ID_AA64ISAR0_EL1, SHA2, SHA512, CAP_HWCAP, KERNEL_HWCAP_SHA512),
HWCAP_CAP(ID_AA64ISAR0_EL1, CRC32, IMP, CAP_HWCAP, KERNEL_HWCAP_CRC32),
HWCAP_CAP(ID_AA64ISAR0_EL1, ATOMIC, IMP, CAP_HWCAP, KERNEL_HWCAP_ATOMICS),
HWCAP_CAP(ID_AA64ISAR0_EL1, ATOMIC, FEAT_LSE128, CAP_HWCAP, KERNEL_HWCAP_LSE128),
HWCAP_CAP(ID_AA64ISAR0_EL1, RDM, IMP, CAP_HWCAP, KERNEL_HWCAP_ASIMDRDM),
HWCAP_CAP(ID_AA64ISAR0_EL1, SHA3, IMP, CAP_HWCAP, KERNEL_HWCAP_SHA3),
HWCAP_CAP(ID_AA64ISAR0_EL1, SM3, IMP, CAP_HWCAP, KERNEL_HWCAP_SM3),
Expand All @@ -3041,6 +3044,7 @@ static const struct arm64_cpu_capabilities arm64_elf_hwcaps[] = {
HWCAP_CAP(ID_AA64ISAR1_EL1, FCMA, IMP, CAP_HWCAP, KERNEL_HWCAP_FCMA),
HWCAP_CAP(ID_AA64ISAR1_EL1, LRCPC, IMP, CAP_HWCAP, KERNEL_HWCAP_LRCPC),
HWCAP_CAP(ID_AA64ISAR1_EL1, LRCPC, LRCPC2, CAP_HWCAP, KERNEL_HWCAP_ILRCPC),
HWCAP_CAP(ID_AA64ISAR1_EL1, LRCPC, LRCPC3, CAP_HWCAP, KERNEL_HWCAP_LRCPC3),
HWCAP_CAP(ID_AA64ISAR1_EL1, FRINTTS, IMP, CAP_HWCAP, KERNEL_HWCAP_FRINT),
HWCAP_CAP(ID_AA64ISAR1_EL1, SB, IMP, CAP_HWCAP, KERNEL_HWCAP_SB),
HWCAP_CAP(ID_AA64ISAR1_EL1, BF16, IMP, CAP_HWCAP, KERNEL_HWCAP_BF16),
Expand All @@ -3057,6 +3061,7 @@ static const struct arm64_cpu_capabilities arm64_elf_hwcaps[] = {
HWCAP_CAP_MATCH_ID(has_sve_feature, ID_AA64ZFR0_EL1, AES, IMP, CAP_HWCAP, KERNEL_HWCAP_SVEAES),
HWCAP_CAP_MATCH_ID(has_sve_feature, ID_AA64ZFR0_EL1, AES, PMULL128, CAP_HWCAP, KERNEL_HWCAP_SVEPMULL),
HWCAP_CAP_MATCH_ID(has_sve_feature, ID_AA64ZFR0_EL1, BitPerm, IMP, CAP_HWCAP, KERNEL_HWCAP_SVEBITPERM),
HWCAP_CAP_MATCH_ID(has_sve_feature, ID_AA64ZFR0_EL1, B16B16, IMP, CAP_HWCAP, KERNEL_HWCAP_SVE_B16B16),
HWCAP_CAP_MATCH_ID(has_sve_feature, ID_AA64ZFR0_EL1, BF16, IMP, CAP_HWCAP, KERNEL_HWCAP_SVEBF16),
HWCAP_CAP_MATCH_ID(has_sve_feature, ID_AA64ZFR0_EL1, BF16, EBF16, CAP_HWCAP, KERNEL_HWCAP_SVE_EBF16),
HWCAP_CAP_MATCH_ID(has_sve_feature, ID_AA64ZFR0_EL1, SHA3, IMP, CAP_HWCAP, KERNEL_HWCAP_SVESHA3),
Expand Down
3 changes: 3 additions & 0 deletions arch/arm64/kernel/cpuinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ static const char *const hwcap_str[] = {
[KERNEL_HWCAP_SME_F16F16] = "smef16f16",
[KERNEL_HWCAP_MOPS] = "mops",
[KERNEL_HWCAP_HBC] = "hbc",
[KERNEL_HWCAP_SVE_B16B16] = "sveb16b16",
[KERNEL_HWCAP_LRCPC3] = "lrcpc3",
[KERNEL_HWCAP_LSE128] = "lse128",
};

#ifdef CONFIG_COMPAT
Expand Down
Loading
Loading