Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 82892
b: refs/heads/master
c: f4ae5da
h: refs/heads/master
v: v3
  • Loading branch information
Thomas Gleixner authored and Ingo Molnar committed Feb 4, 2008
1 parent 772fcf6 commit f13c85e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 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: 72e458dfa63b3db7a46f66b0eb19e9ff4e17fc0e
refs/heads/master: f4ae5da0e8e92caa168e7c2a7c4a6c4064b082c2
18 changes: 17 additions & 1 deletion trunk/arch/x86/mm/pageattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ struct cpa_data {
int numpages;
pgprot_t mask_set;
pgprot_t mask_clr;
int flushtlb;
};

static inline int
Expand Down Expand Up @@ -329,11 +330,19 @@ static int __change_page_attr(unsigned long address, struct cpa_data *cpa)
* not the memory it points to
*/
new_pte = pfn_pte(pte_pfn(old_pte), canon_pgprot(new_prot));
set_pte_atomic(kpte, new_pte);

/*
* Do we really change anything ?
*/
if (pte_val(old_pte) != pte_val(new_pte)) {
set_pte_atomic(kpte, new_pte);
cpa->flushtlb = 1;
}
} else {
err = split_large_page(kpte, address);
if (!err)
goto repeat;
cpa->flushtlb = 1;
}
return err;
}
Expand Down Expand Up @@ -438,9 +447,16 @@ static int change_page_attr_set_clr(unsigned long addr, int numpages,
cpa.numpages = numpages;
cpa.mask_set = mask_set;
cpa.mask_clr = mask_clr;
cpa.flushtlb = 0;

ret = __change_page_attr_set_clr(&cpa);

/*
* Check whether we really changed something:
*/
if (!cpa.flushtlb)
return ret;

/*
* No need to flush, when we did not set any of the caching
* attributes:
Expand Down

0 comments on commit f13c85e

Please sign in to comment.