mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Terence Ripperda <tripperda@nvidia.com>
To: Andi Kleen <ak@muc.de>
Cc: Terence Ripperda <tripperda@nvidia.com>,
	linux-kernel@vger.kernel.org, eich@suse.de
Subject: Re: PAT support
Date: Wed, 21 Apr 2004 18:19:42 -0500	[thread overview]
Message-ID: <20040421231942.GC18735@hygelac> (raw)
In-Reply-To: <20040420185112.GB76023@colin2.muc.de>

[-- Attachment #1: Type: text/plain, Size: 2900 bytes --]


ok, got this finished up. modified change_page_attr to take a kernel virtual address instead of a page struct. also introduced restore_page_attr, which releases the cmap_range and assumed a pgprot of type PAGE_KERNEL. tweaked the change_page_attr a little to allow virtual addresses, convert from virtual to physical. if you'd prefer any style changes to what I made, feel free to flame me.

I also merged the ioremap functions into a single function (which really just means moving change_page_attr into __ioremap) and made ioremap, ioremap_nocache, and ioremap_wrcomb as inline routines that send the appropriate flags into __ioremap.

fixed an oversight in cmap_convert_flags.

updated all references to change_page_attr to use the correct arguments, but still need to finish the core function changes for x86_64.


between finishing this up and making a first pass at the /proc/bus/pci/* changes, I made some "doh!" realizations:

change_page_attr takes a kernel virtual address currently. this doesn't work well for mmap situations, which have a user virtual address. lookup_address could theoretically be changed to handle this (by switching between kernel & user pgd), but this wouldn't work for 4G/4G kernels.

change_page_attr can't take a physical address, since then it couldn't change_page_attr (change the page table attributes).

a side effect of having cmap_request_range being part of change_page_attr is that the caller must first setup the page tables for the virtual mapping, then check if the caching is ok. it would seem preferrable to use cmap_request_range to check if the caching is ok, setup the page tables, then modify the page tables via change_page_attr (for kernel pages). 

I haven't looked too closely yet, but it would seem like all of this could be encapsulated in remap_page_range and ioremap (ie, driver writers would never call cmap_ routines directly). I'll spend a day or two looking into how well this works.


Thanks,
Terence

On Tue, Apr 20, 2004 at 11:51:12AM -0700, ak@muc.de wrote:
> On Mon, Apr 19, 2004 at 05:54:57PM -0500, Terence Ripperda wrote:
> > > I think I prefer the do/undo model instead of push/pop.
> > > That can work with cmaps too. PAGE_KERNEL means no cmap,
> > > PAGE_KERNEL_WC and PAGE_KERNEL_NOCACHE get a cmap.
> > 
> > but then what is the point of cmap? I would expect a mix of WC and UC
> mappings to be much less dangerous than a mix of WC/UC and WB. perhaps
> my mindset is wrong, but it seems allowing ioremap to request a cached
> mapping is important, and that if that mapping was followed by
> ioremap_nocached or ioremap_wrcomb, that these subsequent calls should
> fail.
> 
> Hmm, you're right. push/pop is probably better for io-mappings,
> otherwise
> we cannot catch existing mappings.  This will be needed for user mmap
> too.
> 
> Ignore my previous suggestion on that then please. Sorry for the noise.
> 
> 
> -Andi

[-- Attachment #2: cachemap-1.10-2.6.4.patch.bz2 --]
[-- Type: application/octet-stream, Size: 13570 bytes --]

  reply	other threads:[~2004-04-21 23:20 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1KifY-uA-7@gated-at.bofh.it>
2004-04-13  0:01 ` Andi Kleen
2004-04-13 16:21   ` Terence Ripperda
2004-04-14  0:58     ` Andi Kleen
2004-04-16 18:07       ` Terence Ripperda
2004-04-17  0:42         ` Andi Kleen
2004-04-19 22:54           ` Terence Ripperda
2004-04-20 18:51             ` Andi Kleen
2004-04-21 23:19               ` Terence Ripperda [this message]
2004-04-22  4:21                 ` Andi Kleen
2004-04-15  4:11   ` Eric W. Biederman
2004-04-15 16:38     ` Andi Kleen
2004-04-15 18:39       ` Eric W. Biederman
2004-04-15 21:38 Albert Cahalan
  -- strict thread matches above, loose matches on Subject: below --
2004-04-13  5:34 Manfred Spraul
2004-04-13 14:02 ` Pavel Machek
2004-04-13 16:40 ` Terence Ripperda
2004-04-15  4:05 ` Eric W. Biederman
2004-04-12 22:29 Terence Ripperda
2004-04-13  8:36 ` Andy Whitcroft
2004-04-13 16:50   ` Terence Ripperda

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=20040421231942.GC18735@hygelac \
    --to=tripperda@nvidia.com \
    --cc=ak@muc.de \
    --cc=eich@suse.de \
    --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®