Skip to content

Commit 81444b7

Browse files
committed
Merge branch 'for-next/misc' into for-next/core
* for-next/misc: arm64: kexec: include reboot.h arm64: delete dead code in this_cpu_set_vectors() arm64: kernel: Fix kernel warning when nokaslr is passed to commandline arm64: kgdb: Set PSTATE.SS to 1 to re-enable single-step arm64/sme: Fix some comments of ARM SME arm64/signal: Alloc tpidr2 sigframe after checking system_supports_tpidr2() arm64/signal: Use system_supports_tpidr2() to check TPIDR2 arm64: compat: Remove defines now in asm-generic arm64: kexec: remove unnecessary (void*) conversions arm64: armv8_deprecated: remove unnecessary (void*) conversions firmware: arm_sdei: Fix sleep from invalid context BUG
2 parents f8863bc + b7b4ce8 commit 81444b7

File tree

12 files changed

+51
-38
lines changed

12 files changed

+51
-38
lines changed

arch/arm64/include/asm/compat.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,6 @@ struct compat_statfs {
8383
int f_spare[4];
8484
};
8585

86-
#define COMPAT_RLIM_INFINITY 0xffffffff
87-
88-
#define COMPAT_OFF_T_MAX 0x7fffffff
89-
9086
#define compat_user_stack_pointer() (user_stack_pointer(task_pt_regs(current)))
9187
#define COMPAT_MINSIGSTKSZ 2048
9288

arch/arm64/include/asm/debug-monitors.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ void user_regs_reset_single_step(struct user_pt_regs *regs,
104104
void kernel_enable_single_step(struct pt_regs *regs);
105105
void kernel_disable_single_step(void);
106106
int kernel_active_single_step(void);
107+
void kernel_rewind_single_step(struct pt_regs *regs);
107108

108109
#ifdef CONFIG_HAVE_HW_BREAKPOINT
109110
int reinstall_suspended_bps(struct pt_regs *regs);

arch/arm64/kernel/armv8_deprecated.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,14 +420,14 @@ static DEFINE_MUTEX(insn_emulation_mutex);
420420

421421
static void enable_insn_hw_mode(void *data)
422422
{
423-
struct insn_emulation *insn = (struct insn_emulation *)data;
423+
struct insn_emulation *insn = data;
424424
if (insn->set_hw_mode)
425425
insn->set_hw_mode(true);
426426
}
427427

428428
static void disable_insn_hw_mode(void *data)
429429
{
430-
struct insn_emulation *insn = (struct insn_emulation *)data;
430+
struct insn_emulation *insn = data;
431431
if (insn->set_hw_mode)
432432
insn->set_hw_mode(false);
433433
}

arch/arm64/kernel/debug-monitors.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,11 @@ int kernel_active_single_step(void)
438438
}
439439
NOKPROBE_SYMBOL(kernel_active_single_step);
440440

