linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Dan Malek <dan@embeddededge.com>
To: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
Cc: linux-ppc-embedded <linuxppc-embedded@ozlabs.org>
Subject: Re: [PATCH] 8xx: fix usage of pinned 8Mbyte TLB entries
Date: Fri, 6 May 2005 23:09:15 -0400	[thread overview]
Message-ID: <84773f72b8bba863c9471c0d121223a8@embeddededge.com> (raw)
In-Reply-To: <20050506200338.GC14486@logos.cnet>


On May 6, 2005, at 4:03 PM, Marcelo Tosatti wrote:

> The data I have tells me otherwise. I have seen the I-TLB entries
> getting created for kernel space.

Of course.  That's because the pinned entries aren't working :-)

> Can't the BDI work on the 8Mbyte page?  Same for other software
> or debuggers...

The BDI can, but other software functions will walk the page
tables looking for PTE information.

>         /* get the PTE for the bootpage */
>         if (!get_pteptr(&init_mm, bootpage, &pte))
>                panic("get_pteptr failed\n");
>
>         /* and make it uncachable */
>         pte_val(*pte) |= _PAGE_NO_CACHE;
>         _tlbie(bootpage);

This is a bad hack (that I wrote) that needs to get fixed.

> Because DMA pages need to have their PTE's marked as uncached, which 
> in turn
> means their TLB's need to be marked as uncached.

Right, but these are allocated from the vmalloc() space, far away
from the pinned entries.

> I dont think you can have multiple overlapping TLB entries.

Sure you can, we do it all of the time.  The kernel maps all of
memory, and then user applications do it again.  The only time
it causes a problem is when you have different cache attributes
for the same physical page.  In this case, you need to ensure
you only use one mapping.  You can't have the same virtual
address twice in the TLB (iirc, the 8xx automatically invalidates
an existing one if you do this), but you can have the same
physical page mapped multiple times.


> How is the MMU supposed to decide between multiple mappings
> for the same address ?

You are thinking backward.  The MMU maps the virtual address
accessed, there is only one valid at a time.  You can have multiple
VM addresses accessing the same physical page.

> That is how it is now. See previous posts with detailed TLB debugging.

Something isn't correct if it isn't working.

> Maybe you thought you got it right because the initial 8Mbyte
> mapping works?

No, this is required to work for some execute in place from rom
systems I have done.  It was adapted from that.  The initial 8M
mapping must be evicted when the  mapin_ram() is done.  It's
supposed to happen that way.

> Unfortunately that mapping is trashed after overlapping
> pte's are created.

Right, that is supposed to happen unless TLB pinning
is configured.

Thanks.


	-- Dan

  reply	other threads:[~2005-05-07  3:09 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-05 17:20 [PATCH] 8xx: fix usage of pinned 8Mbyte TLB entries Marcelo Tosatti
2005-05-06 13:04 ` Jason McMullan
2005-05-06 11:39   ` Marcelo Tosatti
2005-05-06 16:43 ` Dan Malek
2005-05-06 13:38   ` Marcelo Tosatti
2005-05-06 22:49     ` Dan Malek
2005-05-06 20:03       ` Marcelo Tosatti
2005-05-07  3:09         ` Dan Malek [this message]
2005-05-06 23:05           ` Marcelo Tosatti
2005-05-07  4:39             ` Dan Malek
2005-05-07  5:16               ` Dan Malek
2005-05-07 13:16               ` Marcelo Tosatti
2005-05-07 20:02                 ` Dan Malek
2005-05-07 15:47                   ` Marcelo Tosatti
2005-05-07 14:05               ` Marcelo Tosatti
2005-05-09  6:09                 ` Pantelis Antoniou
2005-05-07 14:59             ` Wolfgang Denk
2005-05-07  5:27         ` Dan Malek
2005-05-07  5:55           ` Dan Malek
2005-05-06 23:10       ` Dan Malek

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=84773f72b8bba863c9471c0d121223a8@embeddededge.com \
    --to=dan@embeddededge.com \
    --cc=linuxppc-embedded@ozlabs.org \
    --cc=marcelo.tosatti@cyclades.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;
as well as URLs for NNTP newsgroup(s).