Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 136536
b: refs/heads/master
c: d639bab
h: refs/heads/master
v: v3
  • Loading branch information
venkatesh.pallipadi@intel.com authored and Ingo Molnar committed Jan 22, 2009
1 parent 095fb31 commit 715858c
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 30 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: 6522869c34664dd5f05a0a327e93915b1281c90d
refs/heads/master: d639bab8da86d330493487e8c0fea8ca31f53427
2 changes: 1 addition & 1 deletion trunk/arch/x86/include/asm/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ extern void unxlate_dev_mem_ptr(unsigned long phys, void *addr);

extern int ioremap_change_attr(unsigned long vaddr, unsigned long size,
unsigned long prot_val);
extern void __iomem *ioremap_wc(unsigned long offset, unsigned long size);
extern void __iomem *ioremap_wc(resource_size_t offset, unsigned long size);

/*
* early_ioremap() and early_iounmap() are for temporary early boot-time
Expand Down
3 changes: 2 additions & 1 deletion 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 pte_flags(pte_t pte)
static inline pteval_t native_pte_flags(pte_t pte)
{
return native_pte_val(pte) & PTE_FLAGS_MASK;
}
Expand All @@ -173,6 +173,7 @@ static inline pteval_t 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: 18 additions & 0 deletions trunk/arch/x86/include/asm/paravirt.h
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ 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 @@ -1083,6 +1084,23 @@ 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: 12 additions & 26 deletions trunk/arch/x86/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,78 +240,64 @@ 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_clear_flags(pte, _PAGE_DIRTY);
return __pte(pte_val(pte) & ~_PAGE_DIRTY);
}

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

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

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

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

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

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

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

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

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

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

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

extern pteval_t __supported_pte_mask;
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/x86/kernel/paravirt.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ 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
2 changes: 1 addition & 1 deletion trunk/arch/x86/mm/ioremap.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ EXPORT_SYMBOL(ioremap_nocache);
*
* Must be freed with iounmap.
*/
void __iomem *ioremap_wc(unsigned long phys_addr, unsigned long size)
void __iomem *ioremap_wc(resource_size_t phys_addr, unsigned long size)
{
if (pat_enabled)
return __ioremap_caller(phys_addr, size, _PAGE_CACHE_WC,
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 @@ -1314,6 +1314,7 @@ 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 715858c

Please sign in to comment.