Re: [PATCH] x86-64: disable the GART before allocate aperture

Andi Kleen
2007-06-22T21:29:32Z

On Friday 22 June 2007 22:33, Alan Cox wrote:
> On Fri, 22 Jun 2007 12:31:24 -0700
>
> Muli Ben-Yehuda <muli@il.ibm.com> wrote:
> > On Fri, Jun 22, 2007 at 12:19:15PM -0700, Yinghai Lu wrote:
> > > [PATCH] x86-64: disable the GART before allocate aperture
> > >
> > > For K8 system: 4G RAM with memory hole remapping enabled, or more
> > > than 4G RAM installed. when mem is allocated for GART, it will do
> > > the memset for clear. and for kexec case, the first kernel already
> > > enable that, the memset in second kernel will cause the system
> > > restart. So disable that at first before we try to allocate mem for
> > > it.
> >
> > Why does the memset in the second kernel cause a system restart?
>
> You've got mapped live gart pages from the previous kernel. Even if you
> disable the gart before a memset

It's probably too late then. It could also interfere with other operations.
If anything the GART should be disabled during kexec shutdown. Perhaps we just
need a suitable suspend function that does that. Eric, any preferences?

> you may well have the video card using
> gart translations and possibly live IOMMU mappings for devices using it
> via bus mastering - and those will cause you MCE exceptions with a
> corrupt cpu context flag (ie not nicely recoverable).

We disable those machine checks on K8 because they're not fully reliable.

-Andi