mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Suresh Siddha <suresh.b.siddha@intel.com>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: "mingo@elte.hu" <mingo@elte.hu>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"Pallipadi, Venkatesh" <venkatesh.pallipadi@intel.com>,
	"xam@debian.org" <xam@debian.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [patch] x86, pat: allow ISA memory range uncacheable mapping requests
Date: Mon, 17 Aug 2009 15:15:09 -0700	[thread overview]
Message-ID: <1250547309.2709.251.camel@sbs-t61.sc.intel.com> (raw)
In-Reply-To: <4A89C76B.2020307@zytor.com>

On Mon, 2009-08-17 at 14:11 -0700, H. Peter Anvin wrote:
> On 08/17/2009 01:23 PM, Suresh Siddha wrote:
> > Max Vozeler reported:
> >>  Bug 13877 -  bogl-term broken with CONFIG_X86_PAT=y, works with =n  
> >>
> >>  strace of bogl-term:
> >>  814   mmap2(NULL, 65536, PROT_READ|PROT_WRITE, MAP_SHARED, 4, 0)
> >> 				 = -1 EAGAIN (Resource temporarily unavailable)
> >>  814   write(2, "bogl: mmaping /dev/fb0: Resource temporarily unavailable\n",
> >> 	       57) = 57
> > 
> > PAT code maps the ISA memory range as WB in the PAT attribute, so that
> > fixed range MTRR registers define the actual memory type (UC/WC/WT etc).
> > 
> > But the upper level is_new_memtype_allowed() API checks are failing,
> > as the request here is for UC and the return tracked type is WB (Tracked type is
> > WB as MTRR type for this legacy range potentially will be different for each
> > 4k page).
> > 
> > Fix is_new_memtype_allowed() by always succeeding the ISA address range
> > checks, as the null PAT (WB) and def MTRR fixed range register settings
> > satisfy the memory type needs of the applications that map the ISA address
> > range.
> 
> This patch seems correct in that it matches the current behavior of the
> code.  I have, though, to ask what the logic behind treating the ISA
> region in this way is.

With the (legacy) applications mapping this ISA region we have observed

a) they typically map more than what they want. some of this might be
covering some RAM backed pages  which are at < 1MB

b) they really don't care about the requested attribute but some specify
uncached and some don't specify any attribute

And mapped ISA range can have different memory attributes (UC, WT, WP
etc) based on the MTRR fixed range registers.

> From a hardware perspective it makes sense --
> these addresses have the Legacy MTRRs which are like a
> physical-address-based PAT, but it seems somewhat odd that'd we would
> expect applications to use different APIs for this region.

We are using the same pat API but the API handles this legacy range
differently.

Atleast some of the special ISA checks can be simplified by tracking the
memory range page by page (based on the attribute set by mtrr etc) for
this region and not at the granularity of the user mapping request. But
we need to pass the per page attributes to the higher level API's like
ioremap() or remap_pfn_range()  who has to set different attributes for
these pfn's. Not sure if this is all worth for some legacy applications
which are not performance sensitive and all they want is to just access
those memory ranges.

thanks,
suresh


      reply	other threads:[~2009-08-17 22:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-17 20:23 Suresh Siddha
2009-08-17 21:11 ` H. Peter Anvin
2009-08-17 22:15   ` Suresh Siddha [this message]

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=1250547309.2709.251.camel@sbs-t61.sc.intel.com \
    --to=suresh.b.siddha@intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --cc=venkatesh.pallipadi@intel.com \
    --cc=xam@debian.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

all inboxes | Powered by JetHome®