mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lukas Straub <lukasstraub2@web.de>
To: "Luck, Tony" <tony.luck@intel.com>
Cc: "Hansen, Dave" <dave.hansen@intel.com>,
	"Guilherme G. Piccoli" <gpiccoli@igalia.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"x86@kernel.org" <x86@kernel.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"bp@alien8.de" <bp@alien8.de>,
	"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
	"hpa@zytor.com" <hpa@zytor.com>,
	"Lutomirski, Andy" <luto@kernel.org>,
	"kernel-dev@igalia.com" <kernel-dev@igalia.com>,
	"kernel@gpiccoli.net" <kernel@gpiccoli.net>,
	"Yu, Fenghua" <fenghua.yu@intel.com>,
	Joshua Ashton <joshua@froggi.es>,
	Paul Gofman <pgofman@codeweavers.com>,
	Pavel Machek <pavel@denx.de>,
	Pierre-Loup Griffais <pgriffais@valvesoftware.com>,
	"Melissa Wen" <mwen@igalia.com>
Subject: Re: [PATCH] x86/split_lock: Restore warn mode (and add a new one) to avoid userspace regression
Date: Sun, 30 Oct 2022 16:13:15 +0000	[thread overview]
Message-ID: <20221030160300.3a3e72c7@gecko.fritz.box> (raw)
In-Reply-To: <SJ1PR11MB60839A08E01742321F8446BCFC579@SJ1PR11MB6083.namprd11.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 1935 bytes --]

On Thu, 29 Sep 2022 15:37:55 +0000
"Luck, Tony" <tony.luck@intel.com> wrote:

> >> I have a revert removing the misery ready and tested, let me know if I
> >> should submit it.  
> >
> > I'm a bit of a late arrival to the split lock party, so I'm a bit
> > hesitant to merge any changes immediately.
> >
> > How about we give it a few weeks and see if the current behavior impacts
> > anyone else?  Maybe the best route will be more clear then.  
> 
> Applying "misery" to the processes that are executing split-lock flows saves
> the rest of the system from a different level of misery (for the duration of the
> split lock other logical CPUs and I/O devices have access to memory blocked).
> 
> So the "misery" serves a very useful purpose on multi-user systems.

Hello Everyone,
How about the following: The kernel traps the split-lock, but instead
of punishing the process artificially it emulates it in a different way
that won't harm the system as a whole. Of course this still will be
slower than a non-split-lock but surely won't take 10ms.

For example, you could emulate the instruction without atomic semantics,
but protected under a single global mutex for all split-lock operations
instead. This is how atomics are done on on alpha AFAIK, which doesn't
have atomic instructions.

This is not as simple as the current solution. But I see the current
solution more like a quick and dirty workaround for this security/DoS
issue, until a proper solution (like my proposal) is implemented.

Regards,
Lukas Straub

> Maybe the decision of which mode to use could be dynamic based on
> number of online CPUs? Laptops/desktops with low counts (<50???)
> could just "warn", while servers could default to the "seq" mode.
> 
> Or perhaps there is some other heuristic to distinguish single-user
> systems where the split-locks are not causing pain to other users?
> 
> -Tony



-- 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2022-10-30 16:21 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-28 14:21 Guilherme G. Piccoli
2022-09-28 20:24 ` Luck, Tony
2022-09-28 20:50   ` Joshua Ashton
2022-09-28 20:56   ` Guilherme G. Piccoli
2022-10-06 20:15     ` Thomas Gleixner
2022-10-06 20:58       ` Guilherme G. Piccoli
2022-10-06  9:04   ` Pavel Machek
2022-10-06 15:07     ` Guilherme G. Piccoli
2022-09-28 21:50 ` Dave Hansen
2022-09-29 14:57   ` Guilherme G. Piccoli
2022-09-29 15:17     ` Dave Hansen
2022-09-29 15:30       ` Guilherme G. Piccoli
2022-09-29 16:26         ` Dave Hansen
2022-09-29 17:15           ` Guilherme G. Piccoli
2022-09-29 17:23           ` Paul Gofman
2022-09-29 15:37       ` Luck, Tony
2022-10-30 16:13         ` Lukas Straub [this message]
2022-09-29 17:17   ` Zebediah Figura

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=20221030160300.3a3e72c7@gecko.fritz.box \
    --to=lukasstraub2@web.de \
    --cc=bp@alien8.de \
    --cc=dave.hansen@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=fenghua.yu@intel.com \
    --cc=gpiccoli@igalia.com \
    --cc=hpa@zytor.com \
    --cc=joshua@froggi.es \
    --cc=kernel-dev@igalia.com \
    --cc=kernel@gpiccoli.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=mwen@igalia.com \
    --cc=pavel@denx.de \
    --cc=pgofman@codeweavers.com \
    --cc=pgriffais@valvesoftware.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --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®