Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 99538
b: refs/heads/master
c: a15af1c
h: refs/heads/master
v: v3
  • Loading branch information
Jeremy Fitzhardinge authored and Thomas Gleixner committed May 27, 2008
1 parent 9d9f893 commit a9af52b
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 10 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: 239d1fc04ed0b58d638096b12a7f6d50269d30c9
refs/heads/master: a15af1c9ea2750a9ff01e51615c45950bad8221b
1 change: 1 addition & 0 deletions trunk/arch/x86/kernel/paravirt.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ struct pv_mmu_ops pv_mmu_ops = {
#endif /* PAGETABLE_LEVELS >= 3 */

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

.make_pte = native_make_pte,
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/x86/xen/enlighten.c
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,7 @@ static const struct pv_mmu_ops xen_mmu_ops __initdata = {
.set_pmd = xen_set_pmd,

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

.make_pte = xen_make_pte,
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/lguest/lg.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ int run_guest(struct lg_cpu *cpu, unsigned long __user *user);
* first step in the migration to the kernel types. pte_pfn is already defined
* in the kernel. */
#define pgd_flags(x) (pgd_val(x) & ~PAGE_MASK)
#define pte_flags(x) (pte_val(x) & ~PAGE_MASK)
#define pgd_pfn(x) (pgd_val(x) >> PAGE_SHIFT)

/* interrupts_and_traps.c: */
Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-x86/page.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ static inline pteval_t native_pte_val(pte_t pte)
#endif

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

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

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 @@ -996,6 +997,20 @@ 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);

return ret;
}

static inline pgd_t __pgd(pgdval_t val)
{
pgdval_t ret;
Expand Down
16 changes: 8 additions & 8 deletions trunk/include/asm-x86/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,37 +164,37 @@ extern struct list_head pgd_list;
*/
static inline int pte_dirty(pte_t pte)
{
return pte_val(pte) & _PAGE_DIRTY;
return pte_flags(pte) & _PAGE_DIRTY;
}

static inline int pte_young(pte_t pte)
{
return pte_val(pte) & _PAGE_ACCESSED;
return pte_flags(pte) & _PAGE_ACCESSED;
}

static inline int pte_write(pte_t pte)
{
return pte_val(pte) & _PAGE_RW;
return pte_flags(pte) & _PAGE_RW;
}

static inline int pte_file(pte_t pte)
{
return pte_val(pte) & _PAGE_FILE;
return pte_flags(pte) & _PAGE_FILE;
}

static inline int pte_huge(pte_t pte)
{
return pte_val(pte) & _PAGE_PSE;
return pte_flags(pte) & _PAGE_PSE;
}

static inline int pte_global(pte_t pte)
{
return pte_val(pte) & _PAGE_GLOBAL;
return pte_flags(pte) & _PAGE_GLOBAL;
}

static inline int pte_exec(pte_t pte)
{
return !(pte_val(pte) & _PAGE_NX);
return !(pte_flags(pte) & _PAGE_NX);
}

static inline int pte_special(pte_t pte)
Expand Down Expand Up @@ -305,7 +305,7 @@ static inline pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot)
return __pgprot(preservebits | addbits);
}

#define pte_pgprot(x) __pgprot(pte_val(x) & ~PTE_MASK)
#define pte_pgprot(x) __pgprot(pte_flags(x) & ~PTE_MASK)

#define canon_pgprot(p) __pgprot(pgprot_val(p) & __supported_pte_mask)

Expand Down

0 comments on commit a9af52b

Please sign in to comment.