[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <877dq1f75q.fsf@nanos.tec.linutronix.de>
Date: Wed, 02 Dec 2020 00:17:21 +0100
From: Thomas Gleixner <tglx@...utronix.de>
To: Sven Schnelle <svens@...ux.ibm.com>
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] split up lockdep and syscall related functionality in generic entry code
On Tue, Dec 01 2020 at 15:27, Sven Schnelle wrote:
> __do_syscall is the function which gets called by low level entry.S code:
>
> void noinstr __do_syscall(struct pt_regs *regs)
> {
> enter_from_user_mode(regs); /* sets lockdep state, and other initial stuff */
>
> /*
> * functions that need to run with irqs disabled,
> * but lockdep state and other stuff set up
> */
> memcpy(®s->gprs[8], S390_lowcore.save_area_sync, 8 * sizeof(unsigned long));
> memcpy(®s->int_code, &S390_lowcore.svc_ilc, sizeof(regs->int_code));
> regs->psw = S390_lowcore.svc_old_psw;
As __do_syscall() is marked noinstr you want to add
instrumentation_begin();
>
> update_timer_sys();
>
> local_irq_enable();
>
> regs->orig_gpr2 = regs->gprs[2];
>
> do {
> regs->flags = _PIF_SYSCALL;
> do_syscall(regs);
> } while (test_pt_regs_flag(regs, PIF_SYSCALL_RESTART));
instrumentation_end();
for two reasons:
- it clearly documents the boundaries in the code
- it will make objtool happy.
I know it does not have s390 support yet, but I only can recommend
to add that. It's annoying to analyze all the spots it complains
about violating the noinstr rules, but it's way more reliable than
human inspection.
> exit_to_user_mode();
> }
Thanks,
tglx
Powered by blists - more mailing lists