public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Venki Pallipadi <venkatesh.pallipadi@intel.com>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Rufus & Azrael <rufus-azrael@numericable.fr>,
	Ingo Molnar <mingo@elte.hu>,
	"Siddha, Suresh B" <suresh.b.siddha@intel.com>,
	Linux-kernel Mailing List <linux-kernel@vger.kernel.org>,
	Yinghai Lu <yhlu.kernel@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [2.6.25-git18 => 2.6.26-rc1-git1] Xorg crash with	xf86MapVidMem error
Date: Thu, 8 May 2008 16:40:17 -0700	[thread overview]
Message-ID: <20080508234016.GA14169@linux-os.sc.intel.com> (raw)
In-Reply-To: <20080508215931.GA5035@jamoon.sc.intel.com>

On Thu, May 08, 2008 at 02:59:31PM -0700, Venkatesh Pallipadi wrote:
> On Thu, May 08, 2008 at 02:42:29PM -0700, H. Peter Anvin wrote:
> > Venki Pallipadi wrote:
> > >On Thu, May 08, 2008 at 01:08:01PM -0700, Rufus & Azrael wrote:
> > >>   Venki Pallipadi a ecrit :
> > >>   >
> > >>   > Use UC_MINUS in reserve_memtype call with -1, when MTRR lookup fails 
> > >>   for
> > >>   any
> > >>   > reason.
> > >>   >
> > >>   > Change the logic in mtrr_type_lookup to just get the type from the 
> > >>   start
> > >>   > address. Using start and end adddress is not right/complete as start 
> > >>   and
> > >>   > end can be covered by different mtrr (where old code will fail) or
> > >>   > start and end can be in same mtrr, but still have some different
> > >>   > memory type region in between. Using only start is less restrictive 
> > >>   and
> > >>   > deterministic.
> > >>   >
> > >>   > Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
> > >>   >
> > >>   > ---
> > >>   >  arch/x86/kernel/cpu/mtrr/generic.c |    7 ++-----
> > >>   >  arch/x86/mm/pat.c                  |    8 +-------
> > >>   >  2 files changed, 3 insertions(+), 12 deletions(-)
> > >>   >
> > >>
> > 
> > Hm...
> > 
> > I have *serious* concerns about this; this might paper over this 
> > particular problem, but it just isn't *correct*.
> > 
> > The fact that the range check is implemented incorrectly is not an 
> > excuse to just dump it and ignore the problem; it should be fixed instead.
> > 
> 
> I agree we need a better range check in place. But, the current one was not
> really doing anything useful and actually causing the side-effect
> regression. So, I felt not having it is better solution for now.
> 
> Other solution is to stay with start and end range check and just ignore the
> range check error with WC overlap in case where UC_MINUS is requested.
> 
> Given the way MTRRs are defined, the only way to do the full range check
> seems to be to go over page by page (from start to end), and check which
> variable range MTTR it matches with, which is obviously very excessive. As,
> this is not a problem in typical usage scenario.
> 

Also, note that we only look for start while looking at fixed range MTRRs.
This is not as scary as it seems. We are finding the effective memory type
by just looking at the start of the address range. We still go through
the PAT reserve free mechanism, once we find the effective memory type
and that list will catch any other users with conflicting type anywhere
in the start to end range. And we will still keep effective type consistent
across all mappings.

For example:
0xf0000000-0xf1000000 is mapped WC by one user with appropriate MTRR setting
0xf2000000-0xf3000000 is mapped UC by another user with appropriate MTRR setting

Now if there is a request to map
0xf0000000-0xf4000000, we do mtrr_lookup and assume effective type for the
whole range is WC. Then we go through PAT list to see any conflicts. And
while parsing the list, we will find there is an overlap with conflicting
attributes and we fail the reserve.

In case the second UC mapping above is not present, we use effective memory
type for the whole range 0xf0000000-0xf4000000 as WC and track it in our list
that way.

Thanks,
Venki

  parent reply	other threads:[~2008-05-08 23:40 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-04  8:24 [2.6.25-git18 => 2.6.26-rc1-git1] Xorg crash with xf86MapVidMem error Rufus & Azrael
2008-05-04  8:52 ` Ingo Molnar
2008-05-04  9:03   ` Rufus & Azrael
2008-05-05 17:26     ` Suresh Siddha
2008-05-05 22:19       ` Rufus & Azrael
2008-05-05 23:25         ` Venki Pallipadi
2008-05-05 23:49           ` Ingo Molnar
2008-05-06  2:09             ` Venki Pallipadi
2008-05-06 11:55               ` Ingo Molnar
     [not found]                 ` <4820962B.6050702@numericable.fr>
2008-05-06 20:34                   ` Pallipadi, Venkatesh
2008-05-06 21:56                     ` Rufus & Azrael
2008-05-06 22:05                       ` Pallipadi, Venkatesh
2008-05-07 20:58                         ` Rufus & Azrael
2008-05-07 22:12                           ` Pallipadi, Venkatesh
2008-05-08  7:08                             ` Rufus & Azrael
2008-05-08 13:18                               ` Pallipadi, Venkatesh
     [not found]                               ` <B5B0CFF685D7DF46A05CF1678CFB42ED20E04609@orsmsx423.amr.corp.intel.com>
2008-05-08 19:25                                 ` Venki Pallipadi
2008-05-08 20:08                                   ` Rufus & Azrael
2008-05-08 21:37                                     ` Venki Pallipadi
2008-05-08 21:42                                       ` H. Peter Anvin
     [not found]                                         ` <20080508215931.GA5035@jamoon.sc.intel.com>
2008-05-08 23:40                                           ` Venki Pallipadi [this message]
2008-05-08 23:54                                             ` H. Peter Anvin
2008-05-09  0:34                                               ` Venki Pallipadi
2008-05-09  0:49                                                 ` H. Peter Anvin
2008-05-09  0:52                                                 ` H. Peter Anvin
2008-05-09 13:46                                                   ` Pallipadi, Venkatesh
2008-05-29 19:01                                                 ` Venki Pallipadi
2008-05-29 21:51                                                   ` Rufus & Azrael
2008-05-31  8:10                                                     ` Ingo Molnar
2008-05-06 22:51                 ` Venki Pallipadi
2008-05-07  7:06                   ` Ingo Molnar
2008-05-07 21:42 ` Yinghai Lu

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=20080508234016.GA14169@linux-os.sc.intel.com \
    --to=venkatesh.pallipadi@intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rufus-azrael@numericable.fr \
    --cc=suresh.b.siddha@intel.com \
    --cc=tglx@linutronix.de \
    --cc=yhlu.kernel@gmail.com \
    /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