mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>
Subject: Re: [PATCH] x86/alternatives: Let __text_poke() acquire the pte lock with enabled interrupts
Date: Thu, 13 Aug 2020 12:47:07 +0200	[thread overview]
Message-ID: <20200813104707.fxydmk6ctiwjql75@linutronix.de> (raw)
In-Reply-To: <87eeoc53o2.fsf@nanos.tec.linutronix.de>

On 2020-08-12 16:39:41 [+0200], Thomas Gleixner wrote:
> Sebastian,
Hi tglx,

> Sebastian Andrzej Siewior <bigeasy@linutronix.de> writes:
> 
> > The pte lock is never acquired from an IRQ-off region so it does not
> > require the interrupts to be disabled.
> 
> I doubt that this is true. It surely is acquired within other locks
> which might be taken with spin_lock_irq(). Which is completely fine on
> RT.
> 
> But that's not the point. The point is that pte_lock() does not require
> to be taken with interrupts disabled.

The IRQ-off vs in-IRQ working was chosen poorly.

> Please be precise about these kind of things. Handwavy descriptions
> cause more problems than they solve.
> 
> > RT complains here because the spinlock_t must not be acquired with
> > disabled interrupts.
> >
> > use_temporary_mm() expects interrupts to be off because it invokes
> > switch_mm_irqs_off() and uses per-CPU (current active mm) data.
> >
> > Move local_irq_save() after the the pte lock has been acquired. Move
> > local_irq_restore() after the pte lock has been released.
> 
> While part 1 is correct, part 2 is the exact opposite of what the patch
> does.
> 
>   Move the PTE lock handling outside the interrupt disabled region.
> 
> describes precisely what this is about without any gory details which
> can be seen in the patch itself. Hmm?

Oki reworded.

> Thanks,
> 
>         tglx

Sebastian

  reply	other threads:[~2020-08-13 10:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-06 16:42 Sebastian Andrzej Siewior
2020-08-12 14:39 ` Thomas Gleixner
2020-08-13 10:47   ` Sebastian Andrzej Siewior [this message]
2020-08-13 10:50     ` [PATCH v2] " Sebastian Andrzej Siewior
2020-08-13 11:13       ` peterz
2020-08-13 12:15       ` [tip: x86/urgent] x86/alternatives: Acquire pte lock with interrupts enabled tip-bot2 for Sebastian Andrzej Siewior

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=20200813104707.fxydmk6ctiwjql75@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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

all inboxes | Powered by JetHome®