Skip to content

Commit 36a2366

Browse files
committed
Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull arm64 fixes from Catalin Marinas: - SME save/restore for EFI fix - incorrect logic for detecting the need for saving/restoring the FFR state. - SME fix for a CPU ID field value. - Sysreg generation awk script fix (comparison operator). - Some typos in documentation or comments and silence a sparse warning (missing prototype). * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: Add kasan_hw_tags_enable() prototype to silence sparse arm64/sme: Fix EFI save/restore arm64/fpsimd: Fix typo in comment arm64/sysreg: Fix typo in Enum element regex arm64/sme: Fix SVE/SME typo in ABI documentation arm64/sme: Fix tests for 0b1111 value ID registers
2 parents ad6e076 + 78cdaf3 commit 36a2366

File tree

5 files changed

+25
-9
lines changed

5 files changed

+25
-9
lines changed

Documentation/arm64/sme.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ The regset data starts with struct user_za_header, containing:
371371
Appendix A. SME programmer's model (informative)
372372
=================================================
373373

374-
This section provides a minimal description of the additions made by SVE to the
374+
This section provides a minimal description of the additions made by SME to the
375375
ARMv8-A programmer's model that are relevant to this document.
376376

377377
Note: This section is for information only and not intended to be complete or

arch/arm64/include/asm/sysreg.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -843,9 +843,9 @@
843843
#define ID_AA64SMFR0_F32F32_SHIFT 32
844844

845845
#define ID_AA64SMFR0_FA64 0x1
846-
#define ID_AA64SMFR0_I16I64 0x4
846+
#define ID_AA64SMFR0_I16I64 0xf
847847
#define ID_AA64SMFR0_F64F64 0x1
848-
#define ID_AA64SMFR0_I8I32 0x4
848+
#define ID_AA64SMFR0_I8I32 0xf
849849
#define ID_AA64SMFR0_F16F32 0x1
850850
#define ID_AA64SMFR0_B16F32 0x1
851851
#define ID_AA64SMFR0_F32F32 0x1

arch/arm64/kernel/fpsimd.c

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ void task_set_vl_onexec(struct task_struct *task, enum vec_type type,
331331
* trapping to the kernel.
332332
*
333333
* When stored, Z0-Z31 (incorporating Vn in bits[127:0] or the
334-
* corresponding Zn), P0-P15 and FFR are encoded in in
334+
* corresponding Zn), P0-P15 and FFR are encoded in
335335
* task->thread.sve_state, formatted appropriately for vector
336336
* length task->thread.sve_vl or, if SVCR.SM is set,
337337
* task->thread.sme_vl.
@@ -1916,10 +1916,15 @@ void __efi_fpsimd_begin(void)
19161916
if (system_supports_sme()) {
19171917
svcr = read_sysreg_s(SYS_SVCR);
19181918

1919-
if (!system_supports_fa64())
1920-
ffr = svcr & SVCR_SM_MASK;
1919+
__this_cpu_write(efi_sm_state,
1920+
svcr & SVCR_SM_MASK);
19211921

1922-
__this_cpu_write(efi_sm_state, ffr);
1922+
/*
1923+
* Unless we have FA64 FFR does not
1924+
* exist in streaming mode.
1925+
*/
1926+
if (!system_supports_fa64())
1927+
ffr = !(svcr & SVCR_SM_MASK);
19231928
}
19241929

19251930
sve_save_state(sve_state + sve_ffr_offset(sve_max_vl()),
@@ -1964,8 +1969,13 @@ void __efi_fpsimd_end(void)
19641969
sysreg_clear_set_s(SYS_SVCR,
19651970
0,
19661971
SVCR_SM_MASK);
1972+
1973+
/*
1974+
* Unless we have FA64 FFR does not
1975+
* exist in streaming mode.
1976+
*/
19671977
if (!system_supports_fa64())
1968-
ffr = efi_sm_state;
1978+
ffr = false;
19691979
}
19701980
}
19711981

arch/arm64/kernel/mte.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,11 @@ static void mte_update_gcr_excl(struct task_struct *task)
244244
SYS_GCR_EL1);
245245
}
246246

247+
#ifdef CONFIG_KASAN_HW_TAGS
248+
/* Only called from assembly, silence sparse */
249+
void __init kasan_hw_tags_enable(struct alt_instr *alt, __le32 *origptr,
250+
__le32 *updptr, int nr_inst);
251+
247252
void __init kasan_hw_tags_enable(struct alt_instr *alt, __le32 *origptr,
248253
__le32 *updptr, int nr_inst)
249254
{
@@ -252,6 +257,7 @@ void __init kasan_hw_tags_enable(struct alt_instr *alt, __le32 *origptr,
252257
if (kasan_hw_tags_enabled())
253258
*updptr = cpu_to_le32(aarch64_insn_gen_nop());
254259
}
260+
#endif
255261

256262
void mte_thread_init_user(void)
257263
{

arch/arm64/tools/gen-sysreg.awk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ END {
253253
next
254254
}
255255

256-
/0b[01]+/ && block = "Enum" {
256+
/0b[01]+/ && block == "Enum" {
257257
expect_fields(2)
258258
val = $1
259259
name = $2

0 commit comments

Comments
 (0)