[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201119150217.GH3121429@hirez.programming.kicks-ass.net>
Date: Thu, 19 Nov 2020 16:02:17 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Chris Wilson <chris@...is-wilson.co.uk>
Cc: Heiner Kallweit <hkallweit1@...il.com>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: Deadlock cpuctx_mutex / pmus_lock / &mm->mmap_lock#2
On Thu, Nov 19, 2020 at 03:19:14PM +0100, Peter Zijlstra wrote:
> On Thu, Nov 19, 2020 at 01:25:11PM +0000, Chris Wilson wrote:
> > Quoting Peter Zijlstra (2020-11-19 13:02:44)
> > >
> > > Chris, I suspect this is due to i915 calling stop machine with all sorts
> > > of locks held. Is there anything to be done about this? stop_machine()
> > > is really nasty to begin with.
> > >
> > > What problem is it typing to solve?
> >
> > If there is any concurrent access through a PCI bar (that is exported to
> > userspace via mmap) as the GTT is updated, results in undefined HW
> > behaviour (where that is not limited to users writing to other system
> > pages).
> >
> > stop_machine() is the most foolproof method we know that works.
>
> Sorry, I don't understand. It tries to do what? And why does it need to
> do that holding locks.
>
> Really, this is very bad form.
Having poked around at the code; do I get it correct that this is using
stop-machine to set IOMMU page-table entries, because the hardware
cannot deal with two CPUs writing to the same device page-tables; which
would be possible because that memory is exposed through PCI bars?
Can't you simply exclude that memory from being visible through the PCI
bar crud? Having to use stop-machine seems tragic, doubly so because
nobody should actually be having that memory mapped in the first place.
Powered by blists - more mailing lists