LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Yinghai Lu" <yhlu.kernel@gmail.com>
To: "Balaji Rao" <balajirrao@gmail.com>
Cc: "Ingo Molnar" <mingo@elte.hu>,
	linux-kernel@vger.kernel.org,
	"Thomas Gleixner" <tglx@linutronix.de>,
	jesse.barnes@intel.com, ak@suse.de
Subject: Re: [PATCH][Regression] x86, 32-bit: trim memory not covered by wb mtrrs - FIX
Date: Thu, 7 Feb 2008 00:50:35 -0800	[thread overview]
Message-ID: <86802c440802070050t2566a261t50cccd649912a4a9@mail.gmail.com> (raw)
In-Reply-To: <200802071351.02763.balajirrao@gmail.com>

On Feb 7, 2008 12:21 AM, Balaji Rao <balajirrao@gmail.com> wrote:
> On Thursday 07 February 2008 01:32:45 pm Ingo Molnar wrote:
> > * Balaji Rao <balajirrao@gmail.com> wrote:
> > > Hello,
> > >
> > > The following commit caused my X server to stop working.
> > >
> > > commit 99fc8d424bc5d803fe92cad56c068fe64e73747a
> > > Author: Jesse Barnes <jesse.barnes@intel.com>
> > > Date:   Wed Jan 30 13:33:18 2008 +0100
> > >
> > >     x86, 32-bit: trim memory not covered by wb mtrrs
> > >
> > > This patch fixes the improper handling of addresses > 4G by
> > > mtrr_trim_uncached_memory. This, now brings up X on my system.
> >
> > thanks. Incidentally this same bug was reported and fixed yesterday, and
> > that fix is upstream already. Could you please compare your solution to
> > Yinghai Lu's fix below, and send us a patch for any further improvements
> > (or cleanups) you might notice in that code? It seems to be almost the
> > same fix as yours. (and hopefully it fixes your X problem too)
>
> Cool! Yes, Yinghai Lu's patch indeed is the same as mine and its really
> surprising that we've used the same variable name too! :)

minor difference
+               trim_start = highest_pfn << PAGE_SHIFT;
+               trim_size = end_pfn << PAGE_SHIFT;

could cause some problem with 32 bit kernel when mem > 4g.
becase highest_pfn and end_pfn is unsigned long aka 32 bit ...could overflow.

so need to assign thtem to trim_start/trim_end at first
or
+               trim_start = (u64)highest_pfn << PAGE_SHIFT;
+               trim_size = (u64)end_pfn << PAGE_SHIFT;

YH

  reply	other threads:[~2008-02-07  8:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-07  7:27 Balaji Rao
2008-02-07  8:02 ` Ingo Molnar
2008-02-07  8:21   ` Balaji Rao
2008-02-07  8:50     ` Yinghai Lu [this message]
2008-02-07  9:04       ` Ingo Molnar
2008-02-07  9:11         ` Yinghai Lu
2008-02-07 10:16           ` Ingo Molnar
2008-02-07 11:35       ` Balaji Rao
2008-02-07  8:56   ` Yinghai Lu
2008-02-07  9:00     ` Ingo Molnar

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=86802c440802070050t2566a261t50cccd649912a4a9@mail.gmail.com \
    --to=yhlu.kernel@gmail.com \
    --cc=ak@suse.de \
    --cc=balajirrao@gmail.com \
    --cc=jesse.barnes@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --subject='Re: [PATCH][Regression] x86, 32-bit: trim memory not covered by wb mtrrs - FIX' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).