From: "David S. Miller" <davem@davemloft.net>
To: chris@zankel.net
Cc: linux-kernel@vger.kernel.org
Subject: Re: Cache Aliasing
Date: Thu, 16 Mar 2006 14:39:37 -0800 (PST) [thread overview]
Message-ID: <20060316.143937.06336406.davem@davemloft.net> (raw)
In-Reply-To: <4419CCCD.8070208@zankel.net>
From: Chris Zankel <chris@zankel.net>
Date: Thu, 16 Mar 2006 12:38:37 -0800
> I am stuck trying to figure out why the sparc64 implementation for cache
> aliasing actually works:
>
> From my understanding, any kernel (or driver) function can
> allocate/free pages with __page_alloc() / free_page(). I couldn't find
> any place, however, where the cache is flushed in either case, so there
> might be some residue in the cache.
>
> During allocation of user pages, the sparc64 implementation might
> temporarily map that page to a cache-coherent location (TLBTEMP_BASE+x)
> for {clear|copy}_user_page. At that time, however, couldn't there still
> be dirty lines in the other 'half' of the cache from the previous kernel
> allocation?
It doesn't matter, the user and the kernel never access the other
alias, since the are accessing the page using only that particular
color.
> I'd appreciate any direction where I could find more information about
> this scenario or where I should look in the kernel code.
When you initially allocate a page, you make stores to initialize
it's contents, so aliasing doesn't matter from the perspective.
The stores will show up in the correct mappings in the D-cache.
The UltraSPARC programmer's reference manual even states this
explicitly: "A change in virtual color when allocating a free
page does not require a D-cache flush because the D-cache is
write-through."
next prev parent reply other threads:[~2006-03-16 22:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-16 20:38 Chris Zankel
2006-03-16 22:39 ` David S. Miller [this message]
-- strict thread matches above, loose matches on Subject: below --
2003-02-25 7:24 Cache aliasing John Newlin
2003-02-26 3:59 ` David S. Miller
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=20060316.143937.06336406.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=chris@zankel.net \
--cc=linux-kernel@vger.kernel.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®