public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bob Montgomery <bob.montgomery@hp.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"vojtech@suse.cz" <vojtech@suse.cz>,
	"chandru@in.ibm.com" <chandru@in.ibm.com>,
	Joerg Roedel <joerg.roedel@amd.com>,
	FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
	Yinghai Lu <yinghai@kernel.org>,
	Jesse Barnes <jbarnes@virtuousgeek.org>,
	Pavel Machek <pavel@ucw.cz>
Subject: Re: [PATCH] disable CPU side GART accesses
Date: Thu, 16 Oct 2008 13:17:20 -0600	[thread overview]
Message-ID: <1224184640.2215.293.camel@amd.troyhebe> (raw)
In-Reply-To: <alpine.LFD.2.00.0810151630050.3288@nehalem.linux-foundation.org>

On Wed, 2008-10-15 at 23:40 +0000, Linus Torvalds wrote:
> 
> On Wed, 15 Oct 2008, Bob Montgomery wrote:
> >
> > This patch changes the initialization of the GART to set the DISGARTCPU
> > bit in the GART Aperture Control Register (AMD64_GARTAPERTURECTL).
> > Setting the bit prevents requests from the CPUs from accessing the
> > GART.  In other words, CPU memory accesses to the aperture address
> > range will not cause the GART to perform an address translation.
> > The aperture area is currently being unmapped at the kernel level
> > with set_memory_np() in gart_iommu_init to prevent accesses from the
> > CPU [...]
> 
> Would this allow us to get rid of that particular hackup code sequence
> entirely? Or do we still need them for other chip versions etc?

Short answer: I don't know.  Here's some of what I don't know enough
about:

The GART aperture is typically overlaid over a real memory area, so it
effectively wastes the 64MB (or whatever) of RAM underneath it.  When
you disable CPU side access in the GART itself, the kernel once again
should "see" that RAM and presumably use it.  But, it wouldn't be
general purpose RAM, because it couldn't be used for DMA (since any
accesses from the IO side would be GART'd off to somewhere else).
Would that make it overly hacky?

It appears to be possible for a BIOS to set up a valid aperture that
does not overlay real memory.   Mine never does, so I get dmesgs like:

[    0.000999] Node 0: aperture @ 20000000 size 32 MB
[    0.000999] Aperture pointing to e820 RAM. Ignoring.
[    0.000999] Your BIOS doesn't leave a aperture memory hole
[    0.000999] Please enable the IOMMU option in the BIOS setup
[    0.000999] This costs you 64 MB of RAM
[    0.000999] Mapping aperture over 65536 KB of RAM @ 20000000

But if it did set up over a hole, would the current code still call
set_memory_np for an address that wasn't RAM in the e820 map?  Would
that be a problem or a NOP?   

> 
> I get the feeling that the people cc'd are kdump people, not iommu/gart
> people, which is a bit sad.

Noted. Thanks to Ingo for the cc's.   Chandru was cc'd because he was
the only other person I knew who had seen the problem, and he tested the
fix first on 2.6.27-rc8.

> 
>                 Linus

Bob Montgomery


  reply	other threads:[~2008-10-16 19:17 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-15 21:48 [PATCH] disable CPU side GART accesses Bob Montgomery
2008-10-15 23:40 ` Linus Torvalds
2008-10-16 19:17   ` Bob Montgomery [this message]
2008-10-15 23:48 ` Ingo Molnar
2008-10-16  0:22   ` Yinghai Lu
2008-10-16 17:00     ` Bob Montgomery
2008-10-16 17:43       ` Yinghai Lu
2008-10-16 19:26         ` Bob Montgomery
2008-10-27 22:42   ` Bob Montgomery
2008-10-27 23:06     ` Yinghai Lu
2008-10-29 20:52       ` Bob Montgomery
2008-10-29 21:24         ` Dave Airlie
2008-10-29 21:32           ` Dave Jones
2008-10-29 21:40             ` Dave Airlie
2008-11-03 23:36               ` Bob Montgomery
2008-11-03 23:55                 ` Dave Airlie
2008-11-19 22:12                   ` Bob Montgomery

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=1224184640.2215.293.camel@amd.troyhebe \
    --to=bob.montgomery@hp.com \
    --cc=chandru@in.ibm.com \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=jbarnes@virtuousgeek.org \
    --cc=joerg.roedel@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=torvalds@linux-foundation.org \
    --cc=vojtech@suse.cz \
    --cc=yinghai@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