Skip to content

Commit e022620

Browse files
committed
Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull arm64 fixes from Will Deacon: "A bumper crop of arm64 fixes for -rc3. The largest change is fixing our parsing of the 'rodata=full' command line option, which kstrtobool() started treating as 'rodata=false'. The fix actually makes the parsing of that option much less fragile and updates the documentation at the same time. We still have a boot issue pending when KASLR is disabled at compile time, but there's a fresh fix on the list which I'll send next week if it holds up to testing. Summary: - Fix workaround for Cortex-A76 erratum #1286807 - Add workaround for AMU erratum #2457168 on Cortex-A510 - Drop reference to removed CONFIG_ARCH_RANDOM #define - Fix parsing of the "rodata=full" cmdline option - Fix a bunch of issues in the SME register state switching and sigframe code - Fix incorrect extraction of the CTR_EL0.CWG register field - Fix ACPI cache topology probing when the PPTT is not present - Trivial comment and whitespace fixes" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64/sme: Don't flush SVE register state when handling SME traps arm64/sme: Don't flush SVE register state when allocating SME storage arm64/signal: Flush FPSIMD register state when disabling streaming mode arm64/signal: Raise limit on stack frames arm64/cache: Fix cache_type_cwg() for register generation arm64/sysreg: Guard SYS_FIELD_ macros for asm arm64/sysreg: Directly include bitfield.h arm64: cacheinfo: Fix incorrect assignment of signed error value to unsigned fw_level arm64: errata: add detection for AMEVCNTR01 incrementing incorrectly arm64: fix rodata=full arm64: Fix comment typo docs/arm64: elf_hwcaps: unify newlines in HWCAP lists arm64: adjust KASLR relocation after ARCH_RANDOM removal arm64: Fix match_list for erratum 1286807 on Arm Cortex-A76
2 parents 012bd7e + 714f3cb commit e022620

File tree

20 files changed

+136
-66
lines changed

20 files changed

+136
-66
lines changed

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5331,6 +5331,8 @@
53315331
rodata= [KNL]
53325332
on Mark read-only kernel memory as read-only (default).
53335333
off Leave read-only kernel memory writable for debugging.
5334+
full Mark read-only kernel memory and aliases as read-only
5335+
[arm64]
53345336

53355337
rockchip.usb_uart
53365338
Enable the uart passthrough on the designated usb port

Documentation/arm64/elf_hwcaps.rst

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -242,44 +242,34 @@ HWCAP2_MTE3
242242
by Documentation/arm64/memory-tagging-extension.rst.
243243

244244
HWCAP2_SME
245-
246245
Functionality implied by ID_AA64PFR1_EL1.SME == 0b0001, as described
247246
by Documentation/arm64/sme.rst.
248247

249248
HWCAP2_SME_I16I64
250-
251249
Functionality implied by ID_AA64SMFR0_EL1.I16I64 == 0b1111.
252250

253251
HWCAP2_SME_F64F64
254-
255252
Functionality implied by ID_AA64SMFR0_EL1.F64F64 == 0b1.
256253

257254
HWCAP2_SME_I8I32
258-
259255
Functionality implied by ID_AA64SMFR0_EL1.I8I32 == 0b1111.
260256

261257
HWCAP2_SME_F16F32
262-
263258
Functionality implied by ID_AA64SMFR0_EL1.F16F32 == 0b1.
264259

265260
HWCAP2_SME_B16F32
266-
267261
Functionality implied by ID_AA64SMFR0_EL1.B16F32 == 0b1.
268262

269263
HWCAP2_SME_F32F32
270-
271264
Functionality implied by ID_AA64SMFR0_EL1.F32F32 == 0b1.
272265

273266
HWCAP2_SME_FA64
274-
275267
Functionality implied by ID_AA64SMFR0_EL1.FA64 == 0b1.
276268

277269
HWCAP2_WFXT
278-
279270
Functionality implied by ID_AA64ISAR2_EL1.WFXT == 0b0010.
280271

