public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Sven Schnelle <svens@linux.ibm.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] split up lockdep and syscall related functionality in generic entry code
Date: Wed, 02 Dec 2020 00:17:21 +0100	[thread overview]
Message-ID: <877dq1f75q.fsf@nanos.tec.linutronix.de> (raw)
In-Reply-To: <20201201142755.31931-1-svens@linux.ibm.com>

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(&regs->gprs[8], S390_lowcore.save_area_sync, 8 * sizeof(unsigned long));
> 	memcpy(&regs->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

  parent reply	other threads:[~2020-12-01 23:18 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-01 14:27 [PATCH v2] split up lockdep and syscall related functionality in generic entry code Sven Schnelle
2020-12-01 14:27 ` [PATCH v2 1/5] entry: rename enter_from_user_mode() Sven Schnelle
2020-12-02  9:38   ` [tip: core/entry] entry: Rename enter_from_user_mode() tip-bot2 for Sven Schnelle
2020-12-02 14:12   ` tip-bot2 for Sven Schnelle
2020-12-01 14:27 ` [PATCH v2 2/5] entry: rename exit_from_user_mode() Sven Schnelle
2020-12-01 14:41   ` Sven Schnelle
2020-12-02  9:38   ` [tip: core/entry] entry: Rename exit_to_user_mode() tip-bot2 for Sven Schnelle
2020-12-02 14:12   ` tip-bot2 for Sven Schnelle
2020-12-01 14:27 ` [PATCH v2 3/5] entry: add enter_from_user_mode() wrapper Sven Schnelle
2020-12-02  9:38   ` [tip: core/entry] entry_Add_enter_from_user_mode_wrapper tip-bot2 for Sven Schnelle
2020-12-02 14:12   ` tip-bot2 for Sven Schnelle
2020-12-01 14:27 ` [PATCH v2 4/5] entry: add exit_to_user_mode() wrapper Sven Schnelle
2020-12-02  9:38   ` [tip: core/entry] entry: Add " tip-bot2 for Sven Schnelle
2020-12-02 14:12   ` tip-bot2 for Sven Schnelle
2020-12-01 14:27 ` [PATCH v2 5/5] entry: add syscall_exit_to_user_mode_work() Sven Schnelle
2020-12-02  9:38   ` [tip: core/entry] entry: Add syscall_exit_to_user_mode_work() tip-bot2 for Sven Schnelle
2020-12-02 14:12   ` tip-bot2 for Sven Schnelle
2020-12-01 23:17 ` Thomas Gleixner [this message]
2020-12-02  0:33 ` [PATCH v2] split up lockdep and syscall related functionality in generic entry code Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877dq1f75q.fsf@nanos.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=svens@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox