Unverified Commit 805b167e authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!9112 Backport some optimizing patches for kunpeng920

Merge Pull Request from: @ci-robot 
 
PR sync from: Zheng Zengkai <zhengzengkai@huawei.com>
https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/4XRX2FB55XSVCTLKQJW4UWEW2Q3S73FP/ 
Backport some optimizing patches for kunpeng920 from upstream, including
 Five pre-patches from Mark to make some preparations before unmasking DAIF for
 arm64 syscall.
 One patch from Guo Hui for optimizing unixbench syscall.
 Two patches from Barry Song for optimizing test_idle_cores() and barrier
 handling in gic_ipi_send_mask().

Barry Song (2):
  sched/fair: Optimize test_idle_cores() for !SMT
  irqchip/gic-v3: Use dsb(ishst) to order writes with ICC_SGI1R_EL1
    accesses

Guo Hui (1):
  arm64: syscall: unmask DAIF for tracing status

Mark Rutland (5):
  thread_info: Add helpers to snapshot thread flags
  x86: Snapshot thread flags
  entry: Snapshot thread flags
  sched: Snapshot thread flags
  arm64: Snapshot thread flags


-- 
2.20.1
 
https://gitee.com/openeuler/kernel/issues/IA5U46
https://gitee.com/openeuler/kernel/issues/IA5WFA
https://gitee.com/openeuler/kernel/issues/IA5VG2 
 
Link:https://gitee.com/openeuler/kernel/pulls/9112

 

Reviewed-by: default avatarWei Li <liwei391@huawei.com>
Reviewed-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
Reviewed-by: default avatarZhang Jianhua <chris.zjh@huawei.com>
Reviewed-by: default avatarZucheng Zheng <zhengzucheng@huawei.com>
Signed-off-by: default avatarJialin Zhang <zhangjialin11@huawei.com>
parents acc28460 4a4dbce0
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2098,7 +2098,7 @@ static void tracehook_report_syscall(struct pt_regs *regs,

int syscall_trace_enter(struct pt_regs *regs)
{
	unsigned long flags = READ_ONCE(current_thread_info()->flags);
	unsigned long flags = read_thread_flags();

	if (flags & (_TIF_SYSCALL_EMU | _TIF_SYSCALL_TRACE)) {
		tracehook_report_syscall(regs, PTRACE_SYSCALL_ENTER);
@@ -2121,7 +2121,7 @@ int syscall_trace_enter(struct pt_regs *regs)

void syscall_trace_exit(struct pt_regs *regs)
{
	unsigned long flags = READ_ONCE(current_thread_info()->flags);
	unsigned long flags = read_thread_flags();

	audit_syscall_exit(regs);

+1 −1
Original line number Diff line number Diff line
@@ -891,7 +891,7 @@ asmlinkage void do_notify_resume(struct pt_regs *regs,
		}

		local_daif_mask();
		thread_flags = READ_ONCE(current_thread_info()->flags);
		thread_flags = read_thread_flags();
	} while (thread_flags & _TIF_WORK_MASK);
}

+2 −4
Original line number Diff line number Diff line
@@ -109,7 +109,7 @@ static void cortex_a76_erratum_1463225_svc_handler(void) { }
static void el0_svc_common(struct pt_regs *regs, int scno, int sc_nr,
			   const syscall_fn_t syscall_table[])
{
	unsigned long flags = current_thread_info()->flags;
	unsigned long flags = read_thread_flags();

	regs->orig_x0 = regs->regs[0];
	regs->syscallno = scno;
@@ -176,11 +176,9 @@ static void el0_svc_common(struct pt_regs *regs, int scno, int sc_nr,
	 * exit regardless, as the old entry assembly did.
	 */
	if (!has_syscall_work(flags) && !IS_ENABLED(CONFIG_DEBUG_RSEQ)) {
		local_daif_mask();
		flags = current_thread_info()->flags;
		flags = read_thread_flags();
		if (!has_syscall_work(flags) && !(flags & _TIF_SINGLESTEP))
			return;
		local_daif_restore(DAIF_PROCCTX);
	}

trace_exit:
+4 −4
Original line number Diff line number Diff line
@@ -370,7 +370,7 @@ void arch_setup_new_exec(void)
		clear_thread_flag(TIF_SSBD);
		task_clear_spec_ssb_disable(current);
		task_clear_spec_ssb_noexec(current);
		speculation_ctrl_update(task_thread_info(current)->flags);
		speculation_ctrl_update(read_thread_flags());
	}
}

@@ -622,7 +622,7 @@ static unsigned long speculation_ctrl_update_tif(struct task_struct *tsk)
			clear_tsk_thread_flag(tsk, TIF_SPEC_IB);
	}
	/* Return the updated threadinfo flags*/
	return task_thread_info(tsk)->flags;
	return read_task_thread_flags(tsk);
}

void speculation_ctrl_update(unsigned long tif)
@@ -658,8 +658,8 @@ void __switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p)
{
	unsigned long tifp, tifn;

	tifn = READ_ONCE(task_thread_info(next_p)->flags);
	tifp = READ_ONCE(task_thread_info(prev_p)->flags);
	tifn = read_task_thread_flags(next_p);
	tifp = read_task_thread_flags(prev_p);

	switch_to_bitmap(tifp);

+2 −2
Original line number Diff line number Diff line
@@ -13,8 +13,8 @@ void __switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p);
static inline void switch_to_extra(struct task_struct *prev,
				   struct task_struct *next)
{
	unsigned long next_tif = task_thread_info(next)->flags;
	unsigned long prev_tif = task_thread_info(prev)->flags;
	unsigned long next_tif = read_task_thread_flags(next);
	unsigned long prev_tif = read_task_thread_flags(prev);

	if (IS_ENABLED(CONFIG_SMP)) {
		/*
Loading