| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: pmap.c,v 1.279 2013/01/03 09:40:55 martin Exp $ */ | | 1 | /* $NetBSD: pmap.c,v 1.280 2013/01/25 17:12:33 hannken Exp $ */ |
2 | /* | | 2 | /* |
3 | * | | 3 | * |
4 | * Copyright (C) 1996-1999 Eduardo Horvath. | | 4 | * Copyright (C) 1996-1999 Eduardo Horvath. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * | | 7 | * |
8 | * Redistribution and use in source and binary forms, with or without | | 8 | * Redistribution and use in source and binary forms, with or without |
9 | * modification, are permitted provided that the following conditions | | 9 | * modification, are permitted provided that the following conditions |
10 | * are met: | | 10 | * are met: |
11 | * 1. Redistributions of source code must retain the above copyright | | 11 | * 1. Redistributions of source code must retain the above copyright |
12 | * notice, this list of conditions and the following disclaimer. | | 12 | * notice, this list of conditions and the following disclaimer. |
13 | * | | 13 | * |
14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND | | 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND |
| @@ -16,27 +16,27 @@ | | | @@ -16,27 +16,27 @@ |
16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | | 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE | | 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE |
18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | | 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
24 | * SUCH DAMAGE. | | 24 | * SUCH DAMAGE. |
25 | * | | 25 | * |
26 | */ | | 26 | */ |
27 | | | 27 | |
28 | #include <sys/cdefs.h> | | 28 | #include <sys/cdefs.h> |
29 | __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.279 2013/01/03 09:40:55 martin Exp $"); | | 29 | __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.280 2013/01/25 17:12:33 hannken Exp $"); |
30 | | | 30 | |
31 | #undef NO_VCACHE /* Don't forget the locked TLB in dostart */ | | 31 | #undef NO_VCACHE /* Don't forget the locked TLB in dostart */ |
32 | #define HWREF | | 32 | #define HWREF |
33 | | | 33 | |
34 | #include "opt_ddb.h" | | 34 | #include "opt_ddb.h" |
35 | #include "opt_multiprocessor.h" | | 35 | #include "opt_multiprocessor.h" |
36 | #include "opt_modular.h" | | 36 | #include "opt_modular.h" |
37 | | | 37 | |
38 | #include <sys/param.h> | | 38 | #include <sys/param.h> |
39 | #include <sys/malloc.h> | | 39 | #include <sys/malloc.h> |
40 | #include <sys/queue.h> | | 40 | #include <sys/queue.h> |
41 | #include <sys/systm.h> | | 41 | #include <sys/systm.h> |
42 | #include <sys/msgbuf.h> | | 42 | #include <sys/msgbuf.h> |
| @@ -2567,37 +2567,33 @@ pmap_clear_modify(struct vm_page *pg) | | | @@ -2567,37 +2567,33 @@ pmap_clear_modify(struct vm_page *pg) |
2567 | tsb_invalidate(va, pmap); | | 2567 | tsb_invalidate(va, pmap); |
2568 | tlb_flush_pte(va, pmap); | | 2568 | tlb_flush_pte(va, pmap); |
2569 | } | | 2569 | } |
2570 | /* Then clear the mod bit in the pv */ | | 2570 | /* Then clear the mod bit in the pv */ |
2571 | if (pv->pv_va & PV_MOD) { | | 2571 | if (pv->pv_va & PV_MOD) { |
2572 | changed |= 1; | | 2572 | changed |= 1; |
2573 | pv->pv_va &= ~PV_MOD; | | 2573 | pv->pv_va &= ~PV_MOD; |
2574 | } | | 2574 | } |
2575 | } | | 2575 | } |
2576 | } | | 2576 | } |
2577 | pv_check(); | | 2577 | pv_check(); |
2578 | mutex_exit(&pmap_lock); | | 2578 | mutex_exit(&pmap_lock); |
2579 | #ifdef DEBUG | | 2579 | #ifdef DEBUG |
2580 | if (pmap_is_modified(pg)) { | | | |
2581 | printf("pmap_clear_modify(): %p still modified!\n", pg); | | | |
2582 | Debugger(); | | | |
2583 | } | | | |
2584 | DPRINTF(PDB_CHANGEPROT|PDB_REF, ("pmap_clear_modify: pg %p %s\n", pg, | | 2580 | DPRINTF(PDB_CHANGEPROT|PDB_REF, ("pmap_clear_modify: pg %p %s\n", pg, |
2585 | (changed ? "was modified" : "was not modified"))); | | 2581 | (changed ? "was modified" : "was not modified"))); |
2586 | if (modified != changed) { | | 2582 | if (modified && modified != changed) { |
2587 | printf("pmap_clear_modify: modified %d changed %d\n", | | 2583 | printf("pmap_clear_modify: modified %d changed %d\n", |
2588 | modified, changed); | | 2584 | modified, changed); |
2589 | Debugger(); | | 2585 | Debugger(); |
2590 | } else return (modified); | | 2586 | } |
2591 | #endif | | 2587 | #endif |
2592 | return (changed); | | 2588 | return (changed); |
2593 | } | | 2589 | } |
2594 | | | 2590 | |
2595 | bool | | 2591 | bool |
2596 | pmap_clear_reference(struct vm_page *pg) | | 2592 | pmap_clear_reference(struct vm_page *pg) |
2597 | { | | 2593 | { |
2598 | struct vm_page_md * const md = VM_PAGE_TO_MD(pg); | | 2594 | struct vm_page_md * const md = VM_PAGE_TO_MD(pg); |
2599 | pv_entry_t pv; | | 2595 | pv_entry_t pv; |
2600 | int rv; | | 2596 | int rv; |
2601 | int changed = 0; | | 2597 | int changed = 0; |
2602 | #ifdef DEBUG | | 2598 | #ifdef DEBUG |
2603 | int referenced = 0; | | 2599 | int referenced = 0; |