From: Daniel Vetter <daniel@ffwll.ch>
To: Chris Wilson <chris@chris-wilson.co.uk>,
Daniel Vetter <daniel.vetter@ffwll.ch>,
intel-gfx <intel-gfx@lists.freedesktop.org>,
stable <stable@vger.kernel.org>
Subject: Re: [PATCH] drm/i915: Use Graphics Base of Stolen Memory on all gen3+
Date: Thu, 4 Jul 2013 11:55:57 +0200 [thread overview]
Message-ID: <20130704095557.GY18285@phenom.ffwll.local> (raw)
In-Reply-To: <20130703235508.GJ19383@cantiga.alporthouse.com>
On Thu, Jul 04, 2013 at 12:55:08AM +0100, Chris Wilson wrote:
> On Thu, Jul 04, 2013 at 01:38:05AM +0200, Daniel Vetter wrote:
> > On Thu, Jul 4, 2013 at 1:33 AM, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> > > On Thu, Jul 04, 2013 at 01:26:03AM +0200, Daniel Vetter wrote:
> > >> On Thu, Jul 4, 2013 at 1:23 AM, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> > >> > So I made the mistake of missing that the desktop and mobile chipsets
> > >> > have different layouts in their PCI configurations, and we were
> > >> > incorrectly setting the wrong physical address for stolen memory on
> > >> > mobile chipsets.
> > >> >
> > >> > Since all gen3+ are actually consistent in the location of the GBSM
> > >> > register in the PCI configuration space on device 2 (the GPU), use it.
> > >> >
> > >> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > >> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> > >> > Cc: stable@vger.kernel.org
> > >>
> > >> Nope, not cc: stable since the last time around the overlay blew up in
> > >> flames ...
> > >
> > > You can comment out gen3, but the dangerous part is that we are
> > > overwriting random physical addresses.
> >
> > Hm, should we do a request_region on the stolen range to double-check
> > that? Just for paranoia and in case the BIOS does something terrible
> > ...
>
> Afaict, request_region() is only being used to reserve and check for
> conflicting io ranges. I don't know if that will give us protection
> against overwriting user/kernel memory. Maybe it does - I haven't found
> the documentation for it yet.
On a quick reading (I didn't really try it out in practice) the e820 code
inserts resource nodes for each memory segment into the resource tree. So
I think this should indeed work out. At least request_mem_region seems to
check for IORESOURCE_BUSY and e820_reserve_resources seems to set that on
all memory regions managed by the kernel (if I read the magic checks
correctly).
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
next prev parent reply other threads:[~2013-07-04 9:55 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-03 23:23 [PATCH] drm/i915: Use Graphics Base of Stolen Memory on all gen3+ Chris Wilson
2013-07-03 23:26 ` Daniel Vetter
2013-07-03 23:33 ` Chris Wilson
2013-07-03 23:38 ` Daniel Vetter
2013-07-03 23:55 ` Chris Wilson
2013-07-04 9:55 ` Daniel Vetter [this message]
2013-07-04 10:53 ` [PATCH] drm/i915: Verify that our stolen memory doesn't conflict Chris Wilson
2013-07-04 11:05 ` Daniel Vetter
2013-07-04 11:28 ` Chris Wilson
2013-07-04 12:44 ` Daniel Vetter
2013-07-05 21:34 ` Paulo Zanoni
2013-07-05 21:39 ` Daniel Vetter
2013-07-23 17:30 ` [PATCH] drm/i915: Use Graphics Base of Stolen Memory on all gen3+ Daniel Vetter
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=20130704095557.GY18285@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=chris@chris-wilson.co.uk \
--cc=daniel.vetter@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
--cc=stable@vger.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