Lines 1780-1785
static inline int update_intpte(intpte_t *p,
Link Here
|
1780 |
_t ## e_get_intpte(_o), _t ## e_get_intpte(_n), \ |
1780 |
_t ## e_get_intpte(_o), _t ## e_get_intpte(_n), \ |
1781 |
(_m), (_v), (_ad)) |
1781 |
(_m), (_v), (_ad)) |
1782 |
|
1782 |
|
|
|
1783 |
/* |
1784 |
* PTE flags that a guest may change without re-validating the PTE. |
1785 |
* All other bits affect translation, caching, or Xen's safety. |
1786 |
*/ |
1787 |
#define FASTPATH_FLAG_WHITELIST \ |
1788 |
(_PAGE_NX_BIT | _PAGE_AVAIL_HIGH | _PAGE_AVAIL | _PAGE_GLOBAL | \ |
1789 |
_PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_USER) |
1790 |
|
1783 |
/* Update the L1 entry at pl1e to new value nl1e. */ |
1791 |
/* Update the L1 entry at pl1e to new value nl1e. */ |
1784 |
static int mod_l1_entry(l1_pgentry_t *pl1e, l1_pgentry_t nl1e, |
1792 |
static int mod_l1_entry(l1_pgentry_t *pl1e, l1_pgentry_t nl1e, |
1785 |
unsigned long gl1mfn, int preserve_ad, |
1793 |
unsigned long gl1mfn, int preserve_ad, |
Lines 1820-1828
static int mod_l1_entry(l1_pgentry_t *pl1e, l1_pgentry_t nl1e,
Link Here
|
1820 |
return -EINVAL; |
1828 |
return -EINVAL; |
1821 |
} |
1829 |
} |
1822 |
|
1830 |
|
1823 |
/* Fast path for identical mapping, r/w, presence, and cachability. */ |
1831 |
/* Fast path for sufficiently-similar mappings. */ |
1824 |
if ( !l1e_has_changed(ol1e, nl1e, |
1832 |
if ( !l1e_has_changed(ol1e, nl1e, ~FASTPATH_FLAG_WHITELIST) ) |
1825 |
PAGE_CACHE_ATTRS | _PAGE_RW | _PAGE_PRESENT) ) |
|
|
1826 |
{ |
1833 |
{ |
1827 |
adjust_guest_l1e(nl1e, pt_dom); |
1834 |
adjust_guest_l1e(nl1e, pt_dom); |
1828 |
if ( UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, pt_vcpu, |
1835 |
if ( UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, pt_vcpu, |
Lines 1904-1914
static int mod_l2_entry(l2_pgentry_t *pl2e,
Link Here
|
1904 |
return -EINVAL; |
1911 |
return -EINVAL; |
1905 |
} |
1912 |
} |
1906 |
|
1913 |
|
1907 |
/* Fast path for identical mapping and presence. */ |
1914 |
/* Fast path for sufficiently-similar mappings. */ |
1908 |
if ( !l2e_has_changed(ol2e, nl2e, |
1915 |
if ( !l2e_has_changed(ol2e, nl2e, ~FASTPATH_FLAG_WHITELIST) ) |
1909 |
unlikely(opt_allow_superpage) |
|
|
1910 |
? _PAGE_PSE | _PAGE_RW | _PAGE_PRESENT |
1911 |
: _PAGE_PRESENT) ) |
1912 |
{ |
1916 |
{ |
1913 |
adjust_guest_l2e(nl2e, d); |
1917 |
adjust_guest_l2e(nl2e, d); |
1914 |
if ( UPDATE_ENTRY(l2, pl2e, ol2e, nl2e, pfn, vcpu, preserve_ad) ) |
1918 |
if ( UPDATE_ENTRY(l2, pl2e, ol2e, nl2e, pfn, vcpu, preserve_ad) ) |
Lines 1973-1980
static int mod_l3_entry(l3_pgentry_t *pl3e,
Link Here
|
1973 |
return -EINVAL; |
1977 |
return -EINVAL; |
1974 |
} |
1978 |
} |
1975 |
|
1979 |
|
1976 |
/* Fast path for identical mapping and presence. */ |
1980 |
/* Fast path for sufficiently-similar mappings. */ |
1977 |
if ( !l3e_has_changed(ol3e, nl3e, _PAGE_PRESENT) ) |
1981 |
if ( !l3e_has_changed(ol3e, nl3e, ~FASTPATH_FLAG_WHITELIST) ) |
1978 |
{ |
1982 |
{ |
1979 |
adjust_guest_l3e(nl3e, d); |
1983 |
adjust_guest_l3e(nl3e, d); |
1980 |
rc = UPDATE_ENTRY(l3, pl3e, ol3e, nl3e, pfn, vcpu, preserve_ad); |
1984 |
rc = UPDATE_ENTRY(l3, pl3e, ol3e, nl3e, pfn, vcpu, preserve_ad); |
Lines 2037-2044
static int mod_l4_entry(l4_pgentry_t *pl4e,
Link Here
|
2037 |
return -EINVAL; |
2041 |
return -EINVAL; |
2038 |
} |
2042 |
} |
2039 |
|
2043 |
|
2040 |
/* Fast path for identical mapping and presence. */ |
2044 |
/* Fast path for sufficiently-similar mappings. */ |
2041 |
if ( !l4e_has_changed(ol4e, nl4e, _PAGE_PRESENT) ) |
2045 |
if ( !l4e_has_changed(ol4e, nl4e, ~FASTPATH_FLAG_WHITELIST) ) |
2042 |
{ |
2046 |
{ |
2043 |
adjust_guest_l4e(nl4e, d); |
2047 |
adjust_guest_l4e(nl4e, d); |
2044 |
rc = UPDATE_ENTRY(l4, pl4e, ol4e, nl4e, pfn, vcpu, preserve_ad); |
2048 |
rc = UPDATE_ENTRY(l4, pl4e, ol4e, nl4e, pfn, vcpu, preserve_ad); |