Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 80472
b: refs/heads/master
c: 5508a74
h: refs/heads/master
v: v3
  • Loading branch information
Ingo Molnar committed Jan 30, 2008
1 parent 8cc8100 commit 257ea1a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 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: bb5c2dbd57d93a36b0386dd783dd95e0cbaaa23f
refs/heads/master: 5508a7489659f1eed108d3ae7c2d36c8794ee330
8 changes: 0 additions & 8 deletions trunk/arch/x86/mm/pageattr-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,6 @@ static __init int print_split(struct split_state *s)
return err;
}

static __init int state_same(struct split_state *a, struct split_state *b)
{
return a->lpg == b->lpg && a->gpg == b->gpg && a->spg == b->spg &&
a->exec == b->exec;
}

static unsigned long __initdata addr[NTEST];
static unsigned int __initdata len[NTEST];

Expand Down Expand Up @@ -229,8 +223,6 @@ static __init int exercise_pageattr(void)
global_flush_tlb();

failed += print_split(&sc);
if (!state_same(&sa, &sc))
failed++;

if (failed)
printk(KERN_ERR "CPA selftests NOT PASSED. Please report.\n");
Expand Down
10 changes: 7 additions & 3 deletions trunk/arch/x86/mm/pageattr_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,10 @@ split_large_page(pte_t *kpte, unsigned long address, pgprot_t ref_prot)
* up for us already:
*/
tmp = lookup_address(address, &level);
if (tmp != kpte)
if (tmp != kpte) {
WARN_ON_ONCE(1);
goto out_unlock;
}

address = __pa(address);
addr = address & LARGE_PAGE_MASK;
Expand Down Expand Up @@ -181,17 +183,19 @@ EXPORT_SYMBOL(change_page_attr);
int change_page_attr_addr(unsigned long addr, int numpages, pgprot_t prot)
{
int i;
unsigned long pfn = (addr >> PAGE_SHIFT);
unsigned long pfn = (__pa(addr) >> PAGE_SHIFT);

for (i = 0; i < numpages; i++) {
if (!pfn_valid(pfn + i)) {
WARN_ON_ONCE(1);
break;
} else {
int level;
pte_t *pte = lookup_address(addr + i*PAGE_SIZE, &level);
BUG_ON(pte && !pte_none(*pte));
BUG_ON(pte && pte_none(*pte));
}
}

return change_page_attr(virt_to_page(addr), i, prot);
}

Expand Down

0 comments on commit 257ea1a

Please sign in to comment.