Lines 1852-1857
static inline int update_intpte(intpte_t *p,
Link Here
|
1852 |
_t ## e_get_intpte(_o), _t ## e_get_intpte(_n), \ |
1852 |
_t ## e_get_intpte(_o), _t ## e_get_intpte(_n), \ |
1853 |
(_m), (_v), (_ad)) |
1853 |
(_m), (_v), (_ad)) |
1854 |
|
1854 |
|
|
|
1855 |
/* |
1856 |
* PTE flags that a guest may change without re-validating the PTE. |
1857 |
* All other bits affect translation, caching, or Xen's safety. |
1858 |
*/ |
1859 |
#define FASTPATH_FLAG_WHITELIST \ |
1860 |
(_PAGE_NX_BIT | _PAGE_AVAIL_HIGH | _PAGE_AVAIL | _PAGE_GLOBAL | \ |
1861 |
_PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_USER) |
1862 |
|
1855 |
/* Update the L1 entry at pl1e to new value nl1e. */ |
1863 |
/* Update the L1 entry at pl1e to new value nl1e. */ |
1856 |
static int mod_l1_entry(l1_pgentry_t *pl1e, l1_pgentry_t nl1e, |
1864 |
static int mod_l1_entry(l1_pgentry_t *pl1e, l1_pgentry_t nl1e, |
1857 |
unsigned long gl1mfn, int preserve_ad, |
1865 |
unsigned long gl1mfn, int preserve_ad, |
Lines 1891-1899
static int mod_l1_entry(l1_pgentry_t *pl1e, l1_pgentry_t nl1e,
Link Here
|
1891 |
nl1e = l1e_from_pfn(page_to_mfn(page), l1e_get_flags(nl1e)); |
1899 |
nl1e = l1e_from_pfn(page_to_mfn(page), l1e_get_flags(nl1e)); |
1892 |
} |
1900 |
} |
1893 |
|
1901 |
|
1894 |
/* Fast path for identical mapping, r/w, presence, and cachability. */ |
1902 |
/* Fast path for sufficiently-similar mappings. */ |
1895 |
if ( !l1e_has_changed(ol1e, nl1e, |
1903 |
if ( !l1e_has_changed(ol1e, nl1e, ~FASTPATH_FLAG_WHITELIST) ) |
1896 |
PAGE_CACHE_ATTRS | _PAGE_RW | _PAGE_PRESENT) ) |
|
|
1897 |
{ |
1904 |
{ |
1898 |
adjust_guest_l1e(nl1e, pt_dom); |
1905 |
adjust_guest_l1e(nl1e, pt_dom); |
1899 |
rc = UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, pt_vcpu, |
1906 |
rc = UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, pt_vcpu, |
Lines 1970-1980
static int mod_l2_entry(l2_pgentry_t *pl2e,
Link Here
|
1970 |
return -EINVAL; |
1977 |
return -EINVAL; |
1971 |
} |
1978 |
} |
1972 |
|
1979 |
|
1973 |
/* Fast path for identical mapping and presence. */ |
1980 |
/* Fast path for sufficiently-similar mappings. */ |
1974 |
if ( !l2e_has_changed(ol2e, nl2e, |
1981 |
if ( !l2e_has_changed(ol2e, nl2e, ~FASTPATH_FLAG_WHITELIST) ) |
1975 |
unlikely(opt_allow_superpage) |
|
|
1976 |
? _PAGE_PSE | _PAGE_RW | _PAGE_PRESENT |
1977 |
: _PAGE_PRESENT) ) |
1978 |
{ |
1982 |
{ |
1979 |
adjust_guest_l2e(nl2e, d); |
1983 |
adjust_guest_l2e(nl2e, d); |
1980 |
if ( UPDATE_ENTRY(l2, pl2e, ol2e, nl2e, pfn, vcpu, preserve_ad) ) |
1984 |
if ( UPDATE_ENTRY(l2, pl2e, ol2e, nl2e, pfn, vcpu, preserve_ad) ) |
Lines 2039-2046
static int mod_l3_entry(l3_pgentry_t *pl3e,
Link Here
|
2039 |
return -EINVAL; |
2043 |
return -EINVAL; |
2040 |
} |
2044 |
} |
2041 |
|
2045 |
|
2042 |
/* Fast path for identical mapping and presence. */ |
2046 |
/* Fast path for sufficiently-similar mappings. */ |
2043 |
if ( !l3e_has_changed(ol3e, nl3e, _PAGE_PRESENT) ) |
2047 |
if ( !l3e_has_changed(ol3e, nl3e, ~FASTPATH_FLAG_WHITELIST) ) |
2044 |
{ |
2048 |
{ |
2045 |
adjust_guest_l3e(nl3e, d); |
2049 |
adjust_guest_l3e(nl3e, d); |
2046 |
rc = UPDATE_ENTRY(l3, pl3e, ol3e, nl3e, pfn, vcpu, preserve_ad); |
2050 |
rc = UPDATE_ENTRY(l3, pl3e, ol3e, nl3e, pfn, vcpu, preserve_ad); |
Lines 2103-2110
static int mod_l4_entry(l4_pgentry_t *pl4e,
Link Here
|
2103 |
return -EINVAL; |
2107 |
return -EINVAL; |
2104 |
} |
2108 |
} |
2105 |
|
2109 |
|
2106 |
/* Fast path for identical mapping and presence. */ |
2110 |
/* Fast path for sufficiently-similar mappings. */ |
2107 |
if ( !l4e_has_changed(ol4e, nl4e, _PAGE_PRESENT) ) |
2111 |
if ( !l4e_has_changed(ol4e, nl4e, ~FASTPATH_FLAG_WHITELIST) ) |
2108 |
{ |
2112 |
{ |
2109 |
adjust_guest_l4e(nl4e, d); |
2113 |
adjust_guest_l4e(nl4e, d); |
2110 |
rc = UPDATE_ENTRY(l4, pl4e, ol4e, nl4e, pfn, vcpu, preserve_ad); |
2114 |
rc = UPDATE_ENTRY(l4, pl4e, ol4e, nl4e, pfn, vcpu, preserve_ad); |