281272
HWCAP2_EBF16
282-
283273
Functionality implied by ID_AA64ISAR1_EL1.BF16 == 0b0010.
284274

285275
4. Unused AT_HWCAP bits

Documentation/arm64/silicon-errata.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ stable kernels.
5252
| Allwinner | A64/R18 | UNKNOWN1 | SUN50I_ERRATUM_UNKNOWN1 |
5353
+----------------+-----------------+-----------------+-----------------------------+
5454
+----------------+-----------------+-----------------+-----------------------------+
55+
| ARM | Cortex-A510 | #2457168 | ARM64_ERRATUM_2457168 |
56+
+----------------+-----------------+-----------------+-----------------------------+
5557
| ARM | Cortex-A510 | #2064142 | ARM64_ERRATUM_2064142 |
5658
+----------------+-----------------+-----------------+-----------------------------+
5759
| ARM | Cortex-A510 | #2038923 | ARM64_ERRATUM_2038923 |

arch/arm64/Kconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -917,6 +917,23 @@ config ARM64_ERRATUM_1902691
917917

918918
If unsure, say Y.
919919

920+
config ARM64_ERRATUM_2457168
921+
bool "Cortex-A510: 2457168: workaround for AMEVCNTR01 incrementing incorrectly"
922+
depends on ARM64_AMU_EXTN
923+
default y
924+
help
925+
This option adds the workaround for ARM Cortex-A510 erratum 2457168.
926+
927+
The AMU counter AMEVCNTR01 (constant counter) should increment at the same rate
928+
as the system counter. On affected Cortex-A510 cores AMEVCNTR01 increments
929+
incorrectly giving a significantly higher output value.
930+
931+
Work around this problem by returning 0 when reading the affected counter in
932+
key locations that results in disabling all users of this counter. This effect
933+
is the same to firmware disabling affected counters.
934+
935+
If unsure, say Y.
936+
920937
config CAVIUM_ERRATUM_22375
921938
bool "Cavium erratum 22375, 24313"
922939
default y

arch/arm64/include/asm/cache.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ static __always_inline int icache_is_vpipt(void)
7171

7272
static inline u32 cache_type_cwg(void)
7373
{
74-
return (read_cpuid_cachetype() >> CTR_EL0_CWG_SHIFT) & CTR_EL0_CWG_MASK;
74+
return SYS_FIELD_GET(CTR_EL0, CWG, read_cpuid_cachetype());
7575
}
7676

7777
#define __read_mostly __section(".data..read_mostly")

arch/arm64/include/asm/fpsimd.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ struct vl_info {
153153

154154
#ifdef CONFIG_ARM64_SVE
155155

156-
extern void sve_alloc(struct task_struct *task);
156+
extern void sve_alloc(struct task_struct *task, bool flush);
157157
extern void fpsimd_release_task(struct task_struct *task);
158158
extern void fpsimd_sync_to_sve(struct task_struct *task);
159159
extern void fpsimd_force_sync_to_sve(struct task_struct *task);
@@ -256,7 +256,7 @@ size_t sve_state_size(struct task_struct const *task);
256256

257257
#else /* ! CONFIG_ARM64_SVE */
258258

259-
static inline void sve_alloc(struct task_struct *task) { }
259+
static inline void sve_alloc(struct task_struct *task, bool flush) { }
260260
static inline void fpsimd_release_task(struct task_struct *task) { }
261261
static inline void sve_sync_to_fpsimd(struct task_struct *task) { }
262262
static inline void sve_sync_from_fpsimd_zeropad(struct task_struct *task) { }

arch/arm64/include/asm/setup.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
#ifndef __ARM64_ASM_SETUP_H
44
#define __ARM64_ASM_SETUP_H
55

6+
#include <linux/string.h>
7+
68
#include <uapi/asm/setup.h>
79

810
void *get_early_fdt_ptr(void);
@@ -14,4 +16,19 @@ void early_fdt_map(u64 dt_phys);
1416
extern phys_addr_t __fdt_pointer __initdata;
1517
extern u64 __cacheline_aligned boot_args[4];
1618

19+
static inline bool arch_parse_debug_rodata(char *arg)
20+
{
21+
extern bool rodata_enabled;
22+
extern bool rodata_full;
23+
24+
if (arg && !strcmp(arg, "full")) {
25+
rodata_enabled = true;
26+
rodata_full = true;
27+
return true;
28+
}
29+
30+
return false;
31+
}
32+
#define arch_parse_debug_rodata arch_parse_debug_rodata
33+
1734
#endif

arch/arm64/include/asm/sysreg.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,6 +1116,7 @@
11161116

11171117
#else
11181118

1119+
#include <linux/bitfield.h>
11191120
#include <linux/build_bug.h>
11201121
#include <linux/types.h>
11211122
#include <asm/alternative.h>
@@ -1209,8 +1210,6 @@
12091210
par; \
12101211
})
12111212

