ia64/xen-unstable
changeset 2451:426891ca6a6f
bitkeeper revision 1.1159.73.1 (413de483EcoXREVUizJpurRwrbzoLA)
Fast-path pagetable updates which change a mapping from writable to readonly.
Fast-path pagetable updates which change a mapping from writable to readonly.
author | cl349@freefall.cl.cam.ac.uk |
---|---|
date | Tue Sep 07 16:40:35 2004 +0000 (2004-09-07) |
parents | 875c25208085 |
children | 69045df0ee90 87870eaba49e |
files | xen/arch/x86/memory.c |
line diff
1.1 --- a/xen/arch/x86/memory.c Tue Sep 07 12:37:03 2004 +0000 1.2 +++ b/xen/arch/x86/memory.c Tue Sep 07 16:40:35 2004 +0000 1.3 @@ -380,6 +380,19 @@ get_linear_pagetable( 1.4 } 1.5 1.6 1.7 +static inline int 1.8 +readonly_page_from_l1e( 1.9 + l1_pgentry_t l1e) 1.10 +{ 1.11 + struct pfn_info *page = &frame_table[l1_pgentry_to_pagenr(l1e)]; 1.12 + unsigned long l1v = l1_pgentry_val(l1e); 1.13 + 1.14 + if ( !(l1v & _PAGE_PRESENT) || !pfn_is_ram(l1v >> PAGE_SHIFT) ) 1.15 + return 0; 1.16 + put_page_type(page); 1.17 + return 1; 1.18 +} 1.19 + 1.20 static int 1.21 get_page_from_l1e( 1.22 l1_pgentry_t l1e, struct domain *d) 1.23 @@ -1540,6 +1553,11 @@ void ptwr_reconnect_disconnected(unsigne 1.24 nl1e = pl1e[i]; 1.25 if (likely(l1_pgentry_val(nl1e) == l1_pgentry_val(ol1e))) 1.26 continue; 1.27 + if (likely(l1_pgentry_val(nl1e) == (l1_pgentry_val(ol1e) | _PAGE_RW))) 1.28 + { 1.29 + if (likely(readonly_page_from_l1e(nl1e))) 1.30 + continue; 1.31 + } 1.32 if (unlikely(l1_pgentry_val(ol1e) & _PAGE_PRESENT)) 1.33 put_page_from_l1e(ol1e, current); 1.34 if (unlikely(!get_page_from_l1e(nl1e, current))) {