441+
void kernel_rewind_single_step(struct pt_regs *regs)
442+
{
443+
set_regs_spsr_ss(regs);
444+
}
445+
441446
/* ptrace API */
442447
void user_enable_single_step(struct task_struct *task)
443448
{

arch/arm64/kernel/fpsimd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ void task_set_vl_onexec(struct task_struct *task, enum vec_type type,
299299
/*
300300
* TIF_SME controls whether a task can use SME without trapping while
301301
* in userspace, when TIF_SME is set then we must have storage
302-
* alocated in sve_state and sme_state to store the contents of both ZA
302+
* allocated in sve_state and sme_state to store the contents of both ZA
303303
* and the SVE registers for both streaming and non-streaming modes.
304304
*
305305
* If both SVCR.ZA and SVCR.SM are disabled then at any point we
@@ -1477,7 +1477,7 @@ void do_sve_acc(unsigned long esr, struct pt_regs *regs)
14771477
*
14781478
* TIF_SME should be clear on entry: otherwise, fpsimd_restore_current_state()
14791479
* would have disabled the SME access trap for userspace during
1480-
* ret_to_user, making an SVE access trap impossible in that case.
1480+
* ret_to_user, making an SME access trap impossible in that case.
14811481
*/
14821482
void do_sme_acc(unsigned long esr, struct pt_regs *regs)
14831483
{

arch/arm64/kernel/idreg-override.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,13 @@ static const struct {
178178
{ "nokaslr", "kaslr.disabled=1" },
179179
};
180180

181+
static int __init parse_nokaslr(char *unused)
182+
{
183+
/* nokaslr param handling is done by early cpufeature code */
184+
return 0;
185+
}
186+
early_param("nokaslr", parse_nokaslr);
187+
181188
static int __init find_field(const char *cmdline,
182189
const struct ftr_set_desc *reg, int f, u64 *v)
183190
{

arch/arm64/kernel/kgdb.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,8 @@ int kgdb_arch_handle_exception(int exception_vector, int signo,
224224
*/
225225
if (!kernel_active_single_step())
226226
kernel_enable_single_step(linux_regs);
227+
else
228+
kernel_rewind_single_step(linux_regs);
227229
err = 0;
228230
break;
229231
default:

arch/arm64/kernel/machine_kexec.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <linux/kernel.h>
1212
#include <linux/kexec.h>
1313
#include <linux/page-flags.h>
14+
#include <linux/reboot.h>
1415
#include <linux/set_memory.h>
1516
#include <linux/smp.h>
1617

@@ -102,7 +103,7 @@ static void kexec_segment_flush(const struct kimage *kimage)
102103
/* Allocates pages for kexec page table */
103104
static void *kexec_page_alloc(void *arg)
104105
{
105-
struct kimage *kimage = (struct kimage *)arg;
106+
struct kimage *kimage = arg;
106107
struct page *page = kimage_alloc_control_pages(kimage, 0);
107108
void *vaddr = NULL;
108109

arch/arm64/kernel/proton-pack.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -966,9 +966,6 @@ static void this_cpu_set_vectors(enum arm64_bp_harden_el1_vectors slot)
966966
{
967967
const char *v = arm64_get_bp_hardening_vector(slot);
968968

969-
if (slot < 0)
970-
return;
971-
972969
__this_cpu_write(this_cpu_vector, v);
973970

974971
/*

arch/arm64/kernel/signal.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ static int parse_user_sigframe(struct user_ctxs *user,
651651
break;
652652

653653
case TPIDR2_MAGIC:
654-
if (!system_supports_sme())
654+
if (!system_supports_tpidr2())
655655
goto invalid;
656656

657657
if (user->tpidr2)
@@ -802,7 +802,7 @@ static int restore_sigframe(struct pt_regs *regs,
802802
err = restore_fpsimd_context(&user);
803803
}
804804

805-
if (err == 0 && system_supports_sme() && user.tpidr2)
805+
if (err == 0 && system_supports_tpidr2() && user.tpidr2)
806806
err = restore_tpidr2_context(&user);
807807

808808
if (err == 0 && system_supports_sme() && user.za)
@@ -893,6 +893,13 @@ static int setup_sigframe_layout(struct rt_sigframe_user_layout *user,
893893
return err;
894894
}
895895

896+
if (system_supports_tpidr2()) {
897+
err = sigframe_alloc(user, &user->tpidr2_offset,
898+
sizeof(struct tpidr2_context));
899+
if (err)
900+
return err;
901+
}
902+
896903
if (system_supports_sme()) {
897904
unsigned int vl;
898905
unsigned int vq = 0;
@@ -902,11 +909,6 @@ static int setup_sigframe_layout(struct rt_sigframe_user_layout *user,
902909
else
903910
vl = task_get_sme_vl(current);
904911

905-
err = sigframe_alloc(user, &user->tpidr2_offset,
906-
sizeof(struct tpidr2_context));
907-
if (err)
908-
return err;
909-
910912
if (thread_za_enabled(&current->thread))
911913
vq = sve_vq_from_vl(vl);
912914

@@ -974,7 +976,7 @@ static int setup_sigframe(struct rt_sigframe_user_layout *user,
974976
}
975977

976978
/* TPIDR2 if supported */
977-
if (system_supports_sme() && err == 0) {
979+
if (system_supports_tpidr2() && err == 0) {
978980
struct tpidr2_context __user *tpidr2_ctx =
979981
apply_user_offset(user, user->tpidr2_offset);
980982
err |= preserve_tpidr2_context(tpidr2_ctx);

0 commit comments

Comments
 (0)