1212-
#endif
1213-
12141213
#define SYS_FIELD_GET(reg, field, val) \
12151214
FIELD_GET(reg##_##field##_MASK, val)
12161215

@@ -1220,4 +1219,6 @@
12201219
#define SYS_FIELD_PREP_ENUM(reg, field, val) \
12211220
FIELD_PREP(reg##_##field##_MASK, reg##_##field##_##val)
12221221

1222+
#endif
1223+
12231224
#endif /* __ASM_SYSREG_H */

arch/arm64/kernel/cacheinfo.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ static void ci_leaf_init(struct cacheinfo *this_leaf,
4545

4646
int init_cache_level(unsigned int cpu)
4747
{
48-
unsigned int ctype, level, leaves, fw_level;
48+
unsigned int ctype, level, leaves;
49+
int fw_level;
4950
struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu);
5051

5152
for (level = 1, leaves = 0; level <= MAX_CACHE_LEVEL; level++) {
@@ -63,6 +64,9 @@ int init_cache_level(unsigned int cpu)
6364
else
6465
fw_level = acpi_find_last_cache_level(cpu);
6566

67+
if (fw_level < 0)
68+
return fw_level;
69+
6670
if (level < fw_level) {
6771
/*
6872
* some external caches not specified in CLIDR_EL1

arch/arm64/kernel/cpu_errata.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,8 @@ static const struct arm64_cpu_capabilities arm64_repeat_tlbi_list[] = {
208208
#ifdef CONFIG_ARM64_ERRATUM_1286807
209209
{
210210
ERRATA_MIDR_RANGE(MIDR_CORTEX_A76, 0, 0, 3, 0),
211+
},
212+
{
211213
/* Kryo4xx Gold (rcpe to rfpe) => (r0p0 to r3p0) */
212214
ERRATA_MIDR_RANGE(MIDR_QCOM_KRYO_4XX_GOLD, 0xc, 0xe, 0xf, 0xe),
213215
},
@@ -654,6 +656,16 @@ const struct arm64_cpu_capabilities arm64_errata[] = {
654656
ERRATA_MIDR_REV_RANGE(MIDR_CORTEX_A510, 0, 0, 2)
655657
},
656658
#endif
659+
#ifdef CONFIG_ARM64_ERRATUM_2457168
660+
{
661+
.desc = "ARM erratum 2457168",
662+
.capability = ARM64_WORKAROUND_2457168,
663+
.type = ARM64_CPUCAP_WEAK_LOCAL_CPU_FEATURE,
664+
665+
/* Cortex-A510 r0p0-r1p1 */
666+
CAP_MIDR_RANGE(MIDR_CORTEX_A510, 0, 0, 1, 1)
667+
},
668+
#endif
657669
#ifdef CONFIG_ARM64_ERRATUM_2038923
658670
{
659671
.desc = "ARM erratum 2038923",

0 commit comments

Comments
 (0)