Commit 023113fe authored by Catalin Marinas's avatar Catalin Marinas

Merge branch 'for-next/feat_lrcpc3' into for-next/core

* for-next/feat_lrcpc3:
  : HWCAP for FEAT_LRCPC3
  selftests/arm64: add HWCAP2_LRCPC3 test
  arm64: add FEAT_LRCPC3 HWCAP
parents 2a3f8ce3 80652cc0
......@@ -311,6 +311,9 @@ HWCAP2_HBC
HWCAP2_SVE_B16B16
Functionality implied by ID_AA64ZFR0_EL1.B16B16 == 0b0001.
HWCAP2_LRCPC3
Functionality implied by ID_AA64ISAR1_EL1.LRCPC == 0b0011.
4. Unused AT_HWCAP bits
-----------------------
......
......@@ -140,6 +140,7 @@
#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)
/*
* This yields a mask that user programs can use to figure out what
......
......@@ -105,5 +105,6 @@
#define HWCAP2_MOPS (1UL << 43)
#define HWCAP2_HBC (1UL << 44)
#define HWCAP2_SVE_B16B16 (1UL << 45)
#define HWCAP2_LRCPC3 (1UL << 46)
#endif /* _UAPI__ASM_HWCAP_H */
......@@ -2766,6 +2766,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),
......
......@@ -128,6 +128,7 @@ static const char *const hwcap_str[] = {
[KERNEL_HWCAP_MOPS] = "mops",
[KERNEL_HWCAP_HBC] = "hbc",
[KERNEL_HWCAP_SVE_B16B16] = "sveb16b16",
[KERNEL_HWCAP_LRCPC3] = "lrcpc3",
};
#ifdef CONFIG_COMPAT
......
......@@ -1309,6 +1309,7 @@ UnsignedEnum 23:20 LRCPC
0b0000 NI
0b0001 IMP
0b0010 LRCPC2
0b0011 LRCPC3
EndEnum
UnsignedEnum 19:16 FCMA
0b0000 NI
......
......@@ -295,6 +295,19 @@ static void uscat_sigbus(void)
asm volatile(".inst 0xb820003f" : : : );
}
static void lrcpc3_sigill(void)
{
int data[2] = { 1, 2 };
register int *src asm ("x0") = data;
register int data0 asm ("w2") = 0;
register int data1 asm ("w3") = 0;
/* LDIAPP w2, w3, [x0] */
asm volatile(".inst 0x99431802"
: "=r" (data0), "=r" (data1) : "r" (src) :);
}
static const struct hwcap_data {
const char *name;
unsigned long at_hwcap;
......@@ -354,6 +367,13 @@ static const struct hwcap_data {
.cpuinfo = "ilrcpc",
.sigill_fn = ilrcpc_sigill,
},
{
.name = "LRCPC3",
.at_hwcap = AT_HWCAP2,
.hwcap_bit = HWCAP2_LRCPC3,
.cpuinfo = "lrcpc3",
.sigill_fn = lrcpc3_sigill,
},
{
.name = "LSE",
.at_hwcap = AT_HWCAP,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment