Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 136693
b: refs/heads/master
c: 9b7ed8f
h: refs/heads/master
i:
  136691: 4c7a05d
v: v3
  • Loading branch information
H. Peter Anvin committed Jan 30, 2009
1 parent 6f2efa2 commit db7eaf0
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 35 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c43e0e46adf79c321ed3fbf0351e1005fb8a2413
refs/heads/master: 9b7ed8faa034fc2d350e2eff5c68680eb5c43a07
3 changes: 1 addition & 2 deletions trunk/arch/x86/include/asm/page.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ static inline pteval_t native_pte_val(pte_t pte)
return pte.pte;
}

static inline pteval_t native_pte_flags(pte_t pte)
static inline pteval_t pte_flags(pte_t pte)
{
return native_pte_val(pte) & PTE_FLAGS_MASK;
}
Expand All @@ -173,7 +173,6 @@ static inline pteval_t native_pte_flags(pte_t pte)
#endif

#define pte_val(x) native_pte_val(x)
#define pte_flags(x) native_pte_flags(x)
#define __pte(x) native_make_pte(x)

#endif /* CONFIG_PARAVIRT */
Expand Down
18 changes: 0 additions & 18 deletions trunk/arch/x86/include/asm/paravirt.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,6 @@ struct pv_mmu_ops {
pte_t *ptep, pte_t pte);

pteval_t (*pte_val)(pte_t);
pteval_t (*pte_flags)(pte_t);
pte_t (*make_pte)(pteval_t pte);

pgdval_t (*pgd_val)(pgd_t);
Expand Down Expand Up @@ -1086,23 +1085,6 @@ static inline pteval_t pte_val(pte_t pte)
return ret;
}

static inline pteval_t pte_flags(pte_t pte)
{
pteval_t ret;

if (sizeof(pteval_t) > sizeof(long))
ret = PVOP_CALL2(pteval_t, pv_mmu_ops.pte_flags,
pte.pte, (u64)pte.pte >> 32);
else
ret = PVOP_CALL1(pteval_t, pv_mmu_ops.pte_flags,
pte.pte);

#ifdef CONFIG_PARAVIRT_DEBUG
BUG_ON(ret & PTE_PFN_MASK);
#endif
return ret;
}

static inline pgd_t __pgd(pgdval_t val)
{
pgdval_t ret;
Expand Down
38 changes: 26 additions & 12 deletions trunk/arch/x86/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,64 +240,78 @@ static inline int pmd_large(pmd_t pte)
(_PAGE_PSE | _PAGE_PRESENT);
}

static inline pte_t pte_set_flags(pte_t pte, pteval_t set)
{
pteval_t v = native_pte_val(pte);

return native_make_pte(v | set);
}

static inline pte_t pte_clear_flags(pte_t pte, pteval_t clear)
{
pteval_t v = native_pte_val(pte);

return native_make_pte(v & ~clear);
}

static inline pte_t pte_mkclean(pte_t pte)
{
return __pte(pte_val(pte) & ~_PAGE_DIRTY);
return pte_clear_flags(pte, _PAGE_DIRTY);
}

static inline pte_t pte_mkold(pte_t pte)
{
return __pte(pte_val(pte) & ~_PAGE_ACCESSED);
return pte_clear_flags(pte, _PAGE_ACCESSED);
}

static inline pte_t pte_wrprotect(pte_t pte)
{
return __pte(pte_val(pte) & ~_PAGE_RW);
return pte_clear_flags(pte, _PAGE_RW);
}

static inline pte_t pte_mkexec(pte_t pte)
{
return __pte(pte_val(pte) & ~_PAGE_NX);
return pte_clear_flags(pte, _PAGE_NX);
}

static inline pte_t pte_mkdirty(pte_t pte)
{
return __pte(pte_val(pte) | _PAGE_DIRTY);
return pte_set_flags(pte, _PAGE_DIRTY);
}

static inline pte_t pte_mkyoung(pte_t pte)
{
return __pte(pte_val(pte) | _PAGE_ACCESSED);
return pte_set_flags(pte, _PAGE_ACCESSED);
}

static inline pte_t pte_mkwrite(pte_t pte)
{
return __pte(pte_val(pte) | _PAGE_RW);
return pte_set_flags(pte, _PAGE_RW);
}

static inline pte_t pte_mkhuge(pte_t pte)
{
return __pte(pte_val(pte) | _PAGE_PSE);
return pte_set_flags(pte, _PAGE_PSE);
}

static inline pte_t pte_clrhuge(pte_t pte)
{
return __pte(pte_val(pte) & ~_PAGE_PSE);
return pte_clear_flags(pte, _PAGE_PSE);
}

static inline pte_t pte_mkglobal(pte_t pte)
{
return __pte(pte_val(pte) | _PAGE_GLOBAL);
return pte_set_flags(pte, _PAGE_GLOBAL);
}

static inline pte_t pte_clrglobal(pte_t pte)
{
return __pte(pte_val(pte) & ~_PAGE_GLOBAL);
return pte_clear_flags(pte, _PAGE_GLOBAL);
}

static inline pte_t pte_mkspecial(pte_t pte)
{
return __pte(pte_val(pte) | _PAGE_SPECIAL);
return pte_set_flags(pte, _PAGE_SPECIAL);
}

extern pteval_t __supported_pte_mask;
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/x86/kernel/paravirt.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,6 @@ struct pv_mmu_ops pv_mmu_ops = {
#endif /* PAGETABLE_LEVELS >= 3 */

.pte_val = native_pte_val,
.pte_flags = native_pte_flags,
.pgd_val = native_pgd_val,

.make_pte = native_make_pte,
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/x86/xen/enlighten.c
Original file line number Diff line number Diff line change
Expand Up @@ -1307,7 +1307,6 @@ static const struct pv_mmu_ops xen_mmu_ops __initdata = {
.ptep_modify_prot_commit = __ptep_modify_prot_commit,

.pte_val = xen_pte_val,
.pte_flags = native_pte_flags,
.pgd_val = xen_pgd_val,

.make_pte = xen_make_pte,
Expand Down

0 comments on commit db7eaf0

Please sign in to comment.