Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 588780 | Differences between
and this patch

Collapse All | Expand All

(-)a/xen/arch/x86/mm.c (-12 / +16 lines)
Lines 1695-1700 static inline int update_intpte(intpte_t *p, Link Here
1695
                  _t ## e_get_intpte(_o), _t ## e_get_intpte(_n),   \
1695
                  _t ## e_get_intpte(_o), _t ## e_get_intpte(_n),   \
1696
                  (_m), (_v), (_ad))
1696
                  (_m), (_v), (_ad))
1697
1697
1698
/*
1699
 * PTE flags that a guest may change without re-validating the PTE.
1700
 * All other bits affect translation, caching, or Xen's safety.
1701
 */
1702
#define FASTPATH_FLAG_WHITELIST                                     \
1703
    (_PAGE_NX_BIT | _PAGE_AVAIL_HIGH | _PAGE_AVAIL | _PAGE_GLOBAL | \
1704
     _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_USER)
1705
1698
/* Update the L1 entry at pl1e to new value nl1e. */
1706
/* Update the L1 entry at pl1e to new value nl1e. */
1699
static int mod_l1_entry(l1_pgentry_t *pl1e, l1_pgentry_t nl1e,
1707
static int mod_l1_entry(l1_pgentry_t *pl1e, l1_pgentry_t nl1e,
1700
                        unsigned long gl1mfn, int preserve_ad,
1708
                        unsigned long gl1mfn, int preserve_ad,
Lines 1735-1743 static int mod_l1_entry(l1_pgentry_t *pl1e, l1_pgentry_t nl1e, Link Here
1735
            return -EINVAL;
1743
            return -EINVAL;
1736
        }
1744
        }
1737
1745
1738
        /* Fast path for identical mapping, r/w, presence, and cachability. */
1746
        /* Fast path for sufficiently-similar mappings. */
1739
        if ( !l1e_has_changed(ol1e, nl1e,
1747
        if ( !l1e_has_changed(ol1e, nl1e, ~FASTPATH_FLAG_WHITELIST) )
1740
                              PAGE_CACHE_ATTRS | _PAGE_RW | _PAGE_PRESENT) )
1741
        {
1748
        {
1742
            adjust_guest_l1e(nl1e, pt_dom);
1749
            adjust_guest_l1e(nl1e, pt_dom);
1743
            if ( UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, pt_vcpu,
1750
            if ( UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, pt_vcpu,
Lines 1819-1829 static int mod_l2_entry(l2_pgentry_t *pl2e, Link Here
1819
            return -EINVAL;
1826
            return -EINVAL;
1820
        }
1827
        }
1821
1828
1822
        /* Fast path for identical mapping and presence. */
1829
        /* Fast path for sufficiently-similar mappings. */
1823
        if ( !l2e_has_changed(ol2e, nl2e,
1830
        if ( !l2e_has_changed(ol2e, nl2e, ~FASTPATH_FLAG_WHITELIST) )
1824
                              unlikely(opt_allow_superpage)
1825
                              ? _PAGE_PSE | _PAGE_RW | _PAGE_PRESENT
1826
                              : _PAGE_PRESENT) )
1827
        {
1831
        {
1828
            adjust_guest_l2e(nl2e, d);
1832
            adjust_guest_l2e(nl2e, d);
1829
            if ( UPDATE_ENTRY(l2, pl2e, ol2e, nl2e, pfn, vcpu, preserve_ad) )
1833
            if ( UPDATE_ENTRY(l2, pl2e, ol2e, nl2e, pfn, vcpu, preserve_ad) )
Lines 1888-1895 static int mod_l3_entry(l3_pgentry_t *pl3e, Link Here
1888
            return -EINVAL;
1892
            return -EINVAL;
1889
        }
1893
        }
1890
1894
1891
        /* Fast path for identical mapping and presence. */
1895
        /* Fast path for sufficiently-similar mappings. */
1892
        if ( !l3e_has_changed(ol3e, nl3e, _PAGE_PRESENT) )
1896
        if ( !l3e_has_changed(ol3e, nl3e, ~FASTPATH_FLAG_WHITELIST) )
1893
        {
1897
        {
1894
            adjust_guest_l3e(nl3e, d);
1898
            adjust_guest_l3e(nl3e, d);
1895
            rc = UPDATE_ENTRY(l3, pl3e, ol3e, nl3e, pfn, vcpu, preserve_ad);
1899
            rc = UPDATE_ENTRY(l3, pl3e, ol3e, nl3e, pfn, vcpu, preserve_ad);
Lines 1952-1959 static int mod_l4_entry(l4_pgentry_t *pl4e, Link Here
1952
            return -EINVAL;
1956
            return -EINVAL;
1953
        }
1957
        }
1954
1958
1955
        /* Fast path for identical mapping and presence. */
1959
        /* Fast path for sufficiently-similar mappings. */
1956
        if ( !l4e_has_changed(ol4e, nl4e, _PAGE_PRESENT) )
1960
        if ( !l4e_has_changed(ol4e, nl4e, ~FASTPATH_FLAG_WHITELIST) )
1957
        {
1961
        {
1958
            adjust_guest_l4e(nl4e, d);
1962
            adjust_guest_l4e(nl4e, d);
1959
            rc = UPDATE_ENTRY(l4, pl4e, ol4e, nl4e, pfn, vcpu, preserve_ad);
1963
            rc = UPDATE_ENTRY(l4, pl4e, ol4e, nl4e, pfn, vcpu, preserve_ad);
(-)a/xen/include/asm-x86/page.h (-1 / +1 lines)
Lines 308-313 void efi_update_l4_pgtable(unsigned int l4idx, l4_pgentry_t); Link Here
308
#define _PAGE_AVAIL2   _AC(0x800,U)
308
#define _PAGE_AVAIL2   _AC(0x800,U)
309
#define _PAGE_AVAIL    _AC(0xE00,U)
309
#define _PAGE_AVAIL    _AC(0xE00,U)
310
#define _PAGE_PSE_PAT _AC(0x1000,U)
310
#define _PAGE_PSE_PAT _AC(0x1000,U)
311
#define _PAGE_AVAIL_HIGH (_AC(0x7ff, U) << 12)
311
/* non-architectural flags */
312
/* non-architectural flags */
312
#define _PAGE_PAGED   0x2000U
313
#define _PAGE_PAGED   0x2000U
313
#define _PAGE_SHARED  0x4000U
314
#define _PAGE_SHARED  0x4000U
314
- 

Return to bug 588780