virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* how set_pte_at()'s vaddr and ptep args relate
@ 2006-11-07 19:57 Jeremy Fitzhardinge
  2006-11-07 22:19 ` Zachary Amsden
  0 siblings, 1 reply; 15+ messages in thread
From: Jeremy Fitzhardinge @ 2006-11-07 19:57 UTC (permalink / raw)
  To: Zachary Amsden; +Cc: Chris Wright, Virtualization Mailing List

Hi Zach,

I'm wondering what the interface requirements of set_pte_at()'s "addr" 
and "ptep" args are.  I presume that in general the ptep points to the 
pte entry which corresponds to the vaddr, but is this necessarily the case?

For example, it is valid to pass a non-highmem page kmap_atomic(), which 
will simply return a direct pointer to the page.

kunmap_atomic() takes this address, as well as the kmap slot index, and 
ends up calling:

    set_pte_at(&init_mm, lowmem_vaddr, kmap_ptep, 0);

ie, the vaddr and the ptep bear no relationship to each other.  Is this 
a bug in kunmap_atomic (it shouldn't try to clear the pte for lowmem 
addresses), or should set_pte_at's implementation be able to cope with this.

Certainly at the moment, having mismatched ptep and vaddr makes the 
interface useless for Xen, since it will use one or the other depending 
on whether we modifying the current pagetable or not, and it assume they 
correspond to the same thing.

For now I've changed kunmap_atomic() to only clear the kmap pte for 
mapped high page addresses, but I'm wondering what other places might 
use set_pte_at in this way.

Also, it would be useful for Xen to have a set_pte_at_sync, which also 
does a TLB flush if necessary, since we can do that in a single operation.

    J

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2006-11-09  9:15 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-07 19:57 how set_pte_at()'s vaddr and ptep args relate Jeremy Fitzhardinge
2006-11-07 22:19 ` Zachary Amsden
2006-11-07 22:38   ` Jeremy Fitzhardinge
2006-11-07 23:33     ` Zachary Amsden
2006-11-07 23:42       ` Jeremy Fitzhardinge
2006-11-07 23:59         ` Zachary Amsden
2006-11-08  0:15           ` Jeremy Fitzhardinge
2006-11-08  0:19             ` Zachary Amsden
2006-11-08  8:34             ` Keir Fraser
2006-11-08 19:59               ` Jeremy Fitzhardinge
2006-11-08 20:18                 ` Jeremy Fitzhardinge
2006-11-08 23:17                   ` Keir Fraser
2006-11-08 23:25                     ` Jeremy Fitzhardinge
2006-11-09  8:29                       ` Keir Fraser
2006-11-09  9:15                         ` Zachary Amsden